summaryrefslogtreecommitdiff
path: root/src/mod_access.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-01-13 16:05:00 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2021-01-13 16:10:16 -0500
commitf0074a7ded08d52b39f3ccc3829a3a830cd16261 (patch)
tree6ad12f6dd0a73cea2bf8b146af1a95b7d61d4e10 /src/mod_access.c
parent947d36941d2462a48912975703b7807b17db02c6 (diff)
downloadlighttpd-git-f0074a7ded08d52b39f3ccc3829a3a830cd16261.tar.gz
[mod_access] mark mod_access_check attribute pure
Diffstat (limited to 'src/mod_access.c')
-rw-r--r--src/mod_access.c10
1 files 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 <stdlib.h>
-#include <string.h>
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 */