/*
- * $Id: HttpHeader.cc,v 1.53 1998/08/25 19:10:43 wessels Exp $
+ * $Id: HttpHeader.cc,v 1.54 1998/08/26 05:36:42 wessels Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
httpHeaderStatInit(HttpHeaderStats + i, HttpHeaderStats[i].label);
HttpHeaderStats[hoRequest].owner_mask = &RequestHeadersMask;
HttpHeaderStats[hoReply].owner_mask = &ReplyHeadersMask;
+#if USE_HTCP
+ HttpHeaderStats[hoHtcpReply].owner_mask = &ReplyHeadersMask;
+#endif
/* init dependent modules */
httpHdrCcInitModule();
/* register with cache manager */
/*
- * $Id: enums.h,v 1.124 1998/08/25 19:19:05 wessels Exp $
+ * $Id: enums.h,v 1.125 1998/08/26 05:36:43 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
PROTO_WAIS,
PROTO_CACHEOBJ,
PROTO_ICP,
+#if USE_HTCP
+ PROTO_HTCP,
+#endif
PROTO_URN,
PROTO_WHOIS,
PROTO_INTERNAL,
/*
- * $Id: neighbors.cc,v 1.234 1998/08/21 03:15:19 wessels Exp $
+ * $Id: neighbors.cc,v 1.235 1998/08/26 05:36:44 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
/* 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, header, mem->ircb_data);
+ mem->icp_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, header, mem->ircb_data);
+ mem->icp_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, header, mem->ircb_data);
+ mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data);
}
} else if (opcode == ICP_DECHO) {
if (p == NULL) {
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, header, mem->ircb_data);
+ mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data);
}
} else if (opcode == ICP_SECHO) {
if (p) {
neighborCountIgnored(p, opcode);
#if ALLOW_SOURCE_PING
} else if (Config.onoff.source_ping) {
- mem->icp_reply_callback(NULL, ntype, header, mem->ircb_data);
+ mem->icp_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));
}
}
} else if (opcode == ICP_MISS_NOFETCH) {
- mem->icp_reply_callback(p, ntype, header, mem->ircb_data);
+ mem->icp_reply_callback(p, ntype, PROTO_ICP, header, mem->ircb_data);
} else {
debug(15, 0) ("neighborsUdpAck: Unexpected ICP reply: %s\n", opcode_d);
}
}
static void
-peerCountHandleIcpReply(peer * p, peer_t type, icp_common_t * hdrnotused, void *data)
+peerCountHandleIcpReply(peer * p, peer_t type, protocol_t proto, void * hdrnotused, void *data)
{
ps_state *psstate = data;
StoreEntry *fake = psstate->entry;
MemObject *mem = fake->mem_obj;
int rtt = tvSubMsec(mem->start_ping, current_time);
+ assert(proto == PROTO_ICP);
assert(fake);
assert(mem);
psstate->icp.n_recv++;
percent(e->stats.n_keepalives_recv, e->stats.n_keepalives_sent));
}
}
+
+#if USE_HTCP
+void
+neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const struct sockaddr_in *from)
+{
+}
+#endif
/*
- * $Id: peer_select.cc,v 1.77 1998/08/25 15:58:14 wessels Exp $
+ * $Id: peer_select.cc,v 1.78 1998/08/26 05:36:45 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
static void peerSelectFoo(ps_state *);
static void peerPingTimeout(void *data);
static void peerSelectCallbackFail(ps_state * psstate);
-static IRCB peerHandleIcpReply;
+static IRCB peerHandlePingReply;
static void peerSelectStateFree(ps_state * psstate);
static void peerIcpParentMiss(peer *, icp_common_t *, ps_state *);
static int peerCheckNetdbDirect(ps_state * psstate);
psstate->icp.start = current_time;
psstate->icp.n_sent = neighborsUdpPing(request,
entry,
- peerHandleIcpReply,
+ peerHandlePingReply,
psstate,
&psstate->icp.n_replies_expected,
&psstate->icp.timeout);
return;
peerSelectFoo(psstate);
}
+
+#if USE_HTCP
+static void
+peerHandleHtcpReply(peer * p, peer_t type, icp_common_t * header, void *data)
+{
+ ps_state *psstate = data;
+ debug(44,1)("peerHandleHtcpReply: write me\n");
+}
+#endif
+
+static void
+peerHandlePingReply(peer * p, peer_t type, protocol_t proto, void *ping_data, void *data)
+{
+ if (proto == PROTO_ICP)
+ peerHandleIcpReply(p, type, ping_data, data);
+#if USE_HTCP
+ else if (proto == PROTO_HTCP)
+ peerHandleHtcpReply(p, type, ping_data, data);
+#endif
+ else
+ debug(44, 1) ("peerHandlePingReply: unknown protocol_t %d\n", (int) proto);
+}
/*
- * $Id: protos.h,v 1.255 1998/08/25 19:10:10 wessels Exp $
+ * $Id: protos.h,v 1.256 1998/08/26 05:36:45 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void dump_peer_options(StoreEntry *, peer *);
extern int peerHTTPOkay(const peer *, request_t *);
extern peer *whichPeer(const struct sockaddr_in *from);
+#if USE_HTCP
+extern void neighborsHtcpReply(const cache_key *, htcpReplyData *, const struct sockaddr_in *);
+#endif
extern void netdbInit(void);
extern void netdbHandlePingReply(const struct sockaddr_in *from, int hops, int rtt);
/*
- * $Id: structs.h,v 1.209 1998/08/21 04:03:49 wessels Exp $
+ * $Id: structs.h,v 1.210 1998/08/26 05:36:46 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
peer *peer;
struct _FwdServer *next;
};
+
+#if USE_HTCP
+struct _htcpReplyData {
+ int hit;
+ HttpHeader hdr;
+ u_num32 msg_id;
+};
+#endif
/*
- * $Id: typedefs.h,v 1.71 1998/08/21 03:15:27 wessels Exp $
+ * $Id: typedefs.h,v 1.72 1998/08/26 05:36:47 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
typedef void FQDNH(const char *, void *);
typedef void IDCB(void *);
typedef void IPH(const ipcache_addrs *, void *);
-typedef void IRCB(peer *, peer_t, icp_common_t *, void *data);
+typedef void IRCB(peer *, peer_t, protocol_t, void *, void *data);
typedef void PSC(peer *, void *);
typedef void RH(void *data, char *);
typedef void UH(void *data, wordlist *);
#if DELAY_POOLS
typedef int delay_id;
#endif
+
+#if USE_HTCP
+typedef struct _htcpReplyData htcpReplyData;
+#endif