[http_rewrite] Avoid duplicate non-cacheable variable calls for complex expressions

When defining a rewrite variable from a non-cacheable variable (set $var $computed_var), I've noticed 2 calls to $computed_var's get_handler (one to determine the total length of the created variable, the other to get the variable contents and copy them into the allocated buffer). Setting the flushed variable seems to address the problem while not breaking any existing test.
This commit is contained in:
Thomas P. 2024-09-10 13:04:31 +02:00 committed by GitHub
parent 00637cce36
commit 354870a502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,6 +174,7 @@ ngx_http_rewrite_handler(ngx_http_request_t *r)
e->quote = 1;
e->log = rlcf->log;
e->status = NGX_DECLINED;
e->flushed = 1;
while (*(uintptr_t *) e->ip) {
code = *(ngx_http_script_code_pt *) e->ip;