comparison src/http/modules/ngx_http_scgi_module.c @ 5575:d15822784cf9

Upstream: fix $upstream_status variable. Previously, upstream's status code was overwritten with cached response's status code when STALE or REVALIDATED response was sent to the client. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
author Piotr Sikora <piotr@cloudflare.com>
date Tue, 11 Feb 2014 21:54:42 -0800
parents 9d056f10fb99
children c95d7882dfc9
comparison
equal deleted inserted replaced
5574:cff36d2d7fe6 5575:d15822784cf9
883 if (rc == NGX_ERROR) { 883 if (rc == NGX_ERROR) {
884 u->process_header = ngx_http_scgi_process_header; 884 u->process_header = ngx_http_scgi_process_header;
885 return ngx_http_scgi_process_header(r); 885 return ngx_http_scgi_process_header(r);
886 } 886 }
887 887
888 if (u->state) { 888 if (u->state && u->state->status == 0) {
889 u->state->status = status->code; 889 u->state->status = status->code;
890 } 890 }
891 891
892 u->headers_in.status_n = status->code; 892 u->headers_in.status_n = status->code;
893 893
1011 } else { 1011 } else {
1012 u->headers_in.status_n = 200; 1012 u->headers_in.status_n = 200;
1013 ngx_str_set(&u->headers_in.status_line, "200 OK"); 1013 ngx_str_set(&u->headers_in.status_line, "200 OK");
1014 } 1014 }
1015 1015
1016 if (u->state) { 1016 if (u->state && u->state->status == 0) {
1017 u->state->status = u->headers_in.status_n; 1017 u->state->status = u->headers_in.status_n;
1018 } 1018 }
1019 1019
1020 done: 1020 done:
1021 1021