fix warning
[m6w6/ext-http] / src / php_http_filter.c
index f145f02b68a70dbd555483cff72fd4d356552b81..654edffa113cd1bb1868006053bbaa64375b4043 100644 (file)
@@ -302,7 +302,9 @@ static PHP_HTTP_FILTER_FUNCTION(zlib)
                
                nxt = ptr->next;
                php_stream_bucket_unlink(ptr);
-               php_http_encoding_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len);
+               if (SUCCESS != php_http_encoding_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len)) {
+                       return PSFS_ERR_FATAL;
+               }
                
 #if DBG_FILTER
                fprintf(stderr, "update: deflate (-> %zu) (w: %zu, r: %zu)\n", encoded_len, stream->writepos, stream->readpos);
@@ -322,7 +324,9 @@ static PHP_HTTP_FILTER_FUNCTION(zlib)
                char *encoded = NULL;
                size_t encoded_len = 0;
                
-               php_http_encoding_stream_flush(buffer, &encoded, &encoded_len);
+               if (SUCCESS != php_http_encoding_stream_flush(buffer, &encoded, &encoded_len)) {
+                       return PSFS_ERR_FATAL;
+               }
                
 #if DBG_FILTER
                fprintf(stderr, "flush: deflate (-> %zu)\n", encoded_len);
@@ -340,7 +344,9 @@ static PHP_HTTP_FILTER_FUNCTION(zlib)
                char *encoded = NULL;
                size_t encoded_len = 0;
                
-               php_http_encoding_stream_finish(buffer, &encoded, &encoded_len);
+               if (SUCCESS != php_http_encoding_stream_finish(buffer, &encoded, &encoded_len)) {
+                       return PSFS_ERR_FATAL;
+               }
                
 #if DBG_FILTER
                fprintf(stderr, "finish: deflate (-> %zu)\n", encoded_len);
@@ -374,7 +380,11 @@ static PHP_HTTP_FILTER_OPS(inflate) = {
        "http.inflate"
 };
 
+#if PHP_VERSION_ID >= 70200
+static php_stream_filter *http_filter_create(const char *name, zval *params, uint8_t p)
+#else
 static php_stream_filter *http_filter_create(const char *name, zval *params, int p)
+#endif
 {
        zval *tmp = params;
        php_stream_filter *f = NULL;