From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 18 Sep 2009 18:52:33 +0000 (+0000)
Subject: In serve(), make the latency loop-local and actually calculate it. Oops.
X-Git-Tag: v_3_0_15~54
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/developer-manual/static/gitweb.js?a=commitdiff_plain;h=4260c97e4c0b36b0d347294376b97afc56f64c37;p=privoxy.git

In serve(), make the latency loop-local and actually calculate it. Oops.

In other words: Revision 270. Once more, with feeling.
---

diff --git a/jcc.c b/jcc.c
index f6e1c9be..9795626d 100644
--- 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)