cvs: php-src /ext/standard streamsfuncs.c /main/streams filter.c php_stream_filter_api.h

From: Date: Tue, 29 Mar 2005 04:02:04 +0000
Subject: cvs: php-src /ext/standard streamsfuncs.c /main/streams filter.c php_stream_filter_api.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-31148@lists.php.net to get a copy of this message
pollita Mon Mar 28 23:02:04 2005 EDT Modified files: /php-src/main/streams php_stream_filter_api.h filter.c /php-src/ext/standard streamsfuncs.c Log: BugFix #31137 stream_filter_remove() segfaults when stream already closed http://cvs.php.net/diff.php/php-src/main/streams/php_stream_filter_api.h?r1=1.11&r2=1.12&ty=u Index: php-src/main/streams/php_stream_filter_api.h diff -u php-src/main/streams/php_stream_filter_api.h:1.11 php-src/main/streams/php_stream_filter_api.h:1.12 --- php-src/main/streams/php_stream_filter_api.h:1.11 Mon Sep 13 23:48:16 2004 +++ php-src/main/streams/php_stream_filter_api.h Mon Mar 28 23:02:02 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_stream_filter_api.h,v 1.11 2004/09/14 03:48:16 pollita Exp $ */ +/* $Id: php_stream_filter_api.h,v 1.12 2005/03/29 04:02:02 pollita Exp $ */ /* The filter API works on the principle of "Bucket-Brigades". This is * partially inspired by the Apache 2 method of doing things, although @@ -117,6 +117,9 @@ /* buffered buckets */ php_stream_bucket_brigade buffer; + + /* filters are auto_registered when they're applied */ + int rsrc_id; }; /* stack filter onto a stream */ http://cvs.php.net/diff.php/php-src/main/streams/filter.c?r1=1.15&r2=1.16&ty=u Index: php-src/main/streams/filter.c diff -u php-src/main/streams/filter.c:1.15 php-src/main/streams/filter.c:1.16 --- php-src/main/streams/filter.c:1.15 Mon Sep 13 23:48:16 2004 +++ php-src/main/streams/filter.c Mon Mar 28 23:02:02 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filter.c,v 1.15 2004/09/14 03:48:16 pollita Exp $ */ +/* $Id: filter.c,v 1.16 2005/03/29 04:02:02 pollita Exp $ */ #include "php.h" #include "php_globals.h" @@ -499,6 +499,11 @@ } else { filter->chain->tail = filter->prev; } + + if (filter->rsrc_id > 0) { + zend_list_delete(filter->rsrc_id); + } + if (call_dtor) { php_stream_filter_free(filter TSRMLS_CC); return NULL; http://cvs.php.net/diff.php/php-src/ext/standard/streamsfuncs.c?r1=1.54&r2=1.55&ty=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.54 php-src/ext/standard/streamsfuncs.c:1.55 --- php-src/ext/standard/streamsfuncs.c:1.54 Sun Mar 13 12:03:55 2005 +++ php-src/ext/standard/streamsfuncs.c Mon Mar 28 23:02:03 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.54 2005/03/13 17:03:55 iliaa Exp $ */ +/* $Id: streamsfuncs.c,v 1.55 2005/03/29 04:02:03 pollita Exp $ */ #include "php.h" #include "php_globals.h" @@ -1097,7 +1097,7 @@ } if (filter) { - RETURN_RESOURCE(ZEND_REGISTER_RESOURCE(NULL, filter, php_file_le_stream_filter())); + RETURN_RESOURCE(filter->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, filter, php_file_le_stream_filter())); } else { RETURN_FALSE; }

« previous php.cvs (#31148) next »