From 93bd170770a27f9cb6d472bcf7b647dcd56233c8 Mon Sep 17 00:00:00 2001 From: Adam Olsen Date: Sun, 9 Dec 2001 09:40:53 +0000 Subject: [PATCH] - add some comments to SV_ReliableSVC_Emit - don't push back the backbuffer if it's got max buffers already --- qw/source/sv_nchan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qw/source/sv_nchan.c b/qw/source/sv_nchan.c index fef35c5be..9558d9fce 100644 --- a/qw/source/sv_nchan.c +++ b/qw/source/sv_nchan.c @@ -56,6 +56,8 @@ PushBackbuf (client_t *cl) cl->num_backbuf++; } +// Writes the given block into either cl->netchan.message, or the +// backbuffer if there's no room void SV_ReliableSVC_Emit (client_t *cl, int type, void *block) { @@ -72,7 +74,7 @@ SV_ReliableSVC_Emit (client_t *cl, int type, void *block) cl->netchan.message.cursize = oldsize; } - if (retval == NET_SHORT) { + if (retval == NET_SHORT && cl->num_backbuf < MAX_BACK_BUFFERS) { PushBackbuf (cl); retval = NET_SVC_Emit (type, block, &cl->backbuf); } @@ -82,7 +84,8 @@ SV_ReliableSVC_Emit (client_t *cl, int type, void *block) SV_Printf ("SV_ReliableSVC_Emit: WARNING: reliable " "overflow for %s with %d (%s) block\n", cl->name, type, NET_SVC_GetString (type)); - cl->netchan.message.overflowed = true; + cl->netchan.message.overflowed = true; // this will drop + // the client break; case NET_ERROR: Sys_Error ("SV_ReliableSVC_Emit: error emitting %d (%s) "