--- a/src/server/webdav/webdav.h Tue Aug 13 22:14:32 2019 +0200 +++ b/src/server/webdav/webdav.h Thu Oct 31 10:26:35 2019 +0100 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 2013 Olaf Wintermann. All rights reserved. + * Copyright 2019 Olaf Wintermann. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,7 +30,6 @@ #define WEBDAV_H #include "../public/webdav.h" -#include "../util/strbuf.h" #include <ucx/map.h> #include <ucx/list.h> @@ -39,7 +38,54 @@ extern "C" { #endif +#define WEBDAV_PATH_MAX 8192 + +typedef struct DefaultWebdavData { + WebdavVFSProperties vfsproperties; +} DefaultWebdavData; + + +int webdav_init(pblock *pb, Session *sn, Request *rq); + +int webdav_service(pblock *pb, Session *sn, Request *rq); +UcxBuffer* rqbody2buffer(Session *sn, Request *rq); + +int webdav_getdepth(Request *rq); + +int webdav_options(pblock *pb, Session *sn, Request *rq); + +int webdav_propfind(pblock *pb, Session *sn, Request *rq); +int propfind_children( + WebdavBackend *webdav, + WebdavPropfindRequest *request, + WebdavResponse *response, + VFSContext *vfs, + char *path); + +int webdav_proppatch(pblock *pb, Session *sn, Request *rq); +int webdav_mkcol(pblock *pb, Session *sn, Request *rq); +int webdav_post(pblock *pb, Session *sn, Request *rq); +int webdav_delete(pblock *pb, Session *sn, Request *rq); +int webdav_put(pblock *pb, Session *sn, Request *rq); +int webdav_copy(pblock *pb, Session *sn, Request *rq); +int webdav_move(pblock *pb, Session *sn, Request *rq); +int webdav_lock(pblock *pb, Session *sn, Request *rq); +int webdav_unlock(pblock *pb, Session *sn, Request *rq); +int webdav_report(pblock *pb, Session *sn, Request *rq); +int webdav_acl(pblock *pb, Session *sn, Request *rq); +int webdav_search (pblock *pb, Session *sn, Request *rq); + +int default_propfind_init( + WebdavPropfindRequest *rq, + const char* path); +int default_propfind_do( + WebdavPropfindRequest *request, + WebdavResponse *response, + VFS_DIR parent, + const char *path, + struct stat *s); +int default_propfind_finish(WebdavPropfindRequest *rq); #ifdef __cplusplus }