]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/conn.c
Added some more debug code ... [from HEAD].
[ngircd.git] / src / ngircd / conn.c
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;