aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-02-18 15:08:46 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2013-02-18 15:08:46 +0000
commit82d48e1eba774747a72c997a4e22f068f95e6cc7 (patch)
tree9014a9df29fe175d3fe896493050ee241aea38ee /src/http/ngx_http_upstream.c
parent08a73b4aadebd9405ac52ec1f6eef5ca1fe8c11a (diff)
downloadnginx-82d48e1eba774747a72c997a4e22f068f95e6cc7.tar.gz
nginx-82d48e1eba774747a72c997a4e22f068f95e6cc7.zip
Proxy: fixed do_write handling in previous commit.
As rightfully complained by MSVC, do_write variable was used uninitialized. Correct fix is to set it's initial value based on event happened.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 8c6367397..6a77f7f03 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -55,7 +55,7 @@ static void ngx_http_upstream_upgraded_read_upstream(ngx_http_request_t *r,
static void ngx_http_upstream_upgraded_write_upstream(ngx_http_request_t *r,
ngx_http_upstream_t *u);
static void ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
- ngx_uint_t from_upstream);
+ ngx_uint_t from_upstream, ngx_uint_t do_write);
static void
ngx_http_upstream_process_non_buffered_downstream(ngx_http_request_t *r);
static void
@@ -2432,13 +2432,13 @@ ngx_http_upstream_upgrade(ngx_http_request_t *r, ngx_http_upstream_t *u)
if (u->peer.connection->read->ready
|| u->buffer.pos != u->buffer.last)
{
- ngx_http_upstream_process_upgraded(r, 1);
+ ngx_http_upstream_process_upgraded(r, 1, 1);
}
if (c->read->ready
|| r->header_in->pos != r->header_in->last)
{
- ngx_http_upstream_process_upgraded(r, 0);
+ ngx_http_upstream_process_upgraded(r, 0, 1);
}
}
@@ -2446,14 +2446,14 @@ ngx_http_upstream_upgrade(ngx_http_request_t *r, ngx_http_upstream_t *u)
static void
ngx_http_upstream_upgraded_read_downstream(ngx_http_request_t *r)
{
- ngx_http_upstream_process_upgraded(r, 0);
+ ngx_http_upstream_process_upgraded(r, 0, 0);
}
static void
ngx_http_upstream_upgraded_write_downstream(ngx_http_request_t *r)
{
- ngx_http_upstream_process_upgraded(r, 1);
+ ngx_http_upstream_process_upgraded(r, 1, 1);
}
@@ -2461,7 +2461,7 @@ static void
ngx_http_upstream_upgraded_read_upstream(ngx_http_request_t *r,
ngx_http_upstream_t *u)
{
- ngx_http_upstream_process_upgraded(r, 1);
+ ngx_http_upstream_process_upgraded(r, 1, 0);
}
@@ -2469,18 +2469,17 @@ static void
ngx_http_upstream_upgraded_write_upstream(ngx_http_request_t *r,
ngx_http_upstream_t *u)
{
- ngx_http_upstream_process_upgraded(r, 0);
+ ngx_http_upstream_process_upgraded(r, 0, 1);
}
static void
ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
- ngx_uint_t from_upstream)
+ ngx_uint_t from_upstream, ngx_uint_t do_write)
{
size_t size;
ssize_t n;
ngx_buf_t *b;
- ngx_uint_t do_write;
ngx_connection_t *c, *downstream, *upstream, *dst, *src;
ngx_http_upstream_t *u;
ngx_http_core_loc_conf_t *clcf;