mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	Init_Conn_Struct(): Zero structure using memset().
This commit is contained in:
		| @@ -16,7 +16,7 @@ | |||||||
|  |  | ||||||
| #include "portab.h" | #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 "imp.h" | ||||||
| #include <assert.h> | #include <assert.h> | ||||||
| @@ -1518,35 +1518,14 @@ New_Server( int Server, CONN_ID Idx ) | |||||||
| LOCAL void | LOCAL void | ||||||
| Init_Conn_Struct( CONN_ID Idx ) | Init_Conn_Struct( CONN_ID Idx ) | ||||||
| { | { | ||||||
|  | 	time_t now = time( NULL ); | ||||||
| 	/* Connection-Struktur initialisieren */ | 	/* Connection-Struktur initialisieren */ | ||||||
|  |  | ||||||
|  | 	memset( &My_Connections[Idx], 0, sizeof ( CONNECTION )); | ||||||
| 	My_Connections[Idx].sock = NONE; | 	My_Connections[Idx].sock = NONE; | ||||||
| 	My_Connections[Idx].res_stat = NULL; | 	My_Connections[Idx].starttime = now; | ||||||
| 	My_Connections[Idx].host[0] = '\0'; | 	My_Connections[Idx].lastdata = now; | ||||||
| 	My_Connections[Idx].rbuf[0] = '\0'; | 	My_Connections[Idx].lastprivmsg = now; | ||||||
| 	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 |  | ||||||
| } /* Init_Conn_Struct */ | } /* Init_Conn_Struct */ | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Florian Westphal
					Florian Westphal