If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.
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;
}