X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_encoding.c;h=3e57e2932e53233c99fa7fd408b724c4604a4f31;hp=e4d016ecb6e3ba80e2a65399b5dcb8d5ad1c4098;hb=85cce2121de3ab8993ee35c1f8d8b8f7c696fd3d;hpb=6e51a51f7f316102113460250bc66f593063ad55 diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c index e4d016e..3e57e29 100644 --- a/src/php_http_encoding.c +++ b/src/php_http_encoding.c @@ -36,7 +36,7 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c *decoded = ecalloc(1, encoded_len + 1); while ((encoded + encoded_len - e_ptr) > 0) { - ulong chunk_len = 0, rest; + unsigned long chunk_len = 0, rest; chunk_len = strtoul(e_ptr, &n_ptr, 16); @@ -237,7 +237,7 @@ void php_http_encoding_stream_free(php_http_encoding_stream_t **s) struct dechunk_ctx { php_http_buffer_t buffer; - ulong hexlen; + unsigned long hexlen; unsigned zeroed:1; }; @@ -528,7 +528,7 @@ static PHP_METHOD(HttpEncodingStream, __construct) obj = PHP_HTTP_OBJ(NULL, getThis()); if (UNEXPECTED(obj->stream)) { - php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice", NULL); + php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice"); return; } @@ -538,10 +538,12 @@ static PHP_METHOD(HttpEncodingStream, __construct) ops = php_http_encoding_stream_get_inflate_ops(); } else if (instanceof_function(obj->zo.ce, php_http_dechunk_stream_class_entry)) { ops = &php_http_encoding_dechunk_ops; +#if PHP_HTTP_HAVE_LIBBROTLI } else if (instanceof_function(obj->zo.ce, php_http_get_enbrotli_stream_class_entry())) { ops = php_http_encoding_stream_get_enbrotli_ops(); } else if (instanceof_function(obj->zo.ce, php_http_get_debrotli_stream_class_entry())) { ops = php_http_encoding_stream_get_debrotli_ops(); +#endif } else { php_http_throw(runtime, "Unknown http\\Encoding\\Stream class '%s'", obj->zo.ce->name->val); return; @@ -638,7 +640,7 @@ static PHP_METHOD(HttpEncodingStream, finish) } static zend_function_entry php_http_encoding_stream_methods[] = { - PHP_ME(HttpEncodingStream, __construct, ai_HttpEncodingStream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(HttpEncodingStream, __construct, ai_HttpEncodingStream___construct, ZEND_ACC_PUBLIC) PHP_ME(HttpEncodingStream, update, ai_HttpEncodingStream_update, ZEND_ACC_PUBLIC) PHP_ME(HttpEncodingStream, flush, ai_HttpEncodingStream_flush, ZEND_ACC_PUBLIC) PHP_ME(HttpEncodingStream, done, ai_HttpEncodingStream_done, ZEND_ACC_PUBLIC)