Changeset 7250:ec4d95eed062 in nginx


Ignore:
Timestamp:
03/22/18 15:43:49 (2 years ago)
Author:
Roman Arutyunyan <arut@…>
Branch:
default
Phase:
public
Message:

Stream: set action before each recv/send while proxying.

Now it's clear from log error message if the error occurred on client or
upstream side.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/stream/ngx_stream_proxy_module.c

    r7174 r7250  
    802802    }
    803803
    804     c->log->action = "proxying connection";
    805 
    806804    if (u->upstream_buf.start == NULL) {
    807805        p = ngx_pnalloc(c->pool, pscf->buffer_size);
     
    14501448    ngx_uint_t do_write)
    14511449{
     1450    char                         *recv_action, *send_action;
    14521451    off_t                        *received, limit;
    14531452    size_t                        size, limit_rate;
     
    14931492        out = &u->downstream_out;
    14941493        busy = &u->downstream_busy;
     1494        recv_action = "proxying and reading from upstream";
     1495        send_action = "proxying and sending to client";
    14951496
    14961497    } else {
     
    15021503        out = &u->upstream_out;
    15031504        busy = &u->upstream_busy;
     1505        recv_action = "proxying and reading from client";
     1506        send_action = "proxying and sending to upstream";
    15041507    }
    15051508
     
    15091512
    15101513            if (*out || *busy || dst->buffered) {
     1514                c->log->action = send_action;
     1515
    15111516                rc = ngx_stream_top_filter(s, *out, from_upstream);
    15121517
     
    15521557            }
    15531558
     1559            c->log->action = recv_action;
     1560
    15541561            n = src->recv(src, b->last, size);
    15551562
     
    16201627        break;
    16211628    }
     1629
     1630    c->log->action = "proxying connection";
    16221631
    16231632    if (src->read->eof && dst && (dst->read->eof || !dst->buffered)) {
Note: See TracChangeset for help on using the changeset viewer.