]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
Validate "ServerName" variable.
[ngircd-alex.git] / src / ngircd / conn.c
index 530be7cfec8d4288919f5d6aa97a0859b42cf8f2..39cec07ad858ecc225423e7381bc60ae177039bb 100644 (file)
@@ -17,7 +17,7 @@
 #include "portab.h"
 #include "io.h"
 
-static char UNUSED id[] = "$Id: conn.c,v 1.195 2006/05/10 21:24:01 alex Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.197 2006/07/23 15:22:56 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -383,7 +383,7 @@ NewListener( const UINT16 Port )
 
        if( ! Init_Socket( sock )) return -1;
 
-       if (bind(sock, (struct sockaddr *)&addr, (int)sizeof(addr)) != 0) {
+       if (bind(sock, (struct sockaddr *)&addr, (socklen_t)sizeof(addr)) != 0) {
                Log( LOG_CRIT, "Can't bind socket: %s!", strerror( errno ));
                close( sock );
                return -1;
@@ -845,9 +845,8 @@ Handle_Write( CONN_ID Idx )
        }
        assert( My_Connections[Idx].sock > NONE );
 
-       LogDebug("Handle_Write() called for connection %d ...", Idx);
-
        wdatalen = array_bytes(&My_Connections[Idx].wbuf );
+
 #ifdef ZLIB
        if (wdatalen == 0 && !array_bytes(&My_Connections[Idx].zip.wbuf)) {
                io_event_del(My_Connections[Idx].sock, IO_WANTWRITE );
@@ -865,8 +864,11 @@ Handle_Write( CONN_ID Idx )
        }
 #endif
 
-       /* Zip_Flush() may have changed the write buffer ... */
+       /* Zip_Flush() may have changed the write buffer ... */
        wdatalen = array_bytes(&My_Connections[Idx].wbuf);
+       LogDebug
+           ("Handle_Write() called for connection %d, %ld bytes pending ...",
+            Idx, wdatalen);
 
        len = write(My_Connections[Idx].sock,
                    array_start(&My_Connections[Idx].wbuf), wdatalen );