summaryrefslogtreecommitdiff
path: root/src/mod_auth.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-10-17 10:25:11 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-10-19 21:40:14 -0400
commitd6f692f1c21c79f4dbf68071c7a48a4b2316311a (patch)
tree22e6eea10dfa305f785c0ad7c686d74e1756cc7d /src/mod_auth.c
parent3d8dcbdd4327c884f1d46fad690a6c01fc441fbd (diff)
downloadlighttpd-git-d6f692f1c21c79f4dbf68071c7a48a4b2316311a.tar.gz
[core] config_plugin_value_to_int32()
Diffstat (limited to 'src/mod_auth.c')
-rw-r--r--src/mod_auth.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mod_auth.c b/src/mod_auth.c
index 731f7a82..6733e967 100644
--- a/src/mod_auth.c
+++ b/src/mod_auth.c
@@ -7,6 +7,7 @@
#include "base.h"
#include "plugin.h"
+#include "plugin_config.h"
#include "http_auth.h"
#include "http_header.h"
#include "log.h"
@@ -96,13 +97,9 @@ http_auth_cache_init (const array *opts)
ac->sptree = NULL;
ac->max_age = 600; /* 10 mins */
for (uint32_t i = 0, used = opts->used; i < used; ++i) {
- data_string *ds = (data_string *)opts->data[i];
- if (buffer_is_equal_string(&ds->key, CONST_STR_LEN("max-age"))) {
- if (ds->type == TYPE_STRING)
- ac->max_age = (time_t)strtol(ds->value.ptr, NULL, 10);
- else if (ds->type == TYPE_INTEGER)
- ac->max_age = (time_t)((data_integer *)ds)->value;
- }
+ data_unset *du = opts->data[i];
+ if (buffer_is_equal_string(&du->key, CONST_STR_LEN("max-age")))
+ ac->max_age = (time_t)config_plugin_value_to_int32(du, ac->max_age);
}
return ac;
}