From f0074a7ded08d52b39f3ccc3829a3a830cd16261 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 13 Jan 2021 16:05:00 -0500 Subject: [PATCH] [mod_access] mark mod_access_check attribute pure --- src/mod_access.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mod_access.c b/src/mod_access.c index 6d318f3d..327215f6 100644 --- a/src/mod_access.c +++ b/src/mod_access.c @@ -1,6 +1,6 @@ #include "first.h" -#include "base.h" +#include "request.h" #include "array.h" #include "buffer.h" #include "log.h" @@ -8,7 +8,6 @@ #include "plugin.h" #include -#include typedef struct { const array *access_allow; @@ -98,17 +97,18 @@ static handler_t mod_access_reject (request_st * const r, plugin_data * const p) return HANDLER_FINISHED; } -static int mod_access_check (const array *allow, const array *deny, const buffer *urlpath, const int lc) { +__attribute_pure__ +static int mod_access_check (const array * const allow, const array * const deny, const buffer * const urlpath, const int lc) { if (allow && allow->used) { - const buffer *match = (!lc) + const buffer * const match = (!lc) ? array_match_value_suffix(allow, urlpath) : array_match_value_suffix_nc(allow, urlpath); return (match != NULL); /* allowed if match; denied if none matched */ } if (deny && deny->used) { - const buffer *match = (!lc) + const buffer * const match = (!lc) ? array_match_value_suffix(deny, urlpath) : array_match_value_suffix_nc(deny, urlpath); return (match == NULL); /* deny if match; allow if none matched */