From 7bdd47d030d4cc27e319edf6030e161f25e1a299 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Mon, 14 Jul 2008 15:47:00 +0530 Subject: Make the embedded error message display valid XHTML too Also fix the information that is displayed. --- src/html-error.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/html-error.c b/src/html-error.c index 860e424..c6b580e 100644 --- a/src/html-error.c +++ b/src/html-error.c @@ -193,24 +193,31 @@ send_http_error_message(struct conn_s *connptr) FILE *infile; int ret; char *fallback_error = - "%s" - "
%s %s
" - "The page you requested was unavailable. The error code is listed " - "below. In addition, the HTML file which has been configured as the " - "page to be displayed when an error of this type was unavailable, " - "with the error code %d (%s). Please contact your administrator." - "
%s
" "" "\r\n"; + "\n" + "\n" + "\n" + "%d %s\n" + "\n" + "

%s

\n" + "

%s

\n" + "
\n" + "

Generated by %s version %s.

\n" + "\n" + "\n"; send_http_headers(connptr, connptr->error_number, connptr->error_string); error_file = get_html_file(connptr->error_number); - if (!(infile = fopen(error_file, "r"))) + if (!(infile = fopen(error_file, "r"))) { + char *detail = lookup_variable(connptr, "detail"); return (write_message(connptr->client_fd, fallback_error, + connptr->error_number, connptr->error_string, - PACKAGE, VERSION, - errno, strerror(errno), - connptr->error_string)); + connptr->error_string, + detail, + PACKAGE, VERSION)); + } ret = send_html_file(infile, connptr); fclose(infile); -- cgit v1.2.3