comparison src/http/modules/ngx_http_dav_module.c @ 1058:01f818c6f7de

add size, access, and mtime to ngx_walk_tree()
author Igor Sysoev <igor@sysoev.ru>
date Thu, 18 Jan 2007 21:04:31 +0000
parents 7ea5db4c06cb
children 8e5c032e7855
comparison
equal deleted inserted replaced
1057:bbde03037ef6 1058:01f818c6f7de
17 ngx_uint_t access; 17 ngx_uint_t access;
18 } ngx_http_dav_loc_conf_t; 18 } ngx_http_dav_loc_conf_t;
19 19
20 20
21 static ngx_int_t ngx_http_dav_handler(ngx_http_request_t *r); 21 static ngx_int_t ngx_http_dav_handler(ngx_http_request_t *r);
22 static ngx_int_t ngx_http_dav_no_init(ngx_tree_ctx_t *ctx, 22 static ngx_int_t ngx_http_dav_no_init(void *ctx, void *prev);
23 ngx_tree_ctx_t *prev);
24 static ngx_int_t ngx_http_dav_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path); 23 static ngx_int_t ngx_http_dav_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path);
25 static ngx_int_t ngx_http_dav_delete_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path); 24 static ngx_int_t ngx_http_dav_delete_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path);
26 static ngx_int_t ngx_http_dav_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path); 25 static ngx_int_t ngx_http_dav_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path);
27 static void ngx_http_dav_put_handler(ngx_http_request_t *r); 26 static void ngx_http_dav_put_handler(ngx_http_request_t *r);
28 static ngx_int_t ngx_http_dav_error(ngx_http_request_t *, ngx_err_t err, 27 static ngx_int_t ngx_http_dav_error(ngx_http_request_t *, ngx_err_t err,
188 tree.file_handler = ngx_http_dav_delete_file; 187 tree.file_handler = ngx_http_dav_delete_file;
189 tree.pre_tree_handler = ngx_http_dav_noop; 188 tree.pre_tree_handler = ngx_http_dav_noop;
190 tree.post_tree_handler = ngx_http_dav_delete_dir; 189 tree.post_tree_handler = ngx_http_dav_delete_dir;
191 tree.spec_handler = ngx_http_dav_delete_file; 190 tree.spec_handler = ngx_http_dav_delete_file;
192 tree.data = NULL; 191 tree.data = NULL;
193 tree.size = 0; 192 tree.alloc = 0;
194 tree.log = r->connection->log; 193 tree.log = r->connection->log;
195 194
196 if (ngx_walk_tree(&tree, &path) == NGX_OK) { 195 if (ngx_walk_tree(&tree, &path) == NGX_OK) {
197 196
198 if (ngx_delete_dir(path.data) != NGX_FILE_ERROR) { 197 if (ngx_delete_dir(path.data) != NGX_FILE_ERROR) {
268 return NGX_DECLINED; 267 return NGX_DECLINED;
269 } 268 }
270 269
271 270
272 static ngx_int_t 271 static ngx_int_t
273 ngx_http_dav_no_init(ngx_tree_ctx_t *ctx, ngx_tree_ctx_t *prev) 272 ngx_http_dav_no_init(void *ctx, void *prev)
274 { 273 {
275 return NGX_OK; 274 return NGX_OK;
276 } 275 }
277 276
278 277