From: Fabian Keil Date: Fri, 6 Nov 2015 13:35:24 +0000 (+0000) Subject: accept_connection(): Set NO_DELAY flag for the accepting socket X-Git-Tag: v_3_0_24~75 X-Git-Url: http://www.privoxy.org/gitweb/user-manual/quickstart.html?a=commitdiff_plain;h=861f2331b86d82c770f38b7a60f8328862fe6da3;p=privoxy.git accept_connection(): Set NO_DELAY flag for the accepting socket This significantly reduces the latency if the operating system is not configured to set the flag by default. For Windows the unnecessary delay has been reported to be ~200ms while on ElectroBSD it's still 100ms. Reported by Johan Sintorn in #894. --- diff --git a/jbsockets.c b/jbsockets.c index ff1d7a81..7bdb5046 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.131 2014/11/14 10:40:24 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.132 2015/11/06 13:34:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -1329,6 +1329,8 @@ int accept_connection(struct client_state * csp, jb_socket fds[]) mark_socket_for_close_on_execute(afd); #endif + set_no_delay_flag(afd); + csp->cfd = afd; #ifdef HAVE_RFC2553 csp->ip_addr_str = malloc_or_die(NI_MAXHOST);