src/server/public/webdav.h

branch
webdav
changeset 245
a193c42fc809
parent 244
e59abb210584
child 252
5653a9626cc0
--- a/src/server/public/webdav.h	Sat Feb 01 18:44:31 2020 +0100
+++ b/src/server/public/webdav.h	Sun Feb 02 17:42:05 2020 +0100
@@ -57,6 +57,8 @@
 typedef struct WebdavProppatchRequest WebdavProppatchRequest;
 typedef struct WebdavLockRequest      WebdavLockRequest;
 
+typedef struct WebdavVFSRequest       WebdavVFSRequest;
+
 typedef struct WebdavResponse         WebdavResponse;
 typedef struct WebdavResource         WebdavResource;
 
@@ -198,6 +200,18 @@
     void *userdata;
 };
 
+struct WebdavVFSRequest {
+    Session *sn;
+    Request *rq;
+    
+    char *path;
+    
+    /*
+     * custom userdata for the backend
+     */
+    void *userdata;
+};
+
 struct WebdavLockRequest {
     Session *sn;
     Request *rq;
@@ -320,38 +334,36 @@
             WSBool);
     
     /*
-     * int opt_mkcol(
-     *     Session *sn,
-     *     Request *rq,
-     *     const char *path,
-     *     WSBool *out_created
+     * int opt_mkcol(WebdavVFSRequest *request, WSBool *out_created);
      * 
      * Optional mkcol callback that is called before vfs_mkdir. If the function
      * sets out_created to TRUE, vfs_mkdir will not be executed.
      */
-    int (*opt_mkcol)(
-            Session *,
-            Request *,
-            const char *,
-            WSBool *);
+    int (*opt_mkcol)(WebdavVFSRequest *, WSBool *);
     
     /*
-     * int opt_delete(
-     *     Session *sn,
-     *     Request *rq,
-     *     const char *path,
-     *     WSBool *out_deleted
+     * int opt_mkcol_finish(WebdavVFSRequest *request, WSBool success);
+     * 
+     * Optional callback for finishing a MKCOL request.
+     */
+    int(*opt_mkcol_finish)(WebdavVFSRequest *, WSBool);
+    
+    /*
+     * int opt_delete(WebdavVFSRequest *request, WSBool *out_deleted);
      * 
      * Optional delete callback that is called once before any VFS deletions.
      * When the callback sets out_deleted to TRUE, no VFS unlink operations
      * will be done.
      * 
      */
-    int (*opt_delete)(
-            Session *,
-            Request *,
-            const char *,
-            WSBool *);
+    int (*opt_delete)(WebdavVFSRequest *, WSBool *);
+    
+    /*
+     * int opt_delete_finish(WebdavVFSRequest *request, WSBool success);
+     * 
+     * Optional callback for finishing a DELETE request.
+     */
+    int (*opt_delete_finish)(WebdavVFSRequest *, WSBool);
     
     /*
      * See the WS_WEBDAV_* macros for informations about the settings

mercurial