Core: supported directory skipping in ngx_walk_tree().

If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.
This commit is contained in:
Roman Arutyunyan 2015-02-02 19:38:32 +03:00
parent 314d0d40e7
commit 54e14a387f

View File

@ -1047,10 +1047,18 @@ ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree)
ctx->access = ngx_de_access(&dir); ctx->access = ngx_de_access(&dir);
ctx->mtime = ngx_de_mtime(&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; 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) { if (ngx_walk_tree(ctx, &file) == NGX_ABORT) {
goto failed; goto failed;
} }