Upstream: upstream argument in ngx_http_upstream_process_request().

In case of filter finalization, r->upstream might be changed during
the ngx_event_pipe() call.  Added an argument to preserve it while
calling the ngx_http_upstream_process_request() function.
This commit is contained in:
Maxim Dounin 2015-03-02 21:44:42 +03:00
parent 2b032e8df6
commit 14a93c5a15

View File

@ -76,7 +76,8 @@ static ngx_int_t ngx_http_upstream_non_buffered_filter(void *data,
static void ngx_http_upstream_process_downstream(ngx_http_request_t *r);
static void ngx_http_upstream_process_upstream(ngx_http_request_t *r,
ngx_http_upstream_t *u);
static void ngx_http_upstream_process_request(ngx_http_request_t *r);
static void ngx_http_upstream_process_request(ngx_http_request_t *r,
ngx_http_upstream_t *u);
static void ngx_http_upstream_store(ngx_http_request_t *r,
ngx_http_upstream_t *u);
static void ngx_http_upstream_dummy_handler(ngx_http_request_t *r,
@ -3349,7 +3350,7 @@ ngx_http_upstream_process_downstream(ngx_http_request_t *r)
}
}
ngx_http_upstream_process_request(r);
ngx_http_upstream_process_request(r, u);
}
@ -3417,18 +3418,17 @@ ngx_http_upstream_process_upstream(ngx_http_request_t *r,
}
}
ngx_http_upstream_process_request(r);
ngx_http_upstream_process_request(r, u);
}
static void
ngx_http_upstream_process_request(ngx_http_request_t *r)
ngx_http_upstream_process_request(ngx_http_request_t *r,
ngx_http_upstream_t *u)
{
ngx_temp_file_t *tf;
ngx_event_pipe_t *p;
ngx_http_upstream_t *u;
u = r->upstream;
p = u->pipe;
if (u->peer.connection) {