mirror of
https://github.com/php/php-src.git
synced 2026-04-27 18:23:26 +02:00
MFH: persistent stream closing
This commit is contained in:
@@ -263,6 +263,11 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
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 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user