]> granicus.if.org Git - apache/commitdiff
*) mod_dav.c: allow PUT to a WORKING resource (this actually the only valid
authorGreg Stein <gstein@apache.org>
Tue, 13 Mar 2001 02:13:55 +0000 (02:13 +0000)
committerGreg Stein <gstein@apache.org>
Tue, 13 Mar 2001 02:13:55 +0000 (02:13 +0000)
   place to do a PUT(!))

*) util.c: add a comment. allow validation to proceed without a lock
   database (the rest of the code supported it; one erroneous check disabled
   that work)

*) util_lock.c: allow dav_unlock() to be a no-op when a lock provide isn't
   present; this allows DELETE to work.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88508 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/main/mod_dav.c
modules/dav/main/util.c
modules/dav/main/util_lock.c

index e5e09fd7201be1c23a2f548768d681e3b3041fa4..9a80b1577a954f43ba141136e265bef089e0b188 100644 (file)
@@ -965,7 +965,8 @@ static int dav_method_put(request_rec *r)
         return dav_handle_err(r, err, NULL);
 
     /* If not a file or collection resource, PUT not allowed */
-    if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
+    if (resource->type != DAV_RESOURCE_TYPE_REGULAR
+        && resource->type != DAV_RESOURCE_TYPE_WORKING) {
         body = apr_psprintf(r->pool,
                            "Cannot create resource %s with PUT.",
                            ap_escape_html(r->pool, r->uri));
index e2229d30d47194f7f664e3f4fe408229aac01204..09df3b429eb7888e7ff29280975345091897c6a1 100644 (file)
@@ -1149,6 +1149,9 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p,
            ** We may have aborted the scan before seeing the locktoken.
            ** Rescan the If: header to see if we can find the locktoken
            ** somewhere.
+            **
+            ** Note that seen_locktoken == 0 implies lock_list != NULL
+            ** which implies locks_hooks != NULL.
            */
            if (dav_find_submitted_locktoken(if_header, lock_list,
                                             locks_hooks)) {
@@ -1364,11 +1367,6 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource,
             }
             lock_db_opened_locally = 1;
         }
-        else {
-            return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                                "Resource validation failed because no "
-                                "lock hooks were found.");
-        }
     }
 
     /* (1) Validate the specified resource, at the specified depth */
index 2a292666a69536019f27bdb3b5b5d289672dabc9..46daff601ed687ea7b437c7b1ffd52a3d9e104c8 100644 (file)
@@ -523,10 +523,9 @@ int dav_unlock(request_rec *r, const dav_resource *resource,
     const dav_hooks_repository *repos_hooks = resource->hooks;
     dav_error *err;
 
-    /* If no locks provider, we shouldn't have been called */
+    /* If no locks provider, then there is nothing to unlock. */
     if (hooks == NULL) {
-       /* ### map result to something nice; log an error */
-       return HTTP_INTERNAL_SERVER_ERROR;
+        return OK;
     }
 
     /* 2518 requires the entire lock to be removed if resource/locktoken