aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_core_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/ngx_stream_core_module.c')
-rw-r--r--src/stream/ngx_stream_core_module.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/stream/ngx_stream_core_module.c b/src/stream/ngx_stream_core_module.c
index db8c2a304..272708d62 100644
--- a/src/stream/ngx_stream_core_module.c
+++ b/src/stream/ngx_stream_core_module.c
@@ -309,7 +309,6 @@ ngx_int_t
ngx_stream_core_content_phase(ngx_stream_session_t *s,
ngx_stream_phase_handler_t *ph)
{
- int tcp_nodelay;
ngx_connection_t *c;
ngx_stream_core_srv_conf_t *cscf;
@@ -321,22 +320,10 @@ ngx_stream_core_content_phase(ngx_stream_session_t *s,
if (c->type == SOCK_STREAM
&& cscf->tcp_nodelay
- && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
+ && ngx_tcp_nodelay(c) != NGX_OK)
{
- ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0, "tcp_nodelay");
-
- tcp_nodelay = 1;
-
- if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int)) == -1)
- {
- ngx_connection_error(c, ngx_socket_errno,
- "setsockopt(TCP_NODELAY) failed");
- ngx_stream_finalize_session(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- c->tcp_nodelay = NGX_TCP_NODELAY_SET;
+ ngx_stream_finalize_session(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
+ return NGX_OK;
}
cscf->handler(s);