Added all the rest of the project files. It doesn't work as an nginx module yet I need to find the error.

This commit is contained in:
2024-04-11 20:28:25 +03:00
parent 8ff4438f82
commit e3eb52487f
5 changed files with 3249 additions and 0 deletions

78
ngx_http_webdav_utils.h Normal file
View File

@@ -0,0 +1,78 @@
/*
* Copyright (C) Starfields
*/
#include <ngx_http.h>
#ifndef NGX_HTTP_DAV_EXT_CONF_H
#define NGX_HTTP_DAV_EXT_CONF_H
typedef struct {
ngx_str_t uri;
ngx_str_t name;
time_t mtime;
off_t size;
time_t lock_expire;
ngx_str_t lock_root;
uint32_t lock_token;
unsigned dir : 1;
unsigned lock_supported : 1;
unsigned lock_infinite : 1;
} ngx_http_dav_ext_entry_t;
typedef struct {
ngx_queue_t queue;
} ngx_http_dav_ext_lock_sh_t;
typedef struct {
time_t timeout;
ngx_slab_pool_t *shpool;
ngx_http_dav_ext_lock_sh_t *sh;
} ngx_http_dav_ext_lock_t;
typedef struct {
ngx_queue_t queue;
uint32_t token;
time_t expire;
ngx_uint_t infinite; /* unsigned infinite:1; */
size_t len;
u_char data[1];
} ngx_http_dav_ext_node_t;
ngx_int_t
ngx_http_dav_delete_path(ngx_http_request_t *r, ngx_str_t *path, ngx_uint_t dir);
ngx_int_t ensure_trailing_slash(ngx_http_request_t *r, ngx_str_t *uri);
ngx_int_t ngx_http_dav_depth(ngx_http_request_t *r,
ngx_int_t default_depth);
ngx_int_t ngx_http_dav_ext_depth(ngx_http_request_t *r,
ngx_int_t default_depth);
ngx_int_t ngx_http_dav_location(ngx_http_request_t *r);
ngx_int_t
ngx_http_dav_error(ngx_log_t *log, ngx_err_t err, ngx_int_t not_found,
char *failed, u_char *path);
uint32_t ngx_http_dav_ext_if(ngx_http_request_t *r, ngx_str_t *uri);
ngx_http_dav_ext_node_t *
ngx_http_dav_ext_lock_lookup(ngx_http_request_t *r,
ngx_http_dav_ext_lock_t *lock, ngx_str_t *uri,
ngx_int_t depth);
ngx_int_t ngx_http_dav_ext_set_locks(ngx_http_request_t *r,
ngx_http_dav_ext_entry_t *entry);
uintptr_t
ngx_http_dav_ext_format_lockdiscovery(ngx_http_request_t *r, u_char *dst,
ngx_http_dav_ext_entry_t *entry);
uintptr_t ngx_http_dav_ext_format_token(u_char *dst, uint32_t token,
ngx_uint_t brackets);
ngx_int_t ngx_http_dav_ext_strip_uri(ngx_http_request_t *r,
ngx_str_t *uri);
ngx_int_t
ngx_http_dav_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path);
#endif