From: Alexander Barton Date: Sat, 25 Dec 2004 00:00:42 +0000 (+0000) Subject: Added some more debug code ... [from HEAD]. X-Git-Tag: rel-0-8-1~2 X-Git-Url: https://arthur.barton.de/gitweb/?p=ngircd.git;a=commitdiff_plain;h=33cec4efd9b00af2ec6113c2372508d2f388887a Added some more debug code ... [from HEAD]. --- diff --git a/ChangeLog b/ChangeLog index f3339d16..26faf74a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ ngircd 0.8-CVS + - Added some more debug code ... - Fixed wrong variable names in output of "ngircd --configtest". - Debian: Fxied the name of the "default file" in the init script for ngircd-full packages. And do the test if the binary is executable after @@ -538,4 +539,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.233.2.8 2004/09/27 11:30:52 alex Exp $ +$Id: ChangeLog,v 1.233.2.9 2004/12/25 00:00:42 alex Exp $ diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index e4c3bf1c..052765c3 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -16,7 +16,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: conn.c,v 1.134.2.2 2004/05/30 16:24:21 alex Exp $"; +static char UNUSED id[] = "$Id: conn.c,v 1.134.2.3 2004/12/25 00:00:42 alex Exp $"; #include "imp.h" #include @@ -628,6 +628,9 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ) { /* Conn_Close() has been called recursively for this link; * probabe reason: Try_Write() failed -- see below. */ +#ifdef DEBUG + Log( LOG_DEBUG, "Recursive request to close connection: %d", Idx ); +#endif return; } @@ -723,6 +726,10 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ) /* Clean up connection structure (=free it) */ Init_Conn_Struct( Idx ); + +#ifdef DEBUG + Log( LOG_DEBUG, "Shutdown of connection %d completed.", Idx ); +#endif } /* Conn_Close */ @@ -1272,22 +1279,20 @@ Handle_Buffer( CONN_ID Idx ) /* Mit dem letzten Befehl wurde Socket-Kompression aktiviert. * Evtl. schon vom Socket gelesene Daten in den Unzip-Puffer * umkopieren, damit diese nun zunaechst entkomprimiert werden */ + if( My_Connections[Idx].rdatalen > ZREADBUFFER_LEN ) { - if( My_Connections[Idx].rdatalen > ZREADBUFFER_LEN ) - { - /* Hupsa! Soviel Platz haben wir aber gar nicht! */ - Log( LOG_ALERT, "Can't move read buffer: No space left in unzip buffer (need %d bytes)!", My_Connections[Idx].rdatalen ); - return FALSE; - } - memcpy( My_Connections[Idx].zip.rbuf, My_Connections[Idx].rbuf, My_Connections[Idx].rdatalen ); - My_Connections[Idx].zip.rdatalen = My_Connections[Idx].rdatalen; - My_Connections[Idx].rdatalen = 0; -#ifdef DEBUG - Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen ); -#endif + /* Hupsa! Soviel Platz haben wir aber gar nicht! */ + Log( LOG_ALERT, "Can't move read buffer: No space left in unzip buffer (need %d bytes)!", My_Connections[Idx].rdatalen ); + return FALSE; } + memcpy( My_Connections[Idx].zip.rbuf, My_Connections[Idx].rbuf, My_Connections[Idx].rdatalen ); + My_Connections[Idx].zip.rdatalen = My_Connections[Idx].rdatalen; + My_Connections[Idx].rdatalen = 0; +#ifdef DEBUG + Log( LOG_DEBUG, "Moved already received data (%d bytes) to uncompression buffer.", My_Connections[Idx].zip.rdatalen ); +#endif /* DEBUG */ } -#endif +#endif /* ZLIB */ } if( action ) result = TRUE;