]> arthur.barton.de Git - ngircd.git/commitdiff
Init_Conn_Struct(): Zero structure using memset().
authorFlorian Westphal <fw@strlen.de>
Sun, 20 Mar 2005 11:00:31 +0000 (11:00 +0000)
committerFlorian Westphal <fw@strlen.de>
Sun, 20 Mar 2005 11:00:31 +0000 (11:00 +0000)
src/ngircd/conn.c

index 137d4c70e5152c0e4382aa0f7682affbe43a6023..a3960877d70723479dd59e37eed51fa781225894 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: conn.c,v 1.144 2005/03/19 18:43:48 fw Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.145 2005/03/20 11:00:31 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -1518,35 +1518,14 @@ New_Server( int Server, CONN_ID Idx )
 LOCAL void
 Init_Conn_Struct( CONN_ID Idx )
 {
+       time_t now = time( NULL );
        /* Connection-Struktur initialisieren */
 
+       memset( &My_Connections[Idx], 0, sizeof ( CONNECTION ));
        My_Connections[Idx].sock = NONE;
-       My_Connections[Idx].res_stat = NULL;
-       My_Connections[Idx].host[0] = '\0';
-       My_Connections[Idx].rbuf[0] = '\0';
-       My_Connections[Idx].rdatalen = 0;
-       My_Connections[Idx].wbuf[0] = '\0';
-       My_Connections[Idx].wdatalen = 0;
-       My_Connections[Idx].starttime = time( NULL );
-       My_Connections[Idx].lastdata = time( NULL );
-       My_Connections[Idx].lastping = 0;
-       My_Connections[Idx].lastprivmsg = time( NULL );
-       My_Connections[Idx].delaytime = 0;
-       My_Connections[Idx].bytes_in = 0;
-       My_Connections[Idx].bytes_out = 0;
-       My_Connections[Idx].msg_in = 0;
-       My_Connections[Idx].msg_out = 0;
-       My_Connections[Idx].flag = 0;
-       My_Connections[Idx].options = 0;
-
-#ifdef ZLIB
-       My_Connections[Idx].zip.rbuf[0] = '\0';
-       My_Connections[Idx].zip.rdatalen = 0;
-       My_Connections[Idx].zip.wbuf[0] = '\0';
-       My_Connections[Idx].zip.wdatalen = 0;
-       My_Connections[Idx].zip.bytes_in = 0;
-       My_Connections[Idx].zip.bytes_out = 0;
-#endif
+       My_Connections[Idx].starttime = now;
+       My_Connections[Idx].lastdata = now;
+       My_Connections[Idx].lastprivmsg = now;
 } /* Init_Conn_Struct */