summaryrefslogtreecommitdiff
path: root/main/streams/php_stream_context.h
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2003-06-13 21:33:59 +0000
committerSara Golemon <pollita@php.net>2003-06-13 21:33:59 +0000
commit99db19661a60396aaebc91b75fbf474e1ebd9678 (patch)
tree5fe391bc5f551191e3becb1501c1443b5e973215 /main/streams/php_stream_context.h
parent785bc24a9b9f4206493759b5e9d71fde27630d54 (diff)
downloadphp-git-99db19661a60396aaebc91b75fbf474e1ebd9678.tar.gz
Plug leak (context options not freed)
Make contexts auto-registered, ensures userland contexts and C API contexts are both dealt with on request shutdown. Also brings contexts in keeping with streams which are already auto-registered.
Diffstat (limited to 'main/streams/php_stream_context.h')
-rw-r--r--main/streams/php_stream_context.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h
index 02aff9e862..488029938b 100644
--- a/main/streams/php_stream_context.h
+++ b/main/streams/php_stream_context.h
@@ -38,6 +38,8 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
FG(default_context) ? FG(default_context) : \
(FG(default_context) = php_stream_context_alloc()) )
+#define php_stream_context_to_zval(context, zval) { ZVAL_RESOURCE(zval, (context)->rsrc_id); }
+
typedef struct _php_stream_notifier {
php_stream_notification_func func;
void *ptr;
@@ -48,6 +50,7 @@ typedef struct _php_stream_notifier {
struct _php_stream_context {
php_stream_notifier *notifier;
zval *options; /* hash keyed by wrapper family or specific wrapper */
+ int rsrc_id; /* used for auto-cleanup */
};
PHPAPI void php_stream_context_free(php_stream_context *context);