cvs: php4 /main/streams streams.c

From: Date: Sun, 13 Apr 2003 19:47:56 +0000
Subject: cvs: php4 /main/streams streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20252@lists.php.net to get a copy of this message
helly Sun Apr 13 15:47:56 2003 EDT Modified files: /php4/main/streams streams.c Log: Fix persistent stream closing (that one took me at least 3 days) Index: php4/main/streams/streams.c diff -u php4/main/streams/streams.c:1.17 php4/main/streams/streams.c:1.18 --- php4/main/streams/streams.c:1.17 Thu Apr 3 20:33:58 2003 +++ php4/main/streams/streams.c Sun Apr 13 15:47:55 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.17 2003/04/04 01:33:58 pollita Exp $ */ +/* $Id: streams.c,v 1.18 2003/04/13 19:47:55 helly Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -238,6 +238,11 @@ } /* }}} */ +int _php_stream_free_persistend(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; @@ -364,6 +369,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_persistend, stream TSRMLS_CC); + } } return ret;

« previous php.cvs (#20252) next »