In listen_loop(), reload the configuration files after accepting a new connection...
authorFabian Keil <fk@fabiankeil.de>
Sun, 2 Jan 2011 12:17:03 +0000 (12:17 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 2 Jan 2011 12:17:03 +0000 (12:17 +0000)
Previously the first connection that arrived after a configuration
change would still be handled with the old configuration.

jcc.c

diff --git a/jcc.c b/jcc.c
index 74fde67..77f2112 100644 (file)
--- 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 */