summaryrefslogtreecommitdiff
path: root/src/mod_maxminddb.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-07-24 01:15:25 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-08-02 07:47:41 -0400
commit164f7600b7bf0962b759b0f08e93555011d421bc (patch)
treef72b29d9561c6c8c1bf0343d5e4b4f6012c8990d /src/mod_maxminddb.c
parentfea5bdc87349b5841ff70249258a0a4b31040313 (diff)
downloadlighttpd-git-164f7600b7bf0962b759b0f08e93555011d421bc.tar.gz
[multiple] con hooks store ctx in con->plugin_ctx
modules with connection level hooks now store ctx in con->plugin_ctx
Diffstat (limited to 'src/mod_maxminddb.c')
-rw-r--r--src/mod_maxminddb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mod_maxminddb.c b/src/mod_maxminddb.c
index 2102a310..c9348850 100644
--- a/src/mod_maxminddb.c
+++ b/src/mod_maxminddb.c
@@ -421,7 +421,8 @@ mod_maxmind_geoip2 (array * const env, const struct sockaddr * const dst_addr,
REQUEST_FUNC(mod_maxminddb_request_env_handler)
{
- const sock_addr * const dst_addr = &r->con->dst_addr;
+ connection * const con = r->con;
+ const sock_addr * const dst_addr = &con->dst_addr;
const int sa_family = dst_addr->plain.sa_family;
if (sa_family != AF_INET && sa_family != AF_INET6) return HANDLER_GO_ON;
@@ -431,14 +432,14 @@ REQUEST_FUNC(mod_maxminddb_request_env_handler)
/* check that mod_maxmind is activated and env fields were requested */
if (!pconf.activate || NULL == pconf.env) return HANDLER_GO_ON;
- array *env = r->plugin_ctx[p->id];
+ array *env = con->plugin_ctx[p->id];
if (NULL == env) {
- env = r->plugin_ctx[p->id] = array_init(pconf.env->used);
+ env = con->plugin_ctx[p->id] = array_init(pconf.env->used);
if (pconf.mmdb)
mod_maxmind_geoip2(env, (const struct sockaddr *)dst_addr, &pconf);
}
- for (size_t i = 0; i < env->used; ++i) {
+ for (uint32_t i = 0; i < env->used; ++i) {
/* note: replaces values which may have been set by mod_openssl
* (when mod_extforward is listed after mod_openssl in server.modules)*/
data_string *ds = (data_string *)env->data[i];
@@ -452,12 +453,11 @@ REQUEST_FUNC(mod_maxminddb_request_env_handler)
CONNECTION_FUNC(mod_maxminddb_handle_con_close)
{
- request_st * const r = &con->request;
plugin_data *p = p_d;
- array *env = r->plugin_ctx[p->id];
+ array *env = con->plugin_ctx[p->id];
if (NULL != env) {
array_free(env);
- r->plugin_ctx[p->id] = NULL;
+ con->plugin_ctx[p->id] = NULL;
}
return HANDLER_GO_ON;