X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_message.c;fp=php_http_message.c;h=b7b500b313bbea8b1308c194e14e1e653cc0b33c;hp=efdf053c244fba3d413a1adee177eabca0929083;hb=3f5da039a09164701de8638669fe6e8d4e916970;hpb=ca39d9b0f345348f48e103055d6d85f4cf0383c2 diff --git a/php_http_message.c b/php_http_message.c index efdf053..b7b500b 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -1677,6 +1677,16 @@ static PHP_METHOD(HttpMessage, toString) RETURN_EMPTY_STRING(); } +#ifdef ZTS +static size_t write_to_stream(void *s, const char *str, size_t len) +{ + TSRMLS_FETCH(); + return php_stream_write(s, str, len); +} +#else +# define write_to_stream (php_http_pass_callback_t)_php_stream_write +#endif + ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessage_toStream, 0, 0, 1) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO(); @@ -1691,7 +1701,7 @@ static PHP_METHOD(HttpMessage, toStream) PHP_HTTP_MESSAGE_OBJECT_INIT(obj); php_stream_from_zval(s, &zstream); - php_http_message_to_callback(obj->message, (php_http_pass_callback_t) _php_stream_write, s); + php_http_message_to_callback(obj->message, write_to_stream, s); } }