Found it. The error was in the register function: the size was incorrect because
only the pointer has to be stored and not a copy of the wrapper itself.

-               return zend_hash_add(&url_stream_wrappers_hash, protocol, strlen(protocol), wrapper, sizeof(wrapper), NULL);
+               return zend_hash_add(&url_stream_wrappers_hash, protocol, strlen(protocol), wrapper, sizeof(*wrapper), NULL);

marcus

Date: Sun, 17 Mar 2002 05:26:39 +0100
To: Wez Furlong <[EMAIL PROTECTED]>
From: Marcus Börger <[EMAIL PROTECTED]>
Subject: [PHP-DEV] Re: memory streams
Cc: [EMAIL PROTECTED]


Date: Sun, 17 Mar 2002 04:16:07 +0100
To: Wez Furlong <[EMAIL PROTECTED]>
From: Marcus Börger <[EMAIL PROTECTED]>
Subject: Re: [PHP-DEV] Re: memory streams

As for the strange problems you have in the exif extension;
if you switch to a stream opened with php_stream_fopen_tmpfile(),
do you still have the same troubles? (So we can try and pin
it down!).

Yep i tried it and....
Segmentation fault (core dumped)
when setting destro = NULL it works......

Tracked it down to function php_stream_open_url.
I changed
                wrapper = &php_stream_http_wrapper;
//              if (FAILURE == zend_hash_find(&url_stream_wrappers_hash, (char*)protocol, n, (void**)&wrapper)) {
//                      wrapper = NULL;
//                      protocol = NULL;
//              }

then it is o.k.: wrapper == &php_stream_http_wrapper
but when using zend_hash_find it fails

marcus

Reply via email to