Re: memory streams
| From: | (Marcus Börger) | Date: | Sun, 17 Mar 2002 12:09:40 +0000 |
| Subject: | Re: memory streams | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-81376@lists.php.net to get a copy of this message | ||
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 <wez@thebrainroom.com> From: Marcus Börger <marcus.boerger@post.rwth-aachen.de> Subject: [PHP-DEV] Re: memory streams Cc: php-dev@lists.php.netDate: Sun, 17 Mar 2002 04:16:07 +0100 To: Wez Furlong <wez@thebrainroom.com> From: Marcus Börger <marcus.boerger@post.rwth-aachen.de> Subject: Re: [PHP-DEV] Re: memory streamsTracked it down to function php_stream_open_url. I changedAs 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......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