/*
- * $Id: errorpage.cc,v 1.132 1998/05/21 00:01:29 wessels Exp $
+ * $Id: errorpage.cc,v 1.133 1998/05/26 23:56:20 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
p = r ? ProtocolStr[r->protocol] : "[unkown protocol]";
break;
case 'R':
- p = err->request_hdrs ? err->request_hdrs : "[no request]";
+ if (NULL != r) {
+ MemBuf mb;
+ Packer p;
+ memBufDefInit(&mb);
+ memBufPrintf(&mb, "%s %s HTTP/%3.1f\n",
+ RequestMethodStr[r->method],
+ strLen(r->urlpath) ? strBuf(r->urlpath) : "/",
+ (double) r->http_ver);
+ packerToMemInit(&p, &mb);
+ httpHeaderPackInto(&r->header, &p);
+ packerClean(&p);
+ xstrncpy(buf, mb.buf, CVT_BUF_SZ);
+ memBufClean(&mb);
+ } else if (err->request_hdrs) {
+ p = err->request_hdrs;
+ } else {
+ p = "[no request]";
+ }
break;
case 's':
p = full_appname_string;
void
internalStart(request_t * request, StoreEntry * entry)
{
+ ErrorState *err;
const char *upath = strBuf(request->urlpath);
debug(0, 1) ("internalStart: %s requesting '%s'\n",
inet_ntoa(request->client_addr), upath);
if (0 == strcmp(upath, "/squid-internal-dynamic/netdb"))
netdbBinaryExchange(entry);
- else
+ else {
debug(0, 0) ("internalStart: unknown request '%s'\n", upath);
+ err = errorCon(ERR_INVALID_REQ, HTTP_NOT_FOUND);
+ err->request = requestLink(request);
+ errorAppendEntry(entry, err);
+ }
}
int