Fix latency calculation for shared connections
authorFabian Keil <fk@fabiankeil.de>
Wed, 17 Oct 2012 18:11:19 +0000 (18:11 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 17 Oct 2012 18:11:19 +0000 (18:11 +0000)
It has been broken since I committed it with 1.57 in 2009.

The calculated latency for most connections would be 0 due to
remember_connection() always putting the timestamps in the
first slot. Oops.

gateway.c

index f36ed01..a1c6509 100644 (file)
--- a/gateway.c
+++ b/gateway.c
@@ -1,4 +1,4 @@
-const char gateway_rcs[] = "$Id: gateway.c,v 1.86 2012/03/09 17:55:50 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.87 2012/03/10 11:06:09 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/gateway.c,v $
@@ -229,8 +229,8 @@ void remember_connection(const struct reusable_connection *connection)
    reusable_connection[slot].port = connection->port;
    reusable_connection[slot].in_use = 0;
    reusable_connection[slot].timestamp = connection->timestamp;
-   reusable_connection->request_sent = connection->request_sent;
-   reusable_connection->response_received = connection->response_received;
+   reusable_connection[slot].request_sent = connection->request_sent;
+   reusable_connection[slot].response_received = connection->response_received;
    reusable_connection[slot].keep_alive_timeout = connection->keep_alive_timeout;
 
    assert(reusable_connection[slot].gateway_host == NULL);