Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: post_action status
Сделал патч, проверьте пожалуйста на вменяемость
diff -Naur nginx-1.1.16.old nginx-1.1.16
--- nginx-1.1.16.old/src/http/modules/ngx_http_uwsgi_module.c 2012-01-18
07:07:43.000000000 -0800
+++ nginx-1.1.16/src/http/modules/ngx_http_uwsgi_module.c 2012-03-12
09:44:59.867545323 -0700
@@ -43,7 +43,6 @@
static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r);
static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r);
static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r);
static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r,
ngx_int_t rc);
@@ -912,10 +911,7 @@
}
if (rc == NGX_ERROR) {
- r->http_version = NGX_HTTP_VERSION_9;
-
u->process_header = ngx_http_uwsgi_process_header;
-
return ngx_http_uwsgi_process_header(r);
}
@@ -1009,6 +1005,7 @@
}
if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
+ u = r->upstream;
/* a whole header has been parsed successfully */
@@ -1016,11 +1013,11 @@
"http uwsgi header done");
if (r->http_version > NGX_HTTP_VERSION_9) {
- return NGX_OK;
+ if (u->headers_in.status_n) {
+ return NGX_OK;
+ }
}
- u = r->upstream;
-
if (u->headers_in.status) {
status_line = &u->headers_in.status->value;
@@ -1032,20 +1029,15 @@
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
- r->http_version = NGX_HTTP_VERSION_10;
u->headers_in.status_n = status;
u->headers_in.status_line = *status_line;
} else if (u->headers_in.location) {
- r->http_version = NGX_HTTP_VERSION_10;
u->headers_in.status_n = 302;
ngx_str_set(&u->headers_in.status_line,
"302 Moved Temporarily");
} else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent neither valid HTTP/1.0 header "
- "nor \"Status\" header line");
u->headers_in.status_n = 200;
ngx_str_set(&u->headers_in.status_line, "200 OK");
}
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|