httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Fri, 09 Apr 2004 00:56:26 GMT
geoff       2004/04/08 17:56:26

  Modified:    .        CHANGES
               server   core.c
  Log:
  Enable special ErrorDocument value 'default' which restores the
  canned server response for the scope of the directive.
  
  Revision  Changes    Path
  1.1449    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1448
  retrieving revision 1.1449
  diff -u -r1.1448 -r1.1449
  --- CHANGES	5 Apr 2004 18:00:15 -0000	1.1448
  +++ CHANGES	9 Apr 2004 00:56:25 -0000	1.1449
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Enable special ErrorDocument value 'default' which restores the
  +     canned server response for the scope of the directive.
  +     [Geoffrey Young]
  +
     *) Allow Digest providers to return AUTH_DENIED to propagate a 401
        status and terminate the provider chain prior to checking the password.
        [Geoffrey Young]
  
  
  
  1.271     +16 -10    httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.270
  retrieving revision 1.271
  diff -u -r1.270 -r1.271
  --- core.c	25 Mar 2004 14:27:27 -0000	1.270
  +++ core.c	9 Apr 2004 00:56:26 -0000	1.271
  @@ -271,9 +271,7 @@
                  sizeof(*conf->response_code_strings) * RESPONSE_CODES);
   
           for (i = 0; i < RESPONSE_CODES; ++i) {
  -            if (new->response_code_strings[i] != NULL) {
  -                conf->response_code_strings[i] = new->response_code_strings[i];
  -            }
  +            conf->response_code_strings[i] = new->response_code_strings[i];
           }
       }
       /* Otherwise we simply use the base->response_code_strings array
  @@ -1178,13 +1176,21 @@
                               RESPONSE_CODES);
           }
   
  -        /* hack. Prefix a " if it is a msg; as that is what
  -         * http_protocol.c relies on to distinguish between
  -         * a msg and a (local) path.
  -         */
  -        conf->response_code_strings[index_number] = (what == MSG) ?
  -                apr_pstrcat(cmd->pool, "\"",msg,NULL) :
  -                apr_pstrdup(cmd->pool, msg);
  +        if (strcmp(msg, "default") == 0) {
  +            /* special case: ErrorDocument 404 default restores the
  +             * canned server error response
  +             */
  +            conf->response_code_strings[index_number] = NULL;
  +        }
  +        else {
  +            /* hack. Prefix a " if it is a msg; as that is what
  +             * http_protocol.c relies on to distinguish between
  +             * a msg and a (local) path.
  +             */
  +            conf->response_code_strings[index_number] = (what == MSG) ?
  +                    apr_pstrcat(cmd->pool, "\"",msg,NULL) :
  +                    apr_pstrdup(cmd->pool, msg);
  +        }
       }
   
       return NULL;
  
  
  

Mime
View raw message