httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Thu, 13 Dec 2001 19:13:24 GMT
wrowe       01/12/13 11:13:24

  Modified:    include  httpd.h
               server   core.c
  Log:
    As suggested by Josh Slive, add the explicit 'default' to AcceptPathInfo.
    I'll leave docs up to him.  The conf becomes a quadstate (undef != default)
    but other than that, it should make things cleaner for the user.
  
  Revision  Changes    Path
  1.173     +22 -4     httpd-2.0/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/httpd.h,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- httpd.h	2001/12/13 02:40:34	1.172
  +++ httpd.h	2001/12/13 19:13:23	1.173
  @@ -593,7 +593,7 @@
   #endif /* APR_CHARSET_EBCDIC */                                   
   
   /**
  - * @defgroup values_requet_rec_body Possible values for request_rec.read_body 
  + * @defgroup values_request_rec_body Possible values for request_rec.read_body 
    * @{
    * Possible values for request_rec.read_body (set by handling module):
    */
  @@ -606,6 +606,20 @@
   #define REQUEST_CHUNKED_DECHUNK  2
   /** @} */
   
  +/**
  + * @defgroup values_request_rec_used_path_info Possible values for request_rec.used_path_info

  + * @{
  + * Possible values for request_rec.used_path_info:
  + */
  +
  +/** Accept request given path_info */
  +#define AP_REQ_ACCEPT_PATH_INFO     0
  +/** Send 404 error if path_info was given */
  +#define AP_REQ_REJECT_PATH_INFO    1
  +/** Module's choice for handling path_info */
  +#define AP_REQ_DEFAULT_PATH_INFO   2
  +/** @} */
  +
   /*
    * Things which may vary per file-lookup WITHIN a request ---
    * e.g., state of MIME config.  Basically, the name of an object, info
  @@ -854,9 +868,13 @@
       /** components of uri, dismantled */
       apr_uri_t parsed_uri;
   
  -    /** Flag for the core handler to permit path_info on the current
  -        filename, to be consumed by some filter.  Unless this is
  -        toggled, path_info requests are rejected by the core */
  +    /** Flag for the handler to accept or reject path_info on 
  +     *  the current request.  All modules should respect the
  +     *  AP_REQ_ACCEPT_PATH_INFO and AP_REQ_REJECT_PATH_INFO 
  +     *  values, while AP_REQ_DEFAULT_PATH_INFO indicates they
  +     *  may follow existing conventions.  This is set to the
  +     *  user's preference upon HOOK_VERY_FIRST of the fixups.
  +     */
       int used_path_info;
   
       /* Various other config info which may change with .htaccess files
  
  
  
  1.119     +22 -8     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- core.c	2001/12/13 16:11:41	1.118
  +++ core.c	2001/12/13 19:13:23	1.119
  @@ -131,7 +131,7 @@
       conf->override = dir ? OR_UNSET : OR_UNSET|OR_ALL;
   
       conf->content_md5 = 2;
  -    conf->accept_path_info = 2;
  +    conf->accept_path_info = AP_REQ_DEFAULT_PATH_INFO;
   
       conf->use_canonical_name = USE_CANONICAL_NAME_UNSET;
   
  @@ -255,7 +255,7 @@
       if ((new->content_md5 & 2) == 0) {
           conf->content_md5 = new->content_md5;
       }
  -    if ((new->accept_path_info & 2) == 0) {
  +    if (new->accept_path_info != 3) {
           conf->accept_path_info = new->accept_path_info;
       }
       if (new->use_canonical_name != USE_CANONICAL_NAME_UNSET) {
  @@ -1774,11 +1774,23 @@
       return NULL;
   }
   
  -static const char *set_accept_path_info(cmd_parms *cmd, void *d_, int arg)
  +static const char *set_accept_path_info(cmd_parms *cmd, void *d_, const char *arg)
   {
       core_dir_config *d=d_;
  -    
  -    d->accept_path_info = arg != 0;
  +
  +    if (strcasecmp(arg, "on") == 0) {
  +        d->accept_path_info = AP_REQ_ACCEPT_PATH_INFO;
  +    }
  +    else if (strcasecmp(arg, "off") == 0) {
  +        d->accept_path_info = AP_REQ_REJECT_PATH_INFO;
  +    }
  +    else if (strcasecmp(arg, "default") == 0) {
  +        d->accept_path_info = AP_REQ_DEFAULT_PATH_INFO;
  +    }
  +    else {
  +        return "AcceptPathInfo must be set to on, off or default";
  +    }
  +
       return NULL;
   }
   
  @@ -2437,8 +2449,8 @@
   #endif
   AP_INIT_TAKE1("AddDefaultCharset", set_add_default_charset, NULL, OR_FILEINFO, 
     "The name of the default charset to add to any Content-Type without one or 'Off' to disable"),
  -AP_INIT_FLAG("AcceptPathInfo", set_accept_path_info, NULL, OR_FILEINFO,
  -  "whether or not files with PATH_INFO will be served by the core handler"),
  +AP_INIT_TAKE1("AcceptPathInfo", set_accept_path_info, NULL, OR_FILEINFO,
  +  "Set to on or off for PATH_INFO to be accepted by handlers, or default for the per-handler
preference"),
   
   /* Old resource config file commands */
     
  @@ -2692,8 +2704,10 @@
        * if the value is no longer undefined (2), so any module changing
        * the value prior to the fixup phase OVERRIDES the user's choice.
        */
  -    if (r->used_path_info == 2)
  +    if ((r->used_path_info == AP_REQ_DEFAULT_PATH_INFO)
  +            && (conf->accept_path_info != 3)) {
           r->used_path_info = conf->accept_path_info;
  +    }
       return OK;
   }
   
  
  
  

Mime
View raw message