static php_http_encoding_stream_t *dechunk_init(php_http_encoding_stream_t *s)
{
struct dechunk_ctx *ctx = pecalloc(1, sizeof(*ctx), (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT));
- TSRMLS_FETCH_FROM_CTX(s->ts);
if (!php_http_buffer_init_ex(&ctx->buffer, PHP_HTTP_BUFFER_DEFAULT_SIZE, (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT) ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0)) {
return NULL;
/* append input to buffer */
php_http_buffer_append(PHP_HTTP_BUFFER(ctx->opaque), data, data_len);
-
+
retry_raw_inflate:
ctx->next_in = (Bytef *) PHP_HTTP_BUFFER_VAL(ctx->opaque);
ctx->avail_in = PHP_HTTP_BUFFER_LEN(ctx->opaque);
php_http_encoding_stream_object_t *o = (php_http_encoding_stream_object_t *) object;
if (o->stream) {
- php_http_encoding_stream_free(&o->stream TSRMLS_CC);
+ php_http_encoding_stream_free(&o->stream);
}
zend_object_std_dtor((zend_object *) o TSRMLS_CC);
efree(o);
PHP_METHOD(HttpEncodingStream, __construct)
{
- with_error_handling(EH_THROW, PHP_HTTP_EX_CE(runtime)) {
+ with_error_handling(EH_THROW, php_http_exception_class_entry) {
long flags = 0;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) {
- with_error_handling(EH_THROW, PHP_HTTP_EX_CE(encoding)) {
+ with_error_handling(EH_THROW, php_http_exception_class_entry) {
php_http_encoding_stream_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (!obj->stream) {
size_t encoded_len;
char *encoded_str;
- if (SUCCESS == php_http_encoding_stream_update(obj->stream, data_str, data_len, &encoded_str, &encoded_len TSRMLS_CC)) {
+ if (SUCCESS == php_http_encoding_stream_update(obj->stream, data_str, data_len, &encoded_str, &encoded_len)) {
RETURN_STRINGL(encoded_str, encoded_len, 0);
}
}
char *encoded_str;
size_t encoded_len;
- if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len TSRMLS_CC)) {
+ if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len)) {
RETURN_STRINGL(encoded_str, encoded_len, 0);
}
}
char *encoded_str;
size_t encoded_len;
- if (SUCCESS == php_http_encoding_stream_finish(obj->stream, &encoded_str, &encoded_len TSRMLS_CC)) {
+ if (SUCCESS == php_http_encoding_stream_finish(obj->stream, &encoded_str, &encoded_len)) {
if (SUCCESS == php_http_encoding_stream_reset(&obj->stream)) {
RETURN_STRINGL(encoded_str, encoded_len, 0);
} else {