comparison src/http/modules/ngx_http_uwsgi_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 3fb6615bb87f
comparison
equal deleted inserted replaced
5574:cff36d2d7fe6 5575:d15822784cf9
1015 if (rc == NGX_ERROR) { 1015 if (rc == NGX_ERROR) {
1016 u->process_header = ngx_http_uwsgi_process_header; 1016 u->process_header = ngx_http_uwsgi_process_header;
1017 return ngx_http_uwsgi_process_header(r); 1017 return ngx_http_uwsgi_process_header(r);
1018 } 1018 }
1019 1019
1020 if (u->state) { 1020 if (u->state && u->state->status == 0) {
1021 u->state->status = status->code; 1021 u->state->status = status->code;
1022 } 1022 }
1023 1023
1024 u->headers_in.status_n = status->code; 1024 u->headers_in.status_n = status->code;
1025 1025
1143 } else { 1143 } else {
1144 u->headers_in.status_n = 200; 1144 u->headers_in.status_n = 200;
1145 ngx_str_set(&u->headers_in.status_line, "200 OK"); 1145 ngx_str_set(&u->headers_in.status_line, "200 OK");
1146 } 1146 }
1147 1147
1148 if (u->state) { 1148 if (u->state && u->state->status == 0) {
1149 u->state->status = u->headers_in.status_n; 1149 u->state->status = u->headers_in.status_n;
1150 } 1150 }
1151 1151
1152 done: 1152 done:
1153 1153