diff options
author | Ruslan Ermilov <ru@nginx.com> | 2017-05-26 22:52:48 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2017-05-26 22:52:48 +0300 |
commit | b66c18d2d50c53b063cd14a2c3e4c8ff8b1b22a5 (patch) | |
tree | c61e02ac50d38621b454b9972fe42f72fc87f18f /src/http/v2/ngx_http_v2.c | |
parent | 8644d9491ad3c0eb16bcda1d452aba326e1f4dae (diff) | |
download | nginx-b66c18d2d50c53b063cd14a2c3e4c8ff8b1b22a5.tar.gz nginx-b66c18d2d50c53b063cd14a2c3e4c8ff8b1b22a5.zip |
Introduced ngx_tcp_nodelay().
Diffstat (limited to 'src/http/v2/ngx_http_v2.c')
-rw-r--r-- | src/http/v2/ngx_http_v2.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 1a9e52147..ed78638cb 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -529,29 +529,8 @@ ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c) tcp_nodelay = 1; } - if (tcp_nodelay - && clcf->tcp_nodelay - && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) - { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay"); - - if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, - (const void *) &tcp_nodelay, sizeof(int)) - == -1) - { -#if (NGX_SOLARIS) - /* Solaris returns EINVAL if a socket has been shut down */ - c->log_error = NGX_ERROR_IGNORE_EINVAL; -#endif - - ngx_connection_error(c, ngx_socket_errno, - "setsockopt(TCP_NODELAY) failed"); - - c->log_error = NGX_ERROR_INFO; - goto error; - } - - c->tcp_nodelay = NGX_TCP_NODELAY_SET; + if (tcp_nodelay && clcf->tcp_nodelay && ngx_tcp_nodelay(c) != NGX_OK) { + goto error; } for ( /* void */ ; out; out = fn) { |