+ char *decoded = NULL, *data = NULL;
+ getObject(http_inflatestream_object, obj);
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &data, &data_len)) {
+ RETURN_FALSE;
+ }
+
+ if (!obj->stream && !(obj->stream = http_encoding_inflate_stream_init(NULL, 0))) {
+ RETURN_FALSE;
+ }
+
+ /* flushing the inflate stream is a no-op */
+ if (!data_len) {
+ RETURN_STRINGL("", 0, 1);
+ } else if (SUCCESS == http_encoding_inflate_stream_update(obj->stream, data, data_len, &decoded, &decoded_len)) {
+ RETURN_STRINGL(decoded, decoded_len, 0);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto string HttpInflateStream::finish([string data])
+ Finalizes the inflate stream. The inflate stream can be reused after finalizing. */
+PHP_METHOD(HttpInflateStream, finish)
+{
+ int data_len = 0;
+ size_t updated_len = 0, decoded_len = 0;
+ char *updated = NULL, *decoded = NULL, *data = NULL;