cvs: php4 /ext/ircg ircg.c

From: Date: Tue, 18 Dec 2001 18:36:30 +0000
Subject: cvs: php4 /ext/ircg ircg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8714@lists.php.net to get a copy of this message
sas Tue Dec 18 13:36:30 2001 EDT Modified files: /php4/ext/ircg ircg.c Log: Let the first connection id be a function of the time to avoid problems with restarting IRCG and stale sessions. Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.125 php4/ext/ircg/ircg.c:1.126 --- php4/ext/ircg/ircg.c:1.125 Sat Dec 15 09:21:44 2001 +++ php4/ext/ircg/ircg.c Tue Dec 18 13:36:30 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.125 2001/12/15 14:21:44 hholzgra Exp $ */ +/* $Id: ircg.c,v 1.126 2001/12/18 18:36:30 sas Exp $ */ /* {{{ includes */ @@ -64,7 +64,7 @@ static HashTable h_fd2irconn; /* fd's to Integer IDs */ static HashTable h_irconn; /* Integer IDs to php_irconn_t * */ static HashTable h_fmt_msgs; /* Integer IDs to php_fmt_msgs_t * */ -static int irconn_id = 1; +static int irconn_id; static unsigned long irc_connects, irc_set_currents, irc_quit_handlers, exec_fmt_msgs, exec_token_compiler; @@ -1834,7 +1834,10 @@ ircg_copy_ctcp_msgs(p5, conn); } conn->password = conn->ident = NULL; - irconn_id++; + if (irconn_id == 0) + irconn_id = time(NULL); + else + irconn_id++; if ((irconn_id % IRCG_ERROR_MSG_GC_INTERVAL) == 0) error_msg_gc(); conn->irconn_id = irconn_id;

« previous php.cvs (#8714) next »