Klaus Demo nginx / 205394e
Uwsgi: merged r->http_version fixes from scgi module. Fixed incorrect use of r->http_version (r4372). Removed duplicate function declaration (r4373). Removed error if there is no Status header (r4374). Maxim Dounin 10 years ago
1 changed file(s) with 3 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
4141 static ngx_int_t ngx_http_uwsgi_create_request(ngx_http_request_t *r);
4242 static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r);
4343 static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r);
44 static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
4544 static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
4645 static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r);
4746 static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r,
911910 }
912911
913912 if (rc == NGX_ERROR) {
914 r->http_version = NGX_HTTP_VERSION_9;
915
916913 u->process_header = ngx_http_uwsgi_process_header;
917
918914 return ngx_http_uwsgi_process_header(r);
919915 }
920916
10141010 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
10151011 "http uwsgi header done");
10161012
1017 if (r->http_version > NGX_HTTP_VERSION_9) {
1013 u = r->upstream;
1014
1015 if (u->headers_in.status_n) {
10181016 return NGX_OK;
10191017 }
1020
1021 u = r->upstream;
10221018
10231019 if (u->headers_in.status) {
10241020 status_line = &u->headers_in.status->value;
10311027 return NGX_HTTP_UPSTREAM_INVALID_HEADER;
10321028 }
10331029
1034 r->http_version = NGX_HTTP_VERSION_10;
10351030 u->headers_in.status_n = status;
10361031 u->headers_in.status_line = *status_line;
10371032
10381033 } else if (u->headers_in.location) {
1039 r->http_version = NGX_HTTP_VERSION_10;
10401034 u->headers_in.status_n = 302;
10411035 ngx_str_set(&u->headers_in.status_line,
10421036 "302 Moved Temporarily");
10431037
10441038 } else {
1045 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
1046 "upstream sent neither valid HTTP/1.0 header "
1047 "nor \"Status\" header line");
10481039 u->headers_in.status_n = 200;
10491040 ngx_str_set(&u->headers_in.status_line, "200 OK");
10501041 }