repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 58736b3902365e9a50cac0832ecf8740b3070268:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 58736b3902365e9a50cac0832ecf8740b3070268
Author: Alexander Barton 
Date:   Wed Dec 22 17:37:41 2004 +0000

    Fixed indentation and added some more debug code.

diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 6a9c25f12420fbb6e4473e5809ebbf86302cb36f..
index ..f0bf5f08353989dba066f76239efa003d9940ca6 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.140 2004/10/20 13:47:32 alex Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.141 2004/12/22 17:37:41 alex Exp $";

 #include "imp.h"
 #include 
@@ -632,6 +632,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;
 	}

@@ -727,6 +730,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 */


@@ -1276,22 +1283,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 receive 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 receive 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;

-----END OF PAGE-----