[PATCH v4 12/12] Static: multiple paths in the "index" option

Alejandro Colomar (man-pages) alx.manpages at gmail.com
Thu Dec 23 20:02:05 UTC 2021


On 12/23/21 20:25, Alejandro Colomar wrote:
> diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c
> index 16744f2..30b7fd6 100644
> --- a/src/nxt_http_static.c
> +++ b/src/nxt_http_static.c
> @@ -698,7 +711,10 @@ nxt_http_static_next(nxt_task_t *task, nxt_http_request_t *r,
>       action = ctx->action;
>       conf = action->u.conf;
>   
> -    ctx->share_idx++;
> +    ctx->index_idx = (ctx->index_idx + 1) % conf->nindices;
> +    if (ctx->index_idx == 0) {
> +        ctx->share_idx++;
> +    }

I'll optimize this to only iterate over index
if (ctx->share.start[shr->length - 1] == '/')

-- 
Alejandro Colomar
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/


More information about the unit mailing list