Mercurial > hg > nginx
comparison src/stream/ngx_stream_proxy_module.c @ 6676:df3a7c029dec
Stream: $upstream_bytes_sent and $upstream_bytes_received.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Fri, 02 Sep 2016 18:27:08 +0300 |
parents | ab9b4fd8c5b7 |
children | c02290241cbe |
comparison
equal
deleted
inserted
replaced
6675:ab9b4fd8c5b7 | 6676:df3a7c029dec |
---|---|
1628 | 1628 |
1629 (void) ngx_ssl_shutdown(pc); | 1629 (void) ngx_ssl_shutdown(pc); |
1630 } | 1630 } |
1631 #endif | 1631 #endif |
1632 | 1632 |
1633 u->state->bytes_received = u->received; | |
1634 u->state->bytes_sent = pc->sent; | |
1635 | |
1633 ngx_close_connection(pc); | 1636 ngx_close_connection(pc); |
1634 u->peer.connection = NULL; | 1637 u->peer.connection = NULL; |
1635 } | 1638 } |
1636 | 1639 |
1637 ngx_stream_proxy_connect(s); | 1640 ngx_stream_proxy_connect(s); |
1656 if (u->resolved && u->resolved->ctx) { | 1659 if (u->resolved && u->resolved->ctx) { |
1657 ngx_resolve_name_done(u->resolved->ctx); | 1660 ngx_resolve_name_done(u->resolved->ctx); |
1658 u->resolved->ctx = NULL; | 1661 u->resolved->ctx = NULL; |
1659 } | 1662 } |
1660 | 1663 |
1664 pc = u->peer.connection; | |
1665 | |
1666 if (u->state) { | |
1667 if (pc) { | |
1668 u->state->bytes_received = u->received; | |
1669 u->state->bytes_sent = pc->sent; | |
1670 } | |
1671 } | |
1672 | |
1661 if (u->peer.free && u->peer.sockaddr) { | 1673 if (u->peer.free && u->peer.sockaddr) { |
1662 u->peer.free(&u->peer, u->peer.data, 0); | 1674 u->peer.free(&u->peer, u->peer.data, 0); |
1663 u->peer.sockaddr = NULL; | 1675 u->peer.sockaddr = NULL; |
1664 } | 1676 } |
1665 | |
1666 pc = u->peer.connection; | |
1667 | 1677 |
1668 if (pc) { | 1678 if (pc) { |
1669 ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, | 1679 ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, |
1670 "close stream proxy upstream connection: %d", pc->fd); | 1680 "close stream proxy upstream connection: %d", pc->fd); |
1671 | 1681 |