]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/errorpage.cc
major code cleanup/unification/rewrite
[thirdparty/squid.git] / src / errorpage.cc
index 810f68b6e4d0286c2d06a24e67fa281326f7e26c..ba99282576aae4f627bc4ab06d544f852b5a8da5 100644 (file)
@@ -1,4 +1,4 @@
-/* $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 */
 
@@ -62,6 +62,9 @@ error_data ErrorData[] =
     {"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."},
@@ -131,9 +134,11 @@ void cached_error_entry(entry, type, msg)
 
 
 
-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;
@@ -157,13 +162,40 @@ char *cached_error_url(url, type, msg)
        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;
 }