From b4e7f82d8b8e956bd5c62bc5bed1ebf830c79866 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Thu, 27 Aug 1998 12:28:54 +0000 Subject: [PATCH] renamed icp_ping_data to just ping_data (for HTCP) --- src/access_log.cc | 12 ++++++------ src/client_side.cc | 6 +++--- src/mem.cc | 4 ++-- src/neighbors.cc | 34 ++++++++++++++++------------------ src/protos.h | 4 ++-- src/structs.h | 16 +++++++++++----- src/typedefs.h | 4 ++-- 7 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/access_log.cc b/src/access_log.cc index d8a9f5eb4c..3f67e234d1 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -1,7 +1,7 @@ /* - * $Id: access_log.cc,v 1.41 1998/08/17 18:48:57 wessels Exp $ + * $Id: access_log.cc,v 1.42 1998/08/27 06:28:54 wessels Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -177,7 +177,7 @@ accessLogSquid(AccessLogEntry * al, MemBuf * mb) al->private.method_str, al->url, al->cache.ident, - al->hier.icp.timedout ? "TIMEOUT_" : "", + al->hier.ping.timedout ? "TIMEOUT_" : "", hier_strings[al->hier.code], al->hier.host, al->http.content_type); @@ -312,15 +312,15 @@ accessLogClose(void) void hierarchyNote(HierarchyLogEntry * hl, hier_code code, - icp_ping_data * icpdata, + ping_data * pingdata, const char *cache_peer) { assert(hl != NULL); hl->code = code; - if (icpdata) - hl->icp = *icpdata; + if (pingdata) + hl->ping = *pingdata; xstrncpy(hl->host, cache_peer, SQUIDHOSTNAMELEN); - hl->icp.stop = current_time; + hl->ping.stop = current_time; } void diff --git a/src/client_side.cc b/src/client_side.cc index 02e64f4dc1..874dc89c87 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.388 1998/08/25 04:11:35 wessels Exp $ + * $Id: client_side.cc,v 1.389 1998/08/27 06:28:55 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -498,7 +498,7 @@ void clientUpdateCounters(clientHttpRequest * http) { int svc_time = tvSubMsec(http->start, current_time); - icp_ping_data *i; + ping_data *i; HierarchyLogEntry *H; Counter.client_http.requests++; if (isTcpHit(http->log_type)) @@ -538,7 +538,7 @@ clientUpdateCounters(clientHttpRequest * http) break; case PEER_SA_ICP: Counter.icp.times_used++; - i = &H->icp; + i = &H->ping; if (0 != i->stop.tv_sec && 0 != i->start.tv_sec) statHistCount(&Counter.icp.query_svc_time, tvSubUsec(i->start, i->stop)); diff --git a/src/mem.cc b/src/mem.cc index 592a42c57b..91d4b4f4f2 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.32 1998/08/25 04:11:37 wessels Exp $ + * $Id: mem.cc,v 1.33 1998/08/27 06:28:56 wessels Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -244,7 +244,7 @@ memInit(void) memDataInit(MEM_HTTP_HDR_CONTENT_RANGE, "HttpHdrContRange", sizeof(HttpHdrContRange), 0); memDataInit(MEM_ICPUDPDATA, "icpUdpData", sizeof(icpUdpData), 0); memDataInit(MEM_ICP_COMMON_T, "icp_common_t", sizeof(icp_common_t), 0); - memDataInit(MEM_ICP_PING_DATA, "icp_ping_data", sizeof(icp_ping_data), 0); + memDataInit(MEM_ICP_PING_DATA, "ping_data", sizeof(ping_data), 0); memDataInit(MEM_INTLIST, "intlist", sizeof(intlist), 0); memDataInit(MEM_IOSTATS, "iostats", sizeof(iostats), 0); memDataInit(MEM_IPCACHE_PENDING, "ip_pending", sizeof(ip_pending), 0); diff --git a/src/neighbors.cc b/src/neighbors.cc index 3917964c17..7ecbf6e638 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.239 1998/08/26 21:42:05 wessels Exp $ + * $Id: neighbors.cc,v 1.240 1998/08/27 06:28:57 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -357,7 +357,7 @@ neighborsUdpPing(request_t * request, fatal("neighborsUdpPing: There is no ICP socket!"); assert(entry->swap_status == SWAPOUT_NONE); mem->start_ping = current_time; - mem->icp_reply_callback = callback; + mem->ping_reply_callback = callback; mem->ircb_data = callback_data; *timeout = 0.0; for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) { @@ -764,20 +764,20 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka /* if we reach here, source-ping reply is the first 'parent', * so fetch directly from the source */ debug(15, 6) ("Source is the first to respond.\n"); - mem->icp_reply_callback(NULL, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(NULL, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_MISS) { if (p == NULL) { neighborIgnoreNonPeer(from, opcode); } else { - mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_HIT) { if (p == NULL) { neighborIgnoreNonPeer(from, opcode); } else { header->opcode = ICP_HIT; - mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_DECHO) { if (p == NULL) { @@ -786,7 +786,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka debug_trap("neighborsUdpAck: Found non-ICP cache as SIBLING\n"); debug_trap("neighborsUdpAck: non-ICP neighbors must be a PARENT\n"); } else { - mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } } else if (opcode == ICP_SECHO) { if (p) { @@ -794,7 +794,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka neighborCountIgnored(p); #if ALLOW_SOURCE_PING } else if (Config.onoff.source_ping) { - mem->icp_reply_callback(NULL, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(NULL, ntype, PROTO_ICP, header, mem->ircb_data); #endif } else { debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr)); @@ -813,7 +813,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const struct socka } } } else if (opcode == ICP_MISS_NOFETCH) { - mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data); } else { debug(15, 0) ("neighborsUdpAck: Unexpected ICP reply: %s\n", opcode_d); } @@ -997,12 +997,12 @@ peerCountMcastPeersStart(void *data) psstate->callback = NULL; psstate->fail_callback = NULL; psstate->callback_data = p; - psstate->icp.start = current_time; + psstate->ping.start = current_time; cbdataAdd(psstate, MEM_NONE); mem = fake->mem_obj; mem->request = requestLink(psstate->request); mem->start_ping = current_time; - mem->icp_reply_callback = peerCountHandleIcpReply; + mem->ping_reply_callback = peerCountHandleIcpReply; mem->ircb_data = psstate; mcastSetTtl(theOutIcpConnection, p->mcast.ttl); p->mcast.reqnum = mem->reqnum; @@ -1029,12 +1029,12 @@ peerCountMcastPeersDone(void *data) StoreEntry *fake = psstate->entry; p->mcast.flags &= ~PEER_COUNTING; p->mcast.avg_n_members = doubleAverage(p->mcast.avg_n_members, - (double) psstate->icp.n_recv, + (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10); debug(15, 1) ("Group %s: %d replies, %4.1f average, RTT %d\n", p->host, - psstate->icp.n_recv, + psstate->ping.n_recv, p->mcast.avg_n_members, p->stats.rtt); p->mcast.n_replies_expected = (int) p->mcast.avg_n_members; @@ -1057,8 +1057,8 @@ peerCountHandleIcpReply(peer * p, peer_t type, protocol_t proto, void * hdrnotus assert(proto == PROTO_ICP); assert(fake); assert(mem); - psstate->icp.n_recv++; - p->stats.rtt = intAverage(p->stats.rtt, rtt, psstate->icp.n_recv, RTT_AV_FACTOR); + psstate->ping.n_recv++; + p->stats.rtt = intAverage(p->stats.rtt, rtt, psstate->ping.n_recv, RTT_AV_FACTOR); } static void @@ -1187,12 +1187,10 @@ dump_peers(StoreEntry * sentry, peer * peers) void neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct sockaddr_in *from) { - StoreEntry *e; + StoreEntry *e = storeGet(key); MemObject *mem = NULL; peer *p; peer_t ntype = PEER_NONE; - debug(15, 1) ("neighborsHtcpReply: write me\n"); - e = storeGet(key); debug(15, 6) ("neighborsHtcpReply: %s %s\n", htcp->hit ? "HIT" : "MISS", storeKeyText(key)); if (NULL != (e = storeGet(key))) @@ -1238,6 +1236,6 @@ neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct soc return; } debug(15, 1) ("neighborsHtcpReply: e = %p\n", e); - mem->icp_reply_callback(p, ntype, PROTO_HTCP, htcp, mem->ircb_data); + mem->ping_reply_callback(p, ntype, PROTO_HTCP, htcp, mem->ircb_data); } #endif diff --git a/src/protos.h b/src/protos.h index a3e4262b9a..134bd280de 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.257 1998/08/26 19:08:56 wessels Exp $ + * $Id: protos.h,v 1.258 1998/08/27 06:28:58 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -36,7 +36,7 @@ extern void accessLogRotate(void); extern void accessLogClose(void); extern void accessLogInit(void); extern const char *accessLogTime(time_t); -extern void hierarchyNote(HierarchyLogEntry *, hier_code, icp_ping_data *, const char *); +extern void hierarchyNote(HierarchyLogEntry *, hier_code, ping_data *, const char *); #if FORW_VIA_DB extern void fvdbCountVia(const char *key); extern void fvdbCountForw(const char *key); diff --git a/src/structs.h b/src/structs.h index e8d39955b1..d0f380aece 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.211 1998/08/26 19:08:57 wessels Exp $ + * $Id: structs.h,v 1.212 1998/08/27 06:28:58 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -708,7 +708,7 @@ struct _icpUdpData { struct timeval queue_time; }; -struct _icp_ping_data { +struct _ping_data { struct timeval start; struct timeval stop; int n_sent; @@ -723,7 +723,7 @@ struct _icp_ping_data { struct _HierarchyLogEntry { hier_code code; char host[SQUIDHOSTNAMELEN]; - icp_ping_data icp; + ping_data ping; char cd_host[SQUIDHOSTNAMELEN]; /* the host of selected by cd peer */ peer_select_alg_t alg; /* peer selection algorithm */ lookup_t cd_lookup; /* cd prediction: none, miss, hit */ @@ -1055,7 +1055,7 @@ struct _ps_state { struct sockaddr_in first_parent_miss; struct sockaddr_in closest_parent_miss; struct sockaddr_in single_parent; - icp_ping_data icp; + ping_data ping; aclCheck_t *acl_checklist; }; @@ -1148,7 +1148,7 @@ struct _MemObject { HttpReply *reply; request_t *request; struct timeval start_ping; - IRCB *icp_reply_callback; + IRCB *ping_reply_callback; void *ircb_data; int fd; /* FD of client creating this entry */ struct { @@ -1505,5 +1505,11 @@ struct _htcpReplyData { HttpHeader hdr; u_num32 msg_id; double version; + struct { + /* cache-to-origin */ + double rtt; + int samp; + int hops; + } cto; }; #endif diff --git a/src/typedefs.h b/src/typedefs.h index 2f15caa47f..f055992920 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.72 1998/08/26 05:36:47 wessels Exp $ + * $Id: typedefs.h,v 1.73 1998/08/27 06:28:59 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -115,7 +115,7 @@ typedef struct _peer peer; typedef struct _net_db_name net_db_name; typedef struct _net_db_peer net_db_peer; typedef struct _netdbEntry netdbEntry; -typedef struct _icp_ping_data icp_ping_data; +typedef struct _ping_data ping_data; typedef struct _ps_state ps_state; typedef struct _HierarchyLogEntry HierarchyLogEntry; typedef struct _pingerEchoData pingerEchoData; -- 2.47.3