Relocate the connection-accepted message from listen_loop() to serve()
authorFabian Keil <fk@fabiankeil.de>
Tue, 4 Sep 2012 08:39:58 +0000 (08:39 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 4 Sep 2012 08:39:58 +0000 (08:39 +0000)
This way it's printed by the thread that is actually serving the
connection which is nice when grepping for thread ids in log files.

While at it, use an upper-case first character which is more
consistent with the other log messages.

jcc.c

diff --git a/jcc.c b/jcc.c
index c1ed36a..32e6f0d 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.386 2012/07/27 17:41:42 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.387 2012/09/04 08:37:51 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -2507,6 +2507,9 @@ static void serve(struct client_state *csp)
 #endif /* def FEATURE_CONNECTION_SHARING */
    int continue_chatting = 0;
 
+   log_error(LOG_LEVEL_CONNECT, "Accepted connection from %s on socket %d",
+      csp->ip_addr_str, csp->cfd);
+
    do
    {
       unsigned int latency;
@@ -3554,12 +3557,6 @@ static void listen_loop(void)
          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;