From: Fabian Keil Date: Fri, 6 Nov 2015 13:37:35 +0000 (+0000) Subject: accept_connection(): Enable socket lingering for the correct socket X-Git-Tag: v_3_0_24~74 X-Git-Url: http://www.privoxy.org/gitweb/?a=commitdiff_plain;h=915f23de10c8d1d24e70c79adeb1793ea98bf057;p=privoxy.git accept_connection(): Enable socket lingering for the correct socket Previously we repeatedly enabled it for the listen socket instead of for the accepted socket. The bug was found by code inspection and did not cause any (reported) issues. --- diff --git a/jbsockets.c b/jbsockets.c index 7bdb5046..4fb86123 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.132 2015/11/06 13:34:56 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.133 2015/11/06 13:35:24 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -1307,7 +1307,7 @@ int accept_connection(struct client_state * csp, jb_socket fds[]) struct linger linger_options; linger_options.l_onoff = 1; linger_options.l_linger = 5; - if (0 != setsockopt(fd, SOL_SOCKET, SO_LINGER, &linger_options, sizeof(linger_options))) + if (0 != setsockopt(afd, SOL_SOCKET, SO_LINGER, &linger_options, sizeof(linger_options))) { log_error(LOG_LEVEL_ERROR, "Setting SO_LINGER on socket %d failed.", afd); }