From 7fcfa8865e97a6c8141532187428d9dd9d1217e5 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Mon, 21 Jun 2004 18:58:55 +0000 Subject: BugFix#28868: Wrapper hash not thread-safe. Userdefined wrappers were being registered into a global wrapper hash which can cross threads. Termination of once instance then has the potential to leave an active stream in another instance with no wrapper leading to segfault. --- main/php_streams.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 586148f3c6..f3461bbd7b 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -509,6 +509,7 @@ PHP_RSHUTDOWN_FUNCTION(streams); BEGIN_EXTERN_C() PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC); +PHPAPI int php_register_url_stream_wrapper_volatile(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char **path_for_open, int options TSRMLS_DC); PHPAPI char *php_stream_locate_eol(php_stream *stream, char *buf, size_t buf_len TSRMLS_DC); @@ -538,7 +539,8 @@ PHPAPI int _php_stream_make_seekable(php_stream *origstream, php_stream **newstr #define php_stream_make_seekable(origstream, newstream, flags) _php_stream_make_seekable((origstream), (newstream), (flags) STREAMS_CC TSRMLS_CC) /* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */ -PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash(); +PHPAPI HashTable *_php_stream_get_url_stream_wrappers_hash(TSRMLS_D); +#define php_stream_get_url_stream_wrappers_hash() _php_stream_get_url_stream_wrappers_hash(TSRMLS_C) PHPAPI HashTable *php_get_stream_filters_hash(); END_EXTERN_C() #endif -- cgit v1.2.1