mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 14:13:33 -06:00
Core: supported directory skipping in ngx_walk_tree().
If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.
This commit is contained in:
parent
314d0d40e7
commit
54e14a387f
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user