summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2004-06-21 18:58:55 +0000
committerSara Golemon <pollita@php.net>2004-06-21 18:58:55 +0000
commit7fcfa8865e97a6c8141532187428d9dd9d1217e5 (patch)
treec5686f91dea2654cd3bad7d90bf36ae2f5decc5a /main/php_streams.h
parentd9226a1dd0e0644334adecbfa9ab4b76969610fa (diff)
downloadphp-git-7fcfa8865e97a6c8141532187428d9dd9d1217e5.tar.gz
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.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-xmain/php_streams.h4
1 files changed, 3 insertions, 1 deletions
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