/*
- * $Id: HttpHeader.cc,v 1.34 1998/05/20 23:35:03 wessels Exp $
+ * $Id: HttpHeader.cc,v 1.35 1998/05/21 00:01:28 wessels Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
{"X-Cache", HDR_X_CACHE, ftStr},
{"X-Cache-Lookup", HDR_X_CACHE_LOOKUP, ftStr},
{"X-Forwarded-For", HDR_X_FORWARDED_FOR, ftStr},
+ {"X-Squid-Error", HDR_X_SQUID_ERROR, ftStr},
{"Other:", HDR_OTHER, ftStr} /* ':' will not allow matches */
};
static HttpHeaderFieldInfo *Headers = NULL;
HDR_MIME_VERSION, HDR_PUBLIC, HDR_RETRY_AFTER, HDR_SERVER, HDR_SET_COOKIE,
HDR_VARY,
HDR_WARNING, HDR_PROXY_CONNECTION, HDR_X_CACHE,
- HDR_X_CACHE_LOOKUP
+ HDR_X_CACHE_LOOKUP,
+ HDR_X_SQUID_ERROR
};
static HttpHeaderMask RequestHeadersMask; /* set run-time using RequestHeaders */
/*
- * $Id: errorpage.cc,v 1.131 1998/05/08 23:29:26 wessels Exp $
+ * $Id: errorpage.cc,v 1.132 1998/05/21 00:01:29 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
HttpReply *
errorBuildReply(ErrorState * err)
{
+ char err_hdr[CVT_BUF_SZ];
HttpReply *rep = httpReplyCreate();
MemBuf content = errorBuildContent(err);
/* no LMT for error pages; error pages expire immediately */
httpReplySetHeaders(rep, 1.0, err->http_status, NULL, "text/html", content.size, 0, squid_curtime);
+ /*
+ * include some information for downstream caches. Implicit
+ * replaceable content This isn't quite sufficient. xerrno is not
+ * necessarily meaningful to another system, so we really should
+ * expand it. Additionally, we should identify ourselves. Someone
+ * might want to know. Someone _will_ want to know OTOH, the first
+ * X-CACHE-MISS entry should tell us who.
+ */
+ snprintf(err_hdr, CVT_BUF_SZ, "%s %d",
+ err_type_str[err->page_id], err->xerrno);
+ httpHeaderPutStr(&rep->header, HDR_X_SQUID_ERROR, err_hdr);
httpBodySet(&rep->body, content.buf, content.size + 1, NULL);
memBufClean(&content);
return rep;