Changeset 5073:52eb762c68a9 in nginx


Ignore:
Timestamp:
02/18/13 15:08:46 (11 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Convert:
svn:c3fe7df1-7212-e011-8a91-001109144009/trunk@5074
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/ngx_http_upstream.c

    r5072 r5073  
    5656    ngx_http_upstream_t *u);
    5757static void ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
    58     ngx_uint_t from_upstream);
     58    ngx_uint_t from_upstream, ngx_uint_t do_write);
    5959static void
    6060    ngx_http_upstream_process_non_buffered_downstream(ngx_http_request_t *r);
     
    24332433        || u->buffer.pos != u->buffer.last)
    24342434    {
    2435         ngx_http_upstream_process_upgraded(r, 1);
     2435        ngx_http_upstream_process_upgraded(r, 1, 1);
    24362436    }
    24372437
     
    24392439        || r->header_in->pos != r->header_in->last)
    24402440    {
    2441         ngx_http_upstream_process_upgraded(r, 0);
     2441        ngx_http_upstream_process_upgraded(r, 0, 1);
    24422442    }
    24432443}
     
    24472447ngx_http_upstream_upgraded_read_downstream(ngx_http_request_t *r)
    24482448{
    2449     ngx_http_upstream_process_upgraded(r, 0);
     2449    ngx_http_upstream_process_upgraded(r, 0, 0);
    24502450}
    24512451
     
    24542454ngx_http_upstream_upgraded_write_downstream(ngx_http_request_t *r)
    24552455{
    2456     ngx_http_upstream_process_upgraded(r, 1);
     2456    ngx_http_upstream_process_upgraded(r, 1, 1);
    24572457}
    24582458
     
    24622462    ngx_http_upstream_t *u)
    24632463{
    2464     ngx_http_upstream_process_upgraded(r, 1);
     2464    ngx_http_upstream_process_upgraded(r, 1, 0);
    24652465}
    24662466
     
    24702470    ngx_http_upstream_t *u)
    24712471{
    2472     ngx_http_upstream_process_upgraded(r, 0);
     2472    ngx_http_upstream_process_upgraded(r, 0, 1);
    24732473}
    24742474
     
    24762476static void
    24772477ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
    2478     ngx_uint_t from_upstream)
     2478    ngx_uint_t from_upstream, ngx_uint_t do_write)
    24792479{
    24802480    size_t                     size;
    24812481    ssize_t                    n;
    24822482    ngx_buf_t                 *b;
    2483     ngx_uint_t                 do_write;
    24842483    ngx_connection_t          *c, *downstream, *upstream, *dst, *src;
    24852484    ngx_http_upstream_t       *u;
Note: See TracChangeset for help on using the changeset viewer.