comparison src/stream/ngx_stream_proxy_module.c @ 6461:a01e315b3a78

Stream: additional logging for UDP.
author Vladimir Homutov <vl@nginx.com>
date Fri, 18 Mar 2016 19:53:22 +0300
parents 8f038068f4bc
children cb8177ca0990
comparison
equal deleted inserted replaced
6460:034329824dd3 6461:a01e315b3a78
550 550
551 if (ngx_connection_local_sockaddr(pc, &str, 1) == NGX_OK) { 551 if (ngx_connection_local_sockaddr(pc, &str, 1) == NGX_OK) {
552 handler = c->log->handler; 552 handler = c->log->handler;
553 c->log->handler = NULL; 553 c->log->handler = NULL;
554 554
555 ngx_log_error(NGX_LOG_INFO, c->log, 0, "proxy %V connected to %V", 555 ngx_log_error(NGX_LOG_INFO, c->log, 0,
556 "%sproxy %V connected to %V",
557 pc->type == SOCK_DGRAM ? "udp " : "",
556 &str, u->peer.name); 558 &str, u->peer.name);
557 559
558 c->log->handler = handler; 560 c->log->handler = handler;
559 } 561 }
560 } 562 }
1220 if (src->read->eof && (b->pos == b->last || (dst && dst->read->eof))) { 1222 if (src->read->eof && (b->pos == b->last || (dst && dst->read->eof))) {
1221 handler = c->log->handler; 1223 handler = c->log->handler;
1222 c->log->handler = NULL; 1224 c->log->handler = NULL;
1223 1225
1224 ngx_log_error(NGX_LOG_INFO, c->log, 0, 1226 ngx_log_error(NGX_LOG_INFO, c->log, 0,
1225 "%s disconnected" 1227 "%s%s disconnected"
1226 ", bytes from/to client:%O/%O" 1228 ", bytes from/to client:%O/%O"
1227 ", bytes from/to upstream:%O/%O", 1229 ", bytes from/to upstream:%O/%O",
1230 src->type == SOCK_DGRAM ? "udp " : "",
1228 from_upstream ? "upstream" : "client", 1231 from_upstream ? "upstream" : "client",
1229 s->received, c->sent, u->received, pc ? pc->sent : 0); 1232 s->received, c->sent, u->received, pc ? pc->sent : 0);
1230 1233
1231 c->log->handler = handler; 1234 c->log->handler = handler;
1232 1235