cvs: php4(PHP_4_3) /main streams.c
| From: | Marcus Boerger | Date: | Sun, 13 Apr 2003 20:13:35 +0000 |
| Subject: | cvs: php4(PHP_4_3) /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20258@lists.php.net to get a copy of this message | ||
helly Sun Apr 13 16:13:35 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/main streams.c
Log:
MFH: persistent stream closing
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.48 php4/main/streams.c:1.125.2.49
--- php4/main/streams.c:1.125.2.48 Wed Mar 19 19:55:58 2003
+++ php4/main/streams.c Sun Apr 13 16:13:34 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.125.2.48 2003/03/20 00:55:58 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.49 2003/04/13 20:13:34 helly Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -263,6 +263,11 @@
}
/* }}} */
+int _php_stream_free_persistent(list_entry *le, void *pStream TSRMLS_DC)
+{
+ return le->ptr == pStream;
+}
+
PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */
{
int ret = 1;
@@ -387,6 +392,10 @@
#else
pefree(stream, stream->is_persistent);
#endif
+ if (stream->is_persistent) {
+ /* we don't work with *stream but need its value for comparison */
+ zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t)
_php_stream_free_persistent, stream TSRMLS_CC);
+ }
}
return ret;