httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_actions.c
Date Mon, 14 Jul 2003 12:36:20 GMT
nd          2003/07/14 05:36:20

  Modified:    .        CHANGES
               modules/mappers mod_actions.c
  Log:
  Introduce the "virtual" modifier to the Action directive,
  which allows the use of handlers for virtual locations.
  
  PR:	8431
  
  Revision  Changes    Path
  1.1219    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1218
  retrieving revision 1.1219
  diff -u -r1.1218 -r1.1219
  --- CHANGES	12 Jul 2003 16:38:25 -0000	1.1218
  +++ CHANGES	14 Jul 2003 12:36:18 -0000	1.1219
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_actions: Introduce the "virtual" modifier to the Action directive,
  +     which allows the use of handlers for virtual locations. PR 8431.
  +     [André Malo]
  +
     *) mod_speling: Recognize AcceptPathInfo setting for the particular
        location. Default is to reject path information. PR 21059.
        [André Malo]
  
  
  
  1.32      +23 -12    httpd-2.0/modules/mappers/mod_actions.c
  
  Index: mod_actions.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_actions.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- mod_actions.c	14 Feb 2003 00:43:52 -0000	1.31
  +++ mod_actions.c	14 Jul 2003 12:36:20 -0000	1.32
  @@ -130,11 +130,20 @@
   }
   
   static const char *add_action(cmd_parms *cmd, void *m_v, 
  -                              const char *type, const char *script)
  +                              const char *type, const char *script,
  +                              const char *option)
   {
       action_dir_config *m = (action_dir_config *)m_v;
  -    apr_table_setn(m->action_types, type, script);
  +
  +    if (option && strcasecmp(option, "virtual")) {
  +        return apr_pstrcat(cmd->pool,
  +                           "unrecognized option '", option, "'", NULL);
  +    }
  +
  +    apr_table_setn(m->action_types, type,
  +                   apr_pstrcat(cmd->pool, option ? "1" : "0", script, NULL));
       m->configured = 1;
  +
       return NULL;
   }
   
  @@ -164,7 +173,7 @@
   
   static const command_rec action_cmds[] =
   {
  -    AP_INIT_TAKE2("Action", add_action, NULL, OR_FILEINFO,
  +    AP_INIT_TAKE23("Action", add_action, NULL, OR_FILEINFO,
                     "a media type followed by a script name"),
       AP_INIT_TAKE2("Script", set_script, NULL, ACCESS_CONF | RSRC_CONF,
                     "a method followed by a script name"),
  @@ -208,15 +217,17 @@
   
       /* Second, check for actions (which override the method scripts) */
       action = r->handler ? r->handler :
  -	ap_field_noparam(r->pool, r->content_type);
  -    if ((t = apr_table_get(conf->action_types,
  -		       action ? action : ap_default_type(r)))) {
  -	script = t;
  -	if (r->finfo.filetype == 0) {
  -	    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  -			"File does not exist: %s", r->filename);
  -	    return HTTP_NOT_FOUND;
  -	}
  +        ap_field_noparam(r->pool, r->content_type);
  +    action = action ? action : ap_default_type(r);
  +
  +    if ((t = apr_table_get(conf->action_types, action))) {
  +        if (*t++ == '0' && r->finfo.filetype == 0) {
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +                          "File does not exist: %s", r->filename);
  +            return HTTP_NOT_FOUND;
  +        }
  +
  +        script = t;
       }
   
       if (script == NULL)
  
  
  

Mime
View raw message