]> arthur.barton.de Git - ngircd.git/commitdiff
Added some more debug code ... [from HEAD].
authorAlexander Barton <alex@barton.de>
Sat, 25 Dec 2004 00:00:42 +0000 (00:00 +0000)
committerAlexander Barton <alex@barton.de>
Sat, 25 Dec 2004 00:00:42 +0000 (00:00 +0000)
ChangeLog
src/ngircd/conn.c

index f3339d162fd5b48ad303c70ba7f8dc7c7fc6c15d..26faf74a4a66a79ea4c3b085942f177230041bf5 100644 (file)
--- 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 $
index e4c3bf1c8db468f3e321c5f175f89e387bf12b86..052765c358ffa9f45c0dc3bf7105e400284da433 100644 (file)
@@ -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 <assert.h>
@@ -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;