src/server/webdav/operation.h

branch
webdav
changeset 245
a193c42fc809
parent 241
4adad7faf452
child 246
155bdef7fe7e
--- a/src/server/webdav/operation.h	Sat Feb 01 18:44:31 2020 +0100
+++ b/src/server/webdav/operation.h	Sun Feb 02 17:42:05 2020 +0100
@@ -36,6 +36,8 @@
 #endif
 
 typedef int(*response_close_func)(WebdavOperation *, WebdavResource *);
+
+typedef struct WebdavVFSOperation WebdavVFSOperation;
     
 struct WebdavOperation {
     WebdavBackend          *dav;
@@ -54,6 +56,28 @@
     struct stat            *stat;         /* current stat object */
 };
 
+struct WebdavVFSOperation {
+    WebdavBackend          *dav;
+    Request                *rq;
+    Session                *sn;
+    
+    VFSContext             *vfs;
+    
+    char                   *path;
+    struct stat            *stat;
+    int                    stat_errno;
+};
+
+enum WebdavVFSOpType {
+    WEBDAV_VFS_MKDIR = 0,
+    WEBDAV_VFS_DELETE
+};
+
+typedef enum WebdavVFSOpType WebdavVFSOpType;
+
+typedef int(*vfs_op_func)(WebdavVFSRequest *, WSBool *);
+typedef int(*vfs_op_finish_func)(WebdavVFSRequest *, WSBool);
+
 /*
  * counts the number of backends
  */
@@ -101,6 +125,19 @@
         WebdavOperation *op,
         WebdavResource *resource);
 
+
+WebdavVFSOperation* webdav_vfs_op(
+        Session *sn,
+        Request *rq,
+        WebdavBackend *dav,
+        WSBool precondition);
+
+int webdav_vfs_stat(WebdavVFSOperation *op);
+
+int webdav_vfs_op_do(WebdavVFSOperation *op, WebdavVFSOpType type);
+
+int webdav_vfs_unlink(WebdavVFSOperation *op);
+
 #ifdef __cplusplus
 }
 #endif

mercurial