cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Sun, 18 Feb 2001 09:44:29 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4083@lists.php.net to get a copy of this message | ||
sas Sun Feb 18 01:44:29 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
irc_write_buf_del() performs a final flush now, if the fd is not dead yet.
afterwards we perform a shutdown() on the socket, so that thttpd
notices that the socket is to be closed. Otherwise, we might do
two close()s which is bad (as the fd might be reused in the meantime).
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.29 php4/ext/ircg/ircg.c:1.30
--- php4/ext/ircg/ircg.c:1.29 Sun Feb 18 01:32:28 2001
+++ php4/ext/ircg/ircg.c Sun Feb 18 01:44:29 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.29 2001/02/18 09:32:28 sas Exp $ */
+/* $Id: ircg.c,v 1.30 2001/02/18 09:44:29 sas Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -153,9 +153,9 @@
php_irconn_t *conn = dummy;
if (conn->fd > -1) {
- close(conn->fd);
zend_hash_index_del(&h_fd2irconn, conn->fd);
irc_write_buf_del(&conn->wb);
+ shutdown(conn->fd, 2);
}
conn->fd = -2;
zend_hash_index_del(&h_irconn, conn->irconn_id);