In serve(), make the latency loop-local and actually calculate it. Oops.
authorFabian Keil <fk@fabiankeil.de>
Fri, 18 Sep 2009 18:52:33 +0000 (18:52 +0000)
committerFabian Keil <fk@fabiankeil.de>
Fri, 18 Sep 2009 18:52:33 +0000 (18:52 +0000)
In other words: Revision 270. Once more, with feeling.

jcc.c

diff --git a/jcc.c b/jcc.c
index f6e1c9b..9795626 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.291 2009/09/12 12:35:14 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.292 2009/09/12 12:37:37 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -2479,12 +2479,16 @@ static void serve(struct client_state *csp)
    static int monitor_thread_running = 0;
 #endif /* def FEATURE_CONNECTION_SHARING */
    int continue_chatting = 0;
-   unsigned int latency = 0;
 
    do
    {
+      unsigned int latency;
+
       chat(csp);
 
+      latency = (unsigned)(csp->server_connection.response_received -
+         csp->server_connection.request_sent);
+
       continue_chatting = (csp->config->feature_flags
          & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)
          && (csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)