comparison src/http/v2/ngx_http_v2.c @ 7007:ed1101bbf19f

Introduced ngx_tcp_nodelay().
author Ruslan Ermilov <ru@nginx.com>
date Fri, 26 May 2017 22:52:48 +0300
parents 2c4dbcd6f2e4
children ab6ef3037840
comparison
equal deleted inserted replaced
7006:9552758a786e 7007:ed1101bbf19f
527 527
528 } else { 528 } else {
529 tcp_nodelay = 1; 529 tcp_nodelay = 1;
530 } 530 }
531 531
532 if (tcp_nodelay 532 if (tcp_nodelay && clcf->tcp_nodelay && ngx_tcp_nodelay(c) != NGX_OK) {
533 && clcf->tcp_nodelay 533 goto error;
534 && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
535 {
536 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
537
538 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
539 (const void *) &tcp_nodelay, sizeof(int))
540 == -1)
541 {
542 #if (NGX_SOLARIS)
543 /* Solaris returns EINVAL if a socket has been shut down */
544 c->log_error = NGX_ERROR_IGNORE_EINVAL;
545 #endif
546
547 ngx_connection_error(c, ngx_socket_errno,
548 "setsockopt(TCP_NODELAY) failed");
549
550 c->log_error = NGX_ERROR_INFO;
551 goto error;
552 }
553
554 c->tcp_nodelay = NGX_TCP_NODELAY_SET;
555 } 534 }
556 535
557 for ( /* void */ ; out; out = fn) { 536 for ( /* void */ ; out; out = fn) {
558 fn = out->next; 537 fn = out->next;
559 538