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 Sun, 05 Nov 2000 01:40:57 GMT
gstein      00/11/04 17:40:57

  Modified:    src/modules/dav/main mod_dav.c
  Log:
  oops. only do the slash management if dir != NULL
  
  Revision  Changes    Path
  1.26      +22 -15    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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- mod_dav.c	2000/10/11 17:23:54	1.25
  +++ mod_dav.c	2000/11/05 01:40:57	1.26
  @@ -167,7 +167,19 @@
       dav_dir_conf *conf;
   
       conf = (dav_dir_conf *) apr_pcalloc(p, sizeof(*conf));
  -    conf->dir = apr_pstrdup(p, dir);
  +
  +    /* clean up the directory to remove any trailing slash */
  +    if (dir != NULL) {
  +        char *d;
  +        apr_size_t l;
  +
  +        d = apr_pstrdup(p, dir);
  +        l = strlen(d);
  +        if (l > 1 && d[l - 1] == '/')
  +            d[l - 1] = '\0';
  +        conf->dir = d;
  +    }
  +
       conf->d_params = apr_make_table(p, 1);
   
       return conf;
  @@ -182,7 +194,8 @@
       /* DBG3("dav_merge_dir_config: new=%08lx  base=%08lx  overrides=%08lx",
          (long)newconf, (long)base, (long)overrides); */
   
  -    newconf->provider_name = child->provider_name;
  +    newconf->provider_name = DAV_INHERIT_VALUE(parent, child, provider_name);
  +    newconf->provider = DAV_INHERIT_VALUE(parent, child, provider);
       if (parent->provider_name != NULL) {
           if (child->provider_name == NULL) {
               ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
  @@ -206,17 +219,6 @@
       apr_overlap_tables(newconf->d_params, child->d_params,
   		      APR_OVERLAP_TABLES_SET);
   
  -    if (newconf->provider_name == NULL)
  -        newconf->provider = NULL;
  -    else {
  -        newconf->provider = dav_lookup_provider(newconf->provider_name);
  -
  -        if (newconf->provider == NULL) {
  -            ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, NULL,
  -                         "Unknown DAV provider: %s", newconf->provider_name);
  -        }
  -    }
  -
       return newconf;
   }
   
  @@ -2798,9 +2800,14 @@
           return dav_handle_err(r, err, NULL);
       }
   
  -    /* set the Cache-Control headers, per the spec */
  +    /* set the Cache-Control header, per the spec */
       apr_table_setn(r->headers_out, "Cache-Control", "no-cache");
  -    return dav_created(r, working_resource->uri, "Working resource", 0);
  +
  +    /* use appropriate URI for Location header */
  +    if (working_resource == NULL)
  +        working_resource = resource;
  +
  +    return dav_created(r, working_resource->uri, "Checked-out resource", 0);
   }
   
   /* handle the UNCHECKOUT method */
  
  
  

Mime
View raw message