comparison src/stream/ngx_stream_handler.c @ 6436:8f038068f4bc

Stream: UDP proxy.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 20 Jan 2016 19:52:12 +0300
parents d1f94042c29c
children a01e315b3a78
comparison
equal deleted inserted replaced
6435:d1c791479bbb 6436:8f038068f4bc
50 /* 50 /*
51 * There are several addresses on this port and one of them 51 * There are several addresses on this port and one of them
52 * is the "*:port" wildcard so getsockname() is needed to determine 52 * is the "*:port" wildcard so getsockname() is needed to determine
53 * the server address. 53 * the server address.
54 * 54 *
55 * AcceptEx() already gave this address. 55 * AcceptEx() and recvmsg() already gave this address.
56 */ 56 */
57 57
58 if (ngx_connection_local_sockaddr(c, NULL, 0) != NGX_OK) { 58 if (ngx_connection_local_sockaddr(c, NULL, 0) != NGX_OK) {
59 ngx_stream_close_connection(c); 59 ngx_stream_close_connection(c);
60 return; 60 return;
164 ngx_stream_close_connection(c); 164 ngx_stream_close_connection(c);
165 return; 165 return;
166 } 166 }
167 } 167 }
168 168
169 if (cscf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) { 169 if (c->type == SOCK_STREAM
170 && cscf->tcp_nodelay
171 && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
172 {
170 ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0, "tcp_nodelay"); 173 ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0, "tcp_nodelay");
171 174
172 tcp_nodelay = 1; 175 tcp_nodelay = 1;
173 176
174 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, 177 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,