]> git.kaiwu.me - nginx.git/commitdiff
Event connect: don't penalize AF_INET6 connections.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 27 Mar 2013 15:16:45 +0000 (15:16 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 27 Mar 2013 15:16:45 +0000 (15:16 +0000)
Problems with setsockopt(TCP_NODELAY) and setsockopt(TCP_NOPUSH), as well
as sendfile() syscall on Solaris, are specific to UNIX-domain sockets.
Other address families, i.e. AF_INET and AF_INET6, are fine.

src/event/ngx_event_connect.c

index 978f39b42a522b83b6a9cf227e3e88f87de925d8..e6ae6564e6cee9b9f645efff8147594b6f59b2ad 100644 (file)
@@ -84,7 +84,7 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
 
     c->log_error = pc->log_error;
 
-    if (pc->sockaddr->sa_family != AF_INET) {
+    if (pc->sockaddr->sa_family == AF_UNIX) {
         c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
         c->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;