changeset 3629:a2a3378824ba

fix r3628
author Igor Sysoev <igor@sysoev.ru>
date Tue, 15 Jun 2010 15:27:06 +0000
parents cf47471a9eda
children b5819529738a
files src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_uwsgi_module.c
diffstat 2 files changed, 11 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -83,9 +83,6 @@ typedef struct {
 } ngx_http_proxy_ctx_t;
 
 
-#define NGX_HTTP_PROXY_PARSE_NO_HEADER  20
-
-
 static ngx_int_t ngx_http_proxy_eval(ngx_http_request_t *r,
     ngx_http_proxy_ctx_t *ctx, ngx_http_proxy_loc_conf_t *plcf);
 #if (NGX_HTTP_CACHE)
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -36,17 +36,6 @@ typedef struct {
 } ngx_http_uwsgi_loc_conf_t;
 
 
-typedef struct {
-    ngx_uint_t                 status;
-    ngx_uint_t                 status_count;
-    u_char                    *status_start;
-    u_char                    *status_end;
-} ngx_http_uwsgi_ctx_t;
-
-
-#define NGX_HTTP_UWSGI_PARSE_NO_HEADER  20
-
-
 static ngx_int_t ngx_http_uwsgi_eval(ngx_http_request_t *r,
     ngx_http_uwsgi_loc_conf_t *uwcf);
 static ngx_int_t ngx_http_uwsgi_create_request(ngx_http_request_t *r);
@@ -424,8 +413,8 @@ static ngx_int_t
 ngx_http_uwsgi_handler(ngx_http_request_t *r)
 {
     ngx_int_t                   rc;
+    ngx_http_status_t          *status;
     ngx_http_upstream_t        *u;
-    ngx_http_uwsgi_ctx_t       *ctx;
     ngx_http_uwsgi_loc_conf_t  *uwcf;
 
     if (r->subrequest_in_memory) {
@@ -439,12 +428,12 @@ ngx_http_uwsgi_handler(ngx_http_request_
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
 
-    ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_uwsgi_ctx_t));
-    if (ctx == NULL) {
+    status = ngx_pcalloc(r->pool, sizeof(ngx_http_status_t));
+    if (status == NULL) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
 
-    ngx_http_set_ctx(r, ctx, ngx_http_uwsgi_module);
+    ngx_http_set_ctx(r, status, ngx_http_uwsgi_module);
 
     uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
 
@@ -844,18 +833,18 @@ ngx_http_uwsgi_create_request(ngx_http_r
 static ngx_int_t
 ngx_http_uwsgi_reinit_request(ngx_http_request_t *r)
 {
-    ngx_http_uwsgi_ctx_t  *ctx;
+    ngx_http_status_t  *status;
 
-    ctx = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
+    status = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
 
-    if (ctx == NULL) {
+    if (status == NULL) {
         return NGX_OK;
     }
 
-    ctx->status = 0;
-    ctx->status_count = 0;
-    ctx->status_start = NULL;
-    ctx->status_end = NULL;
+    status->code = 0;
+    status->count = 0;
+    status->start = NULL;
+    status->end = NULL;
 
     r->upstream->process_header = ngx_http_uwsgi_process_status_line;