[patch] Range filter: more appropriate restriction on max ranges.

胡聪 (hucc) hucong.c at foxmail.com
Fri Oct 27 10:44:32 UTC 2017


Hi,

Please ignore this patch, I will update later. I am sorry!


------------------ Original ------------------
From:  "胡聪 (hucc)";<hucong.c at foxmail.com>;
Date:  Oct 27, 2017
To:  "nginx-devel"<nginx-devel at nginx.org>;
Subject:  [patch] Range filter: more appropriate restriction on max ranges.

# HG changeset patch
# User hucongcong <hucong.c at foxmail.com>
# Date 1509035936 -28800
#      Fri Oct 27 00:38:56 2017 +0800
# Node ID a429a3b21a3950d69781e109111831e7c5f33566
# Parent  9ef704d8563af4aff6817ab1c694fb40591f20b3
Range filter: more appropriate restriction on max ranges.

diff -r 9ef704d8563a -r a429a3b21a39 src/http/modules/ngx_http_range_filter_module.c
--- a/src/http/modules/ngx_http_range_filter_module.c	Tue Oct 17 19:52:16 2017 +0300
+++ b/src/http/modules/ngx_http_range_filter_module.c	Fri Oct 27 00:38:56 2017 +0800
@@ -369,6 +369,11 @@ ngx_http_range_parse(ngx_http_request_t 
     found:
 
         if (start < end) {
+
+            if (ranges-- == 0) {
+                return NGX_DECLINED;
+            }
+
             range = ngx_array_push(&ctx->ranges);
             if (range == NULL) {
                 return NGX_ERROR;
@@ -383,10 +388,6 @@ ngx_http_range_parse(ngx_http_request_t 
 
             size += end - start;
 
-            if (ranges-- == 0) {
-                return NGX_DECLINED;
-            }
-
         } else if (start == 0) {
             return NGX_DECLINED;
         }
_______________________________________________
nginx-devel mailing list
nginx-devel at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


More information about the nginx-devel mailing list