cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Tue, 20 Nov 2001 16:58:22 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8267@lists.php.net to get a copy of this message | ||
sas Tue Nov 20 11:58:22 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
ircg_now_time_t might be zero before the ircg writer/buffer thread is started.
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.114 php4/ext/ircg/ircg.c:1.115
--- php4/ext/ircg/ircg.c:1.114 Fri Nov 9 07:07:28 2001
+++ php4/ext/ircg/ircg.c Tue Nov 20 11:58:21 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.114 2001/11/09 12:07:28 sas Exp $ */
+/* $Id: ircg.c,v 1.115 2001/11/20 16:58:21 sas Exp $ */
/* {{{ includes */
@@ -657,14 +657,16 @@
break;
case -1: /* No message window yet. Buffer */
if (conn->buffer_count++ > 10) {
+ time_t now;
+
smart_str_free_ex(msg, 1);
- if ((
#if IRCG_API_VERSION >= 20010601
- ircg_now_time_t
-#else
- time(NULL)
+ if (ircg_now_time_t != (time_t) 0)
+ now = ircg_now_time_t;
+ else
#endif
- - conn->login) > 30)
+ gettimeofday(&now, NULL);
+ if ((now - conn->login) > 30)
irc_disconnect(&conn->conn, "Timed out waiting for window");
return;
}
@@ -1746,10 +1748,11 @@
conn->buffer.c = NULL;
conn->buffer_count = 0;
#if IRCG_API_VERSION >= 20010601
- conn->login = ircg_now_time_t;
-#else
- time(&conn->login);
+ if (ircg_now_time_t != (time_t) 0)
+ conn->login = ircg_now_time_t;
+ else
#endif
+ gettimeofday(&conn->login, NULL);
RETVAL_LONG(irconn_id);
}