-/* $Id: errorpage.cc,v 1.10 1996/04/02 21:50:22 wessels Exp $ */
+/* $Id: errorpage.cc,v 1.11 1996/04/04 01:30:42 wessels Exp $ */
/* DEBUG: Section 4 cached_error: Error printing routines */
{"ERR_CONNECT_FAIL",
"Connection Failed",
"The remote site or server may be down. Please try again soon."},
+ {"ERR_INVALID_REQUEST",
+ "Invalid HTTP request",
+ "Please double check it, or ask for assistance."},
{"ERR_INVALID_URL",
"Invalid URL syntax",
"Please double check it, or ask for assistance."},
-char *cached_error_url(url, type, msg)
+char *cached_error_url(url, method, type, address, msg)
char *url;
+ int method;
int type;
+ char *address;
char *msg;
{
int index;
getMyHostname());
if (!log_errors)
return tmp_error_buf;
- CacheInfo->log_append(CacheInfo,
- url,
- "0.0.0.0",
- 0,
- ErrorData[index].tag,
- "GET",
- 0,
- 0);
+ return tmp_error_buf;
+}
+
+
+#define CACHED_REQUEST_ERROR_MSG "\
+<TITLE>ERROR: Invalid HTTP Request</TITLE>\n\
+<H2>Invalid HTTP Request</H2>\n\
+<HR>\n\
+<PRE>\n\
+%s\n\
+</PRE>\n\
+<HR>\n\
+<ADDRESS>\n\
+Generated by cached/%s@%s\n\
+</ADDRESS>\n\
+\n"
+
+char *cached_error_request(request, type, address)
+ char *request;
+ int type;
+ char *address;
+{
+ int index;
+
+ tmp_error_buf[0] = '\0';
+ if (type == ERR_MIN || type > ERR_MAX)
+ fatal_dump("cached_error_url: type out of range.");
+ index = (int) (type - ERR_MIN);
+
+ sprintf(tmp_error_buf, CACHED_REQUEST_ERROR_MSG,
+ request,
+ SQUID_VERSION,
+ getMyHostname());
+ if (!log_errors)
+ return tmp_error_buf;
return tmp_error_buf;
}