diff -r 44cf877b3d9f -r 2d14055c3543 src/server/safs/nametrans.c --- a/src/server/safs/nametrans.c Sun May 01 12:33:48 2022 +0200 +++ b/src/server/safs/nametrans.c Mon May 02 11:29:15 2022 +0200 @@ -32,6 +32,7 @@ #include "../daemon/request.h" #include "../util/pblock.h" #include "../util/util.h" +#include "../public/webdav.h" #include "../public/vfs.h" @@ -47,6 +48,16 @@ return 0; } +static int nametrans_set_dav(pblock *pb, Session *sn, Request *rq) { + char *davclass = pblock_findkeyval(pb_key_davclass, pb); + if(!davclass) return 0; + + WebdavBackend *dav = webdav_create(sn, rq, davclass, pb); + + rq->davCollection = dav; + return 0; +} + /* * assign_name * @@ -130,6 +141,8 @@ * from prefix * dir file system directory * name (optional) object name + * vfsclass (optional) vfs name + * davclass (optional) dav backend * */ int pfx2dir(pblock *pb, Session *sn, Request *rq) { @@ -175,6 +188,10 @@ log_ereport(LOG_FAILURE, "pfx2dir: cannot create VFS: from=%s dir=%s name=%s", from, dir, name); return REQ_ABORTED; } + if(nametrans_set_dav(pb, sn, rq)) { + log_ereport(LOG_FAILURE, "pfx2dir: cannot create Webdav Backend: from=%s dir=%s name=%s", from, dir, name); + return REQ_ABORTED; + } request_set_path(sstr(dir), sstr(uri), rq->vars);