]> granicus.if.org Git - apache/commitdiff
*) make sure the status line is set on custom responses
authorGreg Stein <gstein@apache.org>
Thu, 8 Feb 2001 11:31:02 +0000 (11:31 +0000)
committerGreg Stein <gstein@apache.org>
Thu, 8 Feb 2001 11:31:02 +0000 (11:31 +0000)
*) allow CHECKOUT on version resources

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

modules/dav/main/mod_dav.c

index 0c3168f48402381a9a84218abbe376cf3cba0d80..72213d0b94bf3ac555d5242a22b14c3db5550be8 100644 (file)
@@ -352,6 +352,7 @@ static const char *dav_cmd_davparam(cmd_parms *cmd, void *config,
 static int dav_error_response(request_rec *r, int status, const char *body)
 {
     r->status = status;
+    r->status_line = ap_get_status_line(status);
     r->content_type = "text/html";
 
     /* since we're returning DONE, ensure the request body is consumed. */
@@ -3328,6 +3329,8 @@ static int dav_method_checkout(request_rec *r)
             else {
                 const ap_xml_elem *child = aset->first_child;
 
+                activities = apr_make_array(r->pool, 1, sizeof(const char *));
+
                 for (; child != NULL; child = child->next) {
                     if (child->ns == AP_XML_NS_DAV_ID
                         && strcmp(child->name, "href") == 0) {
@@ -3367,7 +3370,8 @@ static int dav_method_checkout(request_rec *r)
     /* Check the state of the resource: must be a file or collection,
      * must be versioned, and must not already be checked out.
      */
-    if (resource->type != DAV_RESOURCE_TYPE_REGULAR) {
+    if (resource->type != DAV_RESOURCE_TYPE_REGULAR
+        && resource->type != DAV_RESOURCE_TYPE_VERSION) {
        return dav_error_response(r, HTTP_CONFLICT,
                                  "Cannot checkout this type of resource.");
     }