try to dump the packet resulting in an overflow

This commit is contained in:
Bill Currie 2001-05-30 23:44:21 +00:00
parent 940598f240
commit 889b9ce740
2 changed files with 16 additions and 2 deletions

View file

@ -168,7 +168,7 @@ char *clc_string[] = {
#define svc_particle 18 // [vec3] <variable>
#define svc_signonnum 25 // [byte] used for the signon
// sequence
static VFile _stdout;
static VFile *Net_PacketLog;
static char **Net_sound_precache;
static sizebuf_t _packet;
@ -397,10 +397,16 @@ Log_Delta(int bits)
void
Analyze_Server_Packet (byte * data, int len)
{
if (!Net_PacketLog) {
_stdout.file = stdout;
Net_PacketLog = &_stdout;
}
packet.message->data = data;
packet.message->cursize = len;
MSG_BeginReading (&packet);
Parse_Server_Packet ();
if (Net_PacketLog == &_stdout)
Net_PacketLog = NULL;
}
@ -850,11 +856,16 @@ Parse_Server_Packet ()
void
Analyze_Client_Packet (byte * data, int len)
{
// FIXME: quick-hack
if (!Net_PacketLog) {
_stdout.file = stdout;
Net_PacketLog = &_stdout;
}
packet.message->data = data;
packet.message->cursize = len;
MSG_BeginReading (&packet);
Parse_Client_Packet ();
if (Net_PacketLog == &_stdout)
Net_PacketLog = NULL;
}
void

View file

@ -765,6 +765,9 @@ SV_SendClientMessages (void)
// if the reliable message overflowed,
// drop the client
if (c->netchan.message.overflowed) {
extern void Analyze_Server_Packet (byte *data, int len);
Analyze_Server_Packet (c->netchan.message.data, c->netchan.message.cursize);
SZ_Clear (&c->netchan.message);
SZ_Clear (&c->datagram);
SV_BroadcastPrintf (PRINT_HIGH, "%s overflowed\n", c->name);