[nginx] Index: fixed handling of non-cacheable variables.

Maxim Dounin mdounin at mdounin.ru
Sat Jul 18 17:12:09 UTC 2026


details:   http://freenginx.org/hg/nginx/rev/511b31fbc525
branches:  
changeset: 9576:511b31fbc525
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat Jul 18 19:45:55 2026 +0300
description:
Index: fixed handling of non-cacheable variables.

Previously, "e.flushed = 1;" was incorrectly used during initial length
calculations, and as a result non-cacheable variables were not flushed.
The fix is to only set "e.flushed" when evaluating values.

A similar issue in try_files was fixed in 2424:46d11bff21ef (0.7.29).

diffstat:

 src/http/modules/ngx_http_index_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (19 lines):

diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -149,7 +149,6 @@ ngx_http_index_handler(ngx_http_request_
 
             e.ip = index[i].lengths->elts;
             e.request = r;
-            e.flushed = 1;
 
             /* 1 is for terminating '\0' as in static names */
             len = 1;
@@ -186,6 +185,7 @@ ngx_http_index_handler(ngx_http_request_
             e.ip = index[i].values->elts;
             e.pos = name;
             e.end = name + allocated;
+            e.flushed = 1;
 
             while (*(uintptr_t *) e.ip) {
                 code = *(ngx_http_script_code_pt *) e.ip;


More information about the nginx-devel mailing list