httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/dav/main mod_dav.c
Date Sat, 09 Sep 2000 22:55:10 GMT
gstein      00/09/09 15:55:10

  Modified:    src/modules/dav/main mod_dav.c
  Log:
  the DAV directive now takes the name of a repository provider
  
  Revision  Changes    Path
  1.19      +33 -11    apache-2.0/src/modules/dav/main/mod_dav.c
  
  Index: mod_dav.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/main/mod_dav.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_dav.c	2000/09/09 09:25:22	1.18
  +++ mod_dav.c	2000/09/09 22:55:09	1.19
  @@ -95,6 +95,9 @@
   #include "dav_opaquelock.h"
   
   
  +/* ### what is the best way to set this? */
  +#define DAV_DEFAULT_PROVIDER    "filesystem"
  +
   enum {
       DAV_ENABLED_UNSET = 0,
       DAV_ENABLED_OFF,
  @@ -103,7 +106,7 @@
   
   /* per-dir configuration */
   typedef struct {
  -    int enabled;
  +    const char *provider;
       const char *dir;
       int locktimeout;
       int handle_get;		/* cached from repository hook structure */
  @@ -183,8 +186,21 @@
   
       /* DBG3("dav_merge_dir_config: new=%08lx  base=%08lx  overrides=%08lx",
          (long)newconf, (long)base, (long)overrides); */
  +
  +    newconf->provider = child->provider;
  +    if (parent->provider != NULL) {
  +        if (child->provider == NULL) {
  +            ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
  +                         "\"DAV Off\" cannot be used to turn off a subtree "
  +                         "of a DAV-enabled location.");
  +        }
  +        else if (strcasecmp(child->provider, parent->provider) != 0) {
  +            ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
  +                         "A subtree cannot specify a different DAV provider "
  +                         "than its parent.");
  +        }
  +    }
   
  -    newconf->enabled = DAV_INHERIT_VALUE(parent, child, enabled);
       newconf->locktimeout = DAV_INHERIT_VALUE(parent, child, locktimeout);
       newconf->dir = DAV_INHERIT_VALUE(parent, child, dir);
       newconf->allow_depthinfinity = DAV_INHERIT_VALUE(parent, child,
  @@ -263,16 +279,22 @@
   }
   
   /*
  - * Command handler for the DAV directive, which is FLAG.
  + * Command handler for the DAV directive, which is TAKE1.
    */
  -static const char *dav_cmd_dav(cmd_parms *cmd, void *config, int arg)
  +static const char *dav_cmd_dav(cmd_parms *cmd, void *config, const char *arg1)
   {
       dav_dir_conf *conf = (dav_dir_conf *) config;
   
  -    if (arg)
  -	conf->enabled = DAV_ENABLED_ON;
  -    else
  -	conf->enabled = DAV_ENABLED_OFF;
  +    if (strcasecmp(arg1, "on") == 0) {
  +	conf->provider = DAV_DEFAULT_PROVIDER;
  +    }
  +    else if (strcasecmp(arg1, "off") == 0) {
  +	conf->provider = NULL;
  +    }
  +    else {
  +        conf->provider = apr_pstrdup(cmd->pool, arg1);
  +    }
  +
       return NULL;
   }
   
  @@ -3171,7 +3193,7 @@
   						 &dav_module);
   
       /* if DAV is not enabled, then we've got nothing to do */
  -    if (conf->enabled != DAV_ENABLED_ON) {
  +    if (conf->provider == NULL) {
   	return DECLINED;
       }
   
  @@ -3227,8 +3249,8 @@
   static const command_rec dav_cmds[] =
   {
       /* per directory/location */
  -    AP_INIT_FLAG("DAV", dav_cmd_dav, NULL, ACCESS_CONF,
  -                 "turn DAV on/off for a directory or location"),
  +    AP_INIT_TAKE1("DAV", dav_cmd_dav, NULL, ACCESS_CONF,
  +                  "specify the DAV provider for a directory or location"),
   
       /* per directory/location, or per server */
       AP_INIT_TAKE1("DAVMinTimeout", dav_cmd_davmintimeout, NULL,
  
  
  

Mime
View raw message