coar 98/09/25 05:27:06
Modified: . STATUS src/main http_log.c http_protocol.c Log: Put back the default server status pages, with no inclusion of error-notes, except for HTTP_INTERNAL_SERVER_ERROR, LENGTH_REQUIRED, and HTTP_BAD_REQUEST. Also only store ap_log_rerror() text in error-notes if the severity is 'warning' or worse. PR: 3071 Reviewed by: Roy Fielding Revision Changes Path 1.493 +0 -10 apache-1.3/STATUS Index: STATUS =================================================================== RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.492 retrieving revision 1.493 diff -u -r1.492 -r1.493 --- STATUS 1998/09/24 22:01:08 1.492 +++ STATUS 1998/09/25 12:27:04 1.493 @@ -25,16 +25,6 @@ Available Patches: - * Ken's fix for error pages and error-notes (#2) - Take references to error-notes out of ap_send_error_response() - except for internal HTTP_BAD_REQUEST uses. Otherwise, - leave its use for page customisation to ErrorDocuments. - Only copy ap_log_rerror() text into error-notes if the - level is 'warning' or more severe AND there's not already - something stored there. - Message-ID: <[EMAIL PROTECTED]> - Status: Ken +1 - * Earle Ake: Apache 1.3.1 port to Pyramid DC/OSx <[EMAIL PROTECTED]> 1.70 +11 -2 apache-1.3/src/main/http_log.c Index: http_log.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_log.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- http_log.c 1998/09/22 15:43:42 1.69 +++ http_log.c 1998/09/25 12:27:05 1.70 @@ -440,9 +440,18 @@ va_start(args, fmt); log_error_core(file, line, level, r->server, r, fmt, args); - if (ap_table_get(r->notes, "error-notes") == NULL) { + /* + * IF the error level is 'warning' or more severe, + * AND there isn't already error text associated with this request, + * THEN make the message text available to ErrorDocument and + * other error processors. This can be disabled by stuffing + * something, even an empty string, into the "error-notes" cell + * before calling this routine. + */ + if (((level & APLOG_LEVELMASK) <= APLOG_WARNING) + && (ap_table_get(r->notes, "error-notes") == NULL)) { ap_table_setn(r->notes, "error-notes", - ap_pvsprintf(r->pool, fmt, args)); + ap_pvsprintf(r->pool, fmt, args)); } va_end(args); } 1.240 +141 -126 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.239 retrieving revision 1.240 diff -u -r1.239 -r1.240 --- http_protocol.c 1998/08/25 09:15:31 1.239 +++ http_protocol.c 1998/09/25 12:27:05 1.240 @@ -2127,132 +2127,147 @@ "</TITLE>\n</HEAD><BODY>\n<H1>", h1, "</H1>\n", NULL); - if ((error_notes = ap_table_get(r->notes, "error-notes"))) { - ap_bputs(error_notes, fd); - } - else - switch (status) { - case REDIRECT: - case MOVED: - ap_bvputs(fd, "The document has moved <A HREF=\"", - ap_escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); - break; - case HTTP_SEE_OTHER: - ap_bvputs(fd, "The answer to your request is located <A HREF=\"", - ap_escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); - break; - case HTTP_USE_PROXY: - ap_bvputs(fd, "This resource is only accessible through the proxy\n", - ap_escape_html(r->pool, location), "<BR>\nYou will need to ", - "configure your client to use that proxy.<P>\n", NULL); - break; - case HTTP_PROXY_AUTHENTICATION_REQUIRED: - case AUTH_REQUIRED: - ap_bputs("This server could not verify that you\n", fd); - ap_bputs("are authorized to access the document you\n", fd); - ap_bputs("requested. Either you supplied the wrong\n", fd); - ap_bputs("credentials (e.g., bad password), or your\n", fd); - ap_bputs("browser doesn't understand how to supply\n", fd); - ap_bputs("the credentials required.<P>\n", fd); - break; - case BAD_REQUEST: - ap_bputs("Your browser sent a request that\n", fd); - ap_bputs("this server could not understand.<P>\n", fd); - break; - case HTTP_FORBIDDEN: - ap_bvputs(fd, "You don't have permission to access ", - ap_escape_html(r->pool, r->uri), "\non this server.<P>\n", - NULL); - break; - case NOT_FOUND: - ap_bvputs(fd, "The requested URL ", ap_escape_html(r->pool, r->uri), - " was not found on this server.<P>\n", NULL); - break; - case METHOD_NOT_ALLOWED: - ap_bvputs(fd, "The requested method ", r->method, " is not allowed " - "for the URL ", ap_escape_html(r->pool, r->uri), - ".<P>\n", NULL); - break; - case NOT_ACCEPTABLE: - ap_bvputs(fd, - "An appropriate representation of the requested resource ", - ap_escape_html(r->pool, r->uri), - " could not be found on this server.<P>\n", NULL); - /* fall through */ - case MULTIPLE_CHOICES: - { - const char *list; - if ((list = ap_table_get(r->notes, "variant-list"))) - ap_bputs(list, fd); - } - break; - case LENGTH_REQUIRED: - ap_bvputs(fd, "A request of the requested method ", r->method, - " requires a valid Content-length.<P>\n", NULL); - break; - case PRECONDITION_FAILED: - ap_bvputs(fd, "The precondition on the request for the URL ", - ap_escape_html(r->pool, r->uri), " evaluated to false.<P>\n", - NULL); - break; - case NOT_IMPLEMENTED: - ap_bvputs(fd, ap_escape_html(r->pool, r->method), " to ", - ap_escape_html(r->pool, r->uri), " not supported.<P>\n", NULL); - break; - case BAD_GATEWAY: - ap_bputs("The proxy server received an invalid\015\012", fd); - ap_bputs("response from an upstream server.<P>\015\012", fd); - break; - case VARIANT_ALSO_VARIES: - ap_bvputs(fd, "A variant for the requested entity ", - ap_escape_html(r->pool, r->uri), " is itself a ", - "transparently negotiable resource.<P>\n", NULL); - break; - case HTTP_REQUEST_TIME_OUT: - ap_bputs("I'm tired of waiting for your request.\n", fd); - break; - case HTTP_GONE: - ap_bvputs(fd, "The requested resource<BR>", - ap_escape_html(r->pool, r->uri), - "<BR>\nis no longer available on this server ", - "and there is no forwarding address.\n", - "Please remove all references to this resource.\n", NULL); - break; - case HTTP_REQUEST_ENTITY_TOO_LARGE: - ap_bvputs(fd, "The requested resource<BR>", - ap_escape_html(r->pool, r->uri), "<BR>\n", - "does not allow request data with ", r->method, - " requests, or the amount of data provided in\n", - "the request exceeds the capacity limit.\n", NULL); - break; - case HTTP_REQUEST_URI_TOO_LARGE: - ap_bputs("The requested URL's length exceeds the capacity\n", fd); - ap_bputs("limit for this server.\n", fd); - break; - case HTTP_UNSUPPORTED_MEDIA_TYPE: - ap_bputs("The supplied request data is not in a format\n", fd); - ap_bputs("acceptable for processing by this resource.\n", fd); - break; - case HTTP_SERVICE_UNAVAILABLE: - ap_bputs("The server is temporarily unable to service your\n", fd); - ap_bputs("request due to maintenance downtime or capacity\n", fd); - ap_bputs("problems. Please try again later.\n", fd); - break; - case HTTP_GATEWAY_TIME_OUT: - ap_bputs("The proxy server did not receive a timely response\n", fd); - ap_bputs("from the upstream server.<P>\n", fd); - break; - default: /* HTTP_INTERNAL_SERVER_ERROR */ - ap_bputs("The server encountered an internal error or\n", fd); - ap_bputs("misconfiguration and was unable to complete\n", fd); - ap_bputs("your request.<P>\n", fd); - ap_bputs("Please contact the server administrator,\n ", fd); - ap_bputs(ap_escape_html(r->pool, r->server->server_admin), fd); - ap_bputs(" and inform them of the time the error occurred,\n", fd); - ap_bputs("and anything you might have done that may have\n", fd); - ap_bputs("caused the error.<P>\n", fd); - break; - } + switch (status) { + case REDIRECT: + case MOVED: + ap_bvputs(fd, "The document has moved <A HREF=\"", + ap_escape_html(r->pool, location), "\">here</A>.<P>\n", + NULL); + break; + case HTTP_SEE_OTHER: + ap_bvputs(fd, "The answer to your request is located <A HREF=\"", + ap_escape_html(r->pool, location), "\">here</A>.<P>\n", + NULL); + break; + case HTTP_USE_PROXY: + ap_bvputs(fd, "This resource is only accessible " + "through the proxy\n", + ap_escape_html(r->pool, location), + "<BR>\nYou will need to ", + "configure your client to use that proxy.<P>\n", NULL); + break; + case HTTP_PROXY_AUTHENTICATION_REQUIRED: + case AUTH_REQUIRED: + ap_bputs("This server could not verify that you\n", fd); + ap_bputs("are authorized to access the document you\n", fd); + ap_bputs("requested. Either you supplied the wrong\n", fd); + ap_bputs("credentials (e.g., bad password), or your\n", fd); + ap_bputs("browser doesn't understand how to supply\n", fd); + ap_bputs("the credentials required.<P>\n", fd); + break; + case BAD_REQUEST: + ap_bputs("Your browser sent a request that\n", fd); + ap_bputs("this server could not understand.<P>\n", fd); + if (error_notes = ap_table_get(r->notes, "error-notes") != NULL) { + ap_bvputs(fd, error_notes, "<P>\n", NULL); + } + break; + case HTTP_FORBIDDEN: + ap_bvputs(fd, "You don't have permission to access ", + ap_escape_html(r->pool, r->uri), + "\non this server.<P>\n", NULL); + break; + case NOT_FOUND: + ap_bvputs(fd, "The requested URL ", + ap_escape_html(r->pool, r->uri), + " was not found on this server.<P>\n", NULL); + break; + case METHOD_NOT_ALLOWED: + ap_bvputs(fd, "The requested method ", r->method, + " is not allowed " + "for the URL ", ap_escape_html(r->pool, r->uri), + ".<P>\n", NULL); + break; + case NOT_ACCEPTABLE: + ap_bvputs(fd, + "An appropriate representation of the " + "requested resource ", + ap_escape_html(r->pool, r->uri), + " could not be found on this server.<P>\n", NULL); + /* fall through */ + case MULTIPLE_CHOICES: + { + const char *list; + if ((list = ap_table_get(r->notes, "variant-list"))) + ap_bputs(list, fd); + } + break; + case LENGTH_REQUIRED: + ap_bvputs(fd, "A request of the requested method ", r->method, + " requires a valid Content-length.<P>\n", NULL); + if (error_notes = ap_table_get(r->notes, "error-notes") != NULL) { + ap_bvputs(fd, error_notes, "<P>\n", NULL); + } + break; + case PRECONDITION_FAILED: + ap_bvputs(fd, "The precondition on the request for the URL ", + ap_escape_html(r->pool, r->uri), + " evaluated to false.<P>\n", NULL); + break; + case NOT_IMPLEMENTED: + ap_bvputs(fd, ap_escape_html(r->pool, r->method), " to ", + ap_escape_html(r->pool, r->uri), + " not supported.<P>\n", NULL); + break; + case BAD_GATEWAY: + ap_bputs("The proxy server received an invalid\015\012", fd); + ap_bputs("response from an upstream server.<P>\015\012", fd); + break; + case VARIANT_ALSO_VARIES: + ap_bvputs(fd, "A variant for the requested entity ", + ap_escape_html(r->pool, r->uri), " is itself a ", + "transparently negotiable resource.<P>\n", NULL); + break; + case HTTP_REQUEST_TIME_OUT: + ap_bputs("I'm tired of waiting for your request.\n", fd); + break; + case HTTP_GONE: + ap_bvputs(fd, "The requested resource<BR>", + ap_escape_html(r->pool, r->uri), + "<BR>\nis no longer available on this server ", + "and there is no forwarding address.\n", + "Please remove all references to this resource.\n", + NULL); + break; + case HTTP_REQUEST_ENTITY_TOO_LARGE: + ap_bvputs(fd, "The requested resource<BR>", + ap_escape_html(r->pool, r->uri), "<BR>\n", + "does not allow request data with ", r->method, + " requests, or the amount of data provided in\n", + "the request exceeds the capacity limit.\n", NULL); + break; + case HTTP_REQUEST_URI_TOO_LARGE: + ap_bputs("The requested URL's length exceeds the capacity\n", fd); + ap_bputs("limit for this server.\n", fd); + break; + case HTTP_UNSUPPORTED_MEDIA_TYPE: + ap_bputs("The supplied request data is not in a format\n", fd); + ap_bputs("acceptable for processing by this resource.\n", fd); + break; + case HTTP_SERVICE_UNAVAILABLE: + ap_bputs("The server is temporarily unable to service your\n", fd); + ap_bputs("request due to maintenance downtime or capacity\n", fd); + ap_bputs("problems. Please try again later.\n", fd); + break; + case HTTP_GATEWAY_TIME_OUT: + ap_bputs("The proxy server did not receive a timely response\n", + fd); + ap_bputs("from the upstream server.<P>\n", fd); + break; + default: /* HTTP_INTERNAL_SERVER_ERROR */ + ap_bputs("The server encountered an internal error or\n", fd); + ap_bputs("misconfiguration and was unable to complete\n", fd); + ap_bputs("your request.<P>\n", fd); + ap_bputs("Please contact the server administrator,\n ", fd); + ap_bputs(ap_escape_html(r->pool, r->server->server_admin), fd); + ap_bputs(" and inform them of the time the error occurred,\n", fd); + ap_bputs("and anything you might have done that may have\n", fd); + ap_bputs("caused the error.<P>\n", fd); + if (error_notes = ap_table_get(r->notes, "error-notes") != NULL) { + ap_bvputs(fd, error_notes, "<P>\n", NULL); + } + break; + } if (recursive_error) { ap_bvputs(fd, "<P>Additionally, a ",