[PATCH] Add Range support with gzip filter output

xunen leixunen at gmail.com
Fri May 3 02:51:58 UTC 2013


Hello,

in case of gzip filter output for range header request(Range: start-end),
range module is not work, attached patch fixes this.

Thanks,
Zhou.Lei


diff -urN nginx-1.4.0/auto/modules nginx-1.4.0-patched/auto/modules
--- nginx-1.4.0/auto/modules 2013-03-20 18:36:57.000000000 +0800
+++ nginx-1.4.0-patched/auto/modules 2013-05-03 10:29:33.000000000 +0800
@@ -125,8 +125,6 @@
     HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SPDY_FILTER_MODULE"
 fi

-HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE"
-
 if [ $HTTP_GZIP = YES ]; then
     have=NGX_HTTP_GZIP . auto/have
     USE_ZLIB=YES
@@ -134,6 +132,8 @@
     HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_SRCS"
 fi

+HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE"
+
 if [ $HTTP_POSTPONE = YES ]; then
     HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
     HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
diff -urN nginx-1.4.0/src/http/modules/ngx_http_gzip_filter_module.c
nginx-1.4.0-patched/src/http/modules/ngx_http_gzip_filter_module.c
--- nginx-1.4.0/src/http/modules/ngx_http_gzip_filter_module.c 2013-03-11
19:19:58.000000000 +0800
+++ nginx-1.4.0-patched/src/http/modules/ngx_http_gzip_filter_module.c
2013-05-03
10:31:14.000000000 +0800
@@ -245,6 +245,7 @@

     if (!conf->enable
         || (r->headers_out.status != NGX_HTTP_OK
+            && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT
             && r->headers_out.status != NGX_HTTP_FORBIDDEN
             && r->headers_out.status != NGX_HTTP_NOT_FOUND)
         || (r->headers_out.content_encoding
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130503/20b13365/attachment.html>


More information about the nginx-devel mailing list