Welcome! Log In Create A New Profile

Advanced

[nginx] Core: supported directory skipping in ngx_walk_tree().

Roman Arutyunyan
February 02, 2015 11:42AM
details: http://hg.nginx.org/nginx/rev/863d9de1e62b
branches:
changeset: 5967:863d9de1e62b
user: Roman Arutyunyan <arut@nginx.com>
date: Mon Feb 02 19:38:32 2015 +0300
description:
Core: supported directory skipping in ngx_walk_tree().

If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.

diffstat:

src/core/ngx_file.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r bcdfc39bf44d -r 863d9de1e62b src/core/ngx_file.c
--- a/src/core/ngx_file.c Wed Jan 28 21:33:06 2015 +0300
+++ b/src/core/ngx_file.c Mon Feb 02 19:38:32 2015 +0300
@@ -1047,10 +1047,18 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_s
ctx->access = ngx_de_access(&dir);
ctx->mtime = ngx_de_mtime(&dir);

- if (ctx->pre_tree_handler(ctx, &file) == NGX_ABORT) {
+ rc = ctx->pre_tree_handler(ctx, &file);
+
+ if (rc == NGX_ABORT) {
goto failed;
}

+ if (rc == NGX_DECLINED) {
+ ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->log, 0,
+ "tree skip dir \"%s\"", file.data);
+ continue;
+ }
+
if (ngx_walk_tree(ctx, &file) == NGX_ABORT) {
goto failed;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: supported directory skipping in ngx_walk_tree().

Roman Arutyunyan 545 February 02, 2015 11:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready