--------------------- PatchSet 5017 Date: 2002/09/17 13:20:52 Author: rbcollins Branch: fixrange Tag: (none) Log: extract method for ping state detection Members: src/client_side.c:1.72.2.9->1.72.2.10 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.72.2.9 retrieving revision 1.72.2.10 diff -u -r1.72.2.9 -r1.72.2.10 --- squid/src/client_side.c 17 Sep 2002 13:15:54 -0000 1.72.2.9 +++ squid/src/client_side.c 17 Sep 2002 13:20:52 -0000 1.72.2.10 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.72.2.9 2002/09/17 13:15:54 rbcollins Exp $ + * $Id: client_side.c,v 1.72.2.10 2002/09/17 13:20:52 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -134,6 +134,8 @@ static void clientUpdateStatHistCounters(log_type logType, int svc_time); static void clientUpdateStatCounters(log_type logType); static void clientUpdateHierCounters (HierarchyLogEntry *); +static int clientPingHasFinished(ping_data const *aPing); + clientStreamNode * getTail (clientSocketContext *context) @@ -240,6 +242,14 @@ } } +int +clientPingHasFinished(ping_data const *aPing) +{ + if (0 != aPing->stop.tv_sec && 0 != aPing->start.tv_sec) + return -1; + return 0; +} + void clientUpdateHierCounters (HierarchyLogEntry *someEntry) { @@ -251,7 +261,7 @@ case PEER_SA_ICP: statCounter.icp.times_used++; i = &someEntry->ping; - if (0 != i->stop.tv_sec && 0 != i->start.tv_sec) + if (clientPingHasFinished (i)) statHistCount(&statCounter.icp.query_svc_time, tvSubUsec(i->start, i->stop)); if (i->timeout)