-/* $Id: errorpage.cc,v 1.11 1996/04/04 01:30:42 wessels Exp $ */
+/* $Id: errorpage.cc,v 1.12 1996/04/04 17:46:39 wessels Exp $ */
/* DEBUG: Section 4 cached_error: Error printing routines */
getMyHostname());
strcat(tmp_error_buf, tbuf);
entry->mem_obj->abort_code = type;
+ if (entry->mem_obj->http_code == 0)
+ entry->mem_obj->http_code = 400;
storeAbort(entry, tmp_error_buf);
}
-char *cached_error_url(url, method, type, address, msg)
+char *cached_error_url(url, method, type, address, code, msg)
char *url;
int method;
int type;
char *address;
+ int code;
char *msg;
{
int index;
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_ERROR_MSG_P1,
+ sprintf(tmp_error_buf, "HTTP/1.0 %d Cache Detected Error\r\nContent-type: text/html\r\n\r\n", code);
+ sprintf(tbuf, CACHED_ERROR_MSG_P1,
url,
url,
ErrorData[index].shrt);
-
+ strcat(tmp_error_buf, tbuf);
if (msg) {
sprintf(tbuf, CACHED_ERROR_MSG_P2, msg);
strcat(tmp_error_buf, tbuf);
</ADDRESS>\n\
\n"
-char *cached_error_request(request, type, address)
+char *cached_error_request(request, type, address, code)
char *request;
int type;
char *address;
+ int code;
{
int index;
fatal_dump("cached_error_url: type out of range.");
index = (int) (type - ERR_MIN);
- sprintf(tmp_error_buf, CACHED_REQUEST_ERROR_MSG,
+ sprintf(tmp_error_buf, "HTTP/1.0 %d Cache Detected Error\r\nContent-type: text/html\r\n\r\n", code);
+ sprintf(tbuf, CACHED_REQUEST_ERROR_MSG,
request,
SQUID_VERSION,
getMyHostname());
+ strcat(tmp_error_buf, tbuf);
if (!log_errors)
return tmp_error_buf;
return tmp_error_buf;