You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Roy Fielding <fi...@hyperreal.com> on 1997/01/24 02:49:18 UTC
cvs commit: apache/src http_core.c
fielding 97/01/23 17:49:17
Modified: src http_core.c
Log:
The code for ErrorDocument did not take into account the pre-1.2
changes to how index_of_response handles errors. This patch fixes
that as well as removing the reported problem of stripping a trailing
double-quote character.
Reviewed by: Dean Gaudet, Chuck Murcko
Revision Changes Path
1.59 +8 -9 apache/src/http_core.c
Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_core.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C3 -r1.58 -r1.59
*** http_core.c 1997/01/20 04:28:08 1.58
--- http_core.c 1997/01/24 01:49:15 1.59
***************
*** 416,422 ****
const char *set_error_document (cmd_parms *cmd, core_dir_config *conf,
char *line)
{
! int error_number, index_number;
char *w;
/* 1st parameter should be a 3 digit number, which we recognize;
--- 416,422 ----
const char *set_error_document (cmd_parms *cmd, core_dir_config *conf,
char *line)
{
! int error_number, index_number, idx500;
char *w;
/* 1st parameter should be a 3 digit number, which we recognize;
***************
*** 425,439 ****
w = getword_conf_nc (cmd->pool, &line);
error_number = atoi(w);
! index_number = index_of_response(error_number);
!
! if (index_number < 0)
! return pstrcat (cmd->pool, "Illegal HTTP response code ", w, NULL);
- /* Nuke trailing '"', if present */
-
- if (line[strlen(line) - 1] == '"') line[strlen(line) - 1] = '\0';
-
/* Store it... */
conf->response_code_strings[index_number] = pstrdup (cmd->pool, line);
--- 425,438 ----
w = getword_conf_nc (cmd->pool, &line);
error_number = atoi(w);
!
! idx500 = index_of_response(HTTP_INTERNAL_SERVER_ERROR);
!
! if (error_number == HTTP_INTERNAL_SERVER_ERROR)
! index_number = idx500;
! else if ((index_number = index_of_response(error_number)) == idx500)
! return pstrcat(cmd->pool, "Unsupported HTTP response code ", w, NULL);
/* Store it... */
conf->response_code_strings[index_number] = pstrdup (cmd->pool, line);