/*
- * $Id: client_side_reply.cc,v 1.10 2002/09/29 09:52:36 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.11 2002/09/29 11:29:41 robertc Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
request_t * request);
static STCB clientHandleIMSReply;
static int modifiedSince(StoreEntry *, request_t *);
-static log_type clientIdentifyStoreObject(clientHttpRequest * http);
+static log_type clientIdentifyStoreObject(clientReplyContext *);
static void clientPurgeRequest(clientReplyContext *);
static void clientTraceReply(clientStreamNode *, clientReplyContext *);
static StoreEntry *clientCreateStoreEntry(clientReplyContext *, method_t,
* adds Squid specific entries
*/
static void
-clientBuildReplyHeader(clientHttpRequest * http, HttpReply * rep)
+clientBuildReplyHeader(clientReplyContext *context, HttpReply * rep)
{
+ clientHttpRequest * http = context->http;
HttpHeader *hdr = &rep->header;
int is_hit = logTypeIsATcpHit(http->logType);
request_t *request = http->request;
#if USE_CACHE_DIGESTS
/* Append X-Cache-Lookup: -- temporary hack, to be removed @?@ @?@ */
httpHeaderPutStrf(hdr, HDR_X_CACHE_LOOKUP, "%s from %s:%d",
- http->lookup_type ? http->lookup_type : "NONE",
+ context->lookup_type ? context->lookup_type : "NONE",
getMyHostname(), getMyPort());
#endif
if (httpReplyBodySize(request->method, rep) < 0) {
static HttpReply *
-clientBuildReply(clientHttpRequest * http, const char *buf, size_t size)
+clientBuildReply(clientReplyContext *context, const char *buf, size_t size)
{
HttpReply *rep = httpReplyCreate();
size_t k = headersEnd(buf, size);
/* enforce 1.0 reply version */
httpBuildVersion(&rep->sline.version, 1, 0);
/* do header conversions */
- clientBuildReplyHeader(http, rep);
+ clientBuildReplyHeader(context, rep);
} else {
/* parsing failure, get rid of the invalid reply */
httpReplyDestroy(rep);
}
static log_type
-clientIdentifyStoreObject(clientHttpRequest * http)
+clientIdentifyStoreObject(clientReplyContext *context)
{
+ clientHttpRequest * http = context->http;
request_t *r = http->request;
StoreEntry *e;
if (r->flags.cachable || r->flags.internal)
ipcacheInvalidate(r->host);
#endif
#if USE_CACHE_DIGESTS
- http->lookup_type = e ? "HIT" : "MISS";
+ context->lookup_type = e ? "HIT" : "MISS";
#endif
if (NULL == e) {
/* this object isn't in the cache */
/* continue forwarding, not finished yet. */
http->logType = LOG_TCP_MISS;
} else
- http->logType = clientIdentifyStoreObject(http);
+ http->logType = clientIdentifyStoreObject(context);
/* We still have to do store logic processing - vary, cache hit etc */
if (context->http->entry != NULL) {
/* someone found the object in the cache for us */
xstrncpy(http->al.headers.reply, buf, k);
}
}
- rep = clientBuildReply(http, buf, size);
+ rep = clientBuildReply(context, buf, size);
if (rep) {
aclCheck_t *ch;
int rv;