From: Fabian Keil Date: Sun, 2 Jan 2011 12:17:03 +0000 (+0000) Subject: In listen_loop(), reload the configuration files after accepting a new connection... X-Git-Tag: v_3_0_18~363 X-Git-Url: http://www.privoxy.org/gitweb/user-manual/copyright.html?a=commitdiff_plain;h=21224fdce0fcd18f86c5c7c6437c8714e54d5ea9;p=privoxy.git In listen_loop(), reload the configuration files after accepting a new connection instead of before. Previously the first connection that arrived after a configuration change would still be handled with the old configuration. --- diff --git a/jcc.c b/jcc.c index 74fde673..77f2112c 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.336 2010/12/31 14:57:00 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.337 2011/01/02 11:57:45 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -3445,6 +3445,28 @@ static void listen_loop(void) } csp = &csp_list->csp; + log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); + + if (!accept_connection(csp, bfd)) + { + log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); + +#ifdef AMIGA + if(!childs) + { + exit(1); + } +#endif + freez(csp_list); + continue; + } + else + { + log_error(LOG_LEVEL_CONNECT, + "accepted connection from %s on socket %d", + csp->ip_addr_str, csp->cfd); + } + csp->flags |= CSP_FLAG_ACTIVE; csp->server_connection.sfd = JB_INVALID_SOCKET; @@ -3470,28 +3492,6 @@ static void listen_loop(void) bfd = bind_port_helper(config); } - log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); - - if (!accept_connection(csp, bfd)) - { - log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); - -#ifdef AMIGA - if(!childs) - { - exit(1); - } -#endif - freez(csp_list); - continue; - } - else - { - log_error(LOG_LEVEL_CONNECT, - "accepted connection from %s on socket %d", - csp->ip_addr_str, csp->cfd); - } - #ifdef FEATURE_TOGGLE if (global_toggle_state) #endif /* def FEATURE_TOGGLE */