*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);
struct dechunk_ctx {
php_http_buffer_t buffer;
- ulong hexlen;
+ unsigned long hexlen;
unsigned zeroed:1;
};
return o;
}
-zend_object *php_http_encoding_stream_object_clone(zval *object)
+zend_object *php_http_encoding_stream_object_clone(zend_object *object)
{
- php_http_encoding_stream_object_t *new_obj, *old_obj = PHP_HTTP_OBJ(NULL, object);
+ php_http_encoding_stream_object_t *new_obj, *old_obj = PHP_HTTP_OBJ(object, NULL);
php_http_encoding_stream_t *cpy = php_http_encoding_stream_copy(old_obj->stream, NULL);
if (!cpy) {
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;
}
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;
}
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)