You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Collins-Sussman <su...@collab.net> on 2003/05/20 16:26:32 UTC
[PATCH] mod_dav activity creation
Greg Stein asked me to submit a patch for a shortcoming in mod_dav.
Hopefully this can make it into httpd-2.0.46. Here it is:
------------------------------------------
mod_dav providers define a 'can_be_activity' callback. Unfortunately,
mod_dav isn't calling it before creating an activity. This is a
required precondition (along with the resource not existing), as
defined in the deltaV RFC (3253), section 13.5.
* mod_dav.c (dav_method_make_activity): if available, call provider's
'can_be_activity' callback as a precondition to making an activity.
Index: mod_dav.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/dav/main/mod_dav.c,v
retrieving revision 1.92
diff -u -r1.92 mod_dav.c
--- mod_dav.c 3 Feb 2003 17:52:58 -0000 1.92
+++ mod_dav.c 20 May 2003 14:20:26 -0000
@@ -4068,6 +4068,15 @@
return dav_handle_err(r, err, NULL);
}
+ /* the provider must say whether the resource can be created as
+ an activity, i.e. whether the location is ok. */
+ if (vsn_hooks->can_be_activity != NULL
+ && !(*vsn_hooks->can_be_activity)(resource)) {
+ err = dav_new_error(r->pool, HTTP_FORBIDDEN, 0,
+ "<DAV:activity-location-ok/>");
+ return dav_handle_err(r, err, NULL);
+ }
+
/* ### what about locking? */
/* attempt to create the activity */