summaryrefslogtreecommitdiff
path: root/src/mod_vhostdb_ldap.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-01-12 21:51:12 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-07-08 19:54:29 -0400
commit7c7f8c467c8b6af678faf10078d7a59c3856045a (patch)
tree491b6c04ef37043a51e230825aab4deb0a347c47 /src/mod_vhostdb_ldap.c
parentcc2134c88badd541cfe1954c80e371db5f28ede3 (diff)
downloadlighttpd-git-7c7f8c467c8b6af678faf10078d7a59c3856045a.tar.gz
[multiple] split con, request (very large change)
NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access) NB: request read and write chunkqueues currently point to connection chunkqueues; per-request and per-connection chunkqueues are not distinct from one another con->read_queue == r->read_queue con->write_queue == r->write_queue NB: in the future, a separate connection config may be needed for connection-level module hooks. Similarly, might need to have per-request chunkqueues separate from per-connection chunkqueues. Should probably also have a request_reset() which is distinct from connection_reset().
Diffstat (limited to 'src/mod_vhostdb_ldap.c')
-rw-r--r--src/mod_vhostdb_ldap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mod_vhostdb_ldap.c b/src/mod_vhostdb_ldap.c
index e06eb719..db87bd48 100644
--- a/src/mod_vhostdb_ldap.c
+++ b/src/mod_vhostdb_ldap.c
@@ -368,9 +368,9 @@ static LDAPMessage * mod_authn_ldap_search(log_error_st *errh, vhostdb_config *s
return lm;
}
-static void mod_vhostdb_patch_config (connection * const con, plugin_data * const p);
+static void mod_vhostdb_patch_config (request_st * const r, plugin_data * const p);
-static int mod_vhostdb_ldap_query(connection *con, void *p_d, buffer *docroot)
+static int mod_vhostdb_ldap_query(request_st * const r, void *p_d, buffer *docroot)
{
plugin_data *p = (plugin_data *)p_d;
vhostdb_config *dbconf;
@@ -385,17 +385,17 @@ static int mod_vhostdb_ldap_query(connection *con, void *p_d, buffer *docroot)
buffer *filter = docroot;
buffer_clear(filter); /*(also resets docroot (alias))*/
- mod_vhostdb_patch_config(con, p);
+ mod_vhostdb_patch_config(r, p);
if (NULL == p->conf.vdata) return 0; /*(after resetting docroot)*/
dbconf = (vhostdb_config *)p->conf.vdata;
- log_error_st * const errh = con->conf.errh;
+ log_error_st * const errh = r->conf.errh;
dbconf->errh = errh;
template = dbconf->filter;
for (char *b = template->ptr, *d; *b; b = d+1) {
if (NULL != (d = strchr(b, '?'))) {
buffer_append_string_len(filter, b, (size_t)(d - b));
- mod_authn_append_ldap_filter_escape(filter, con->uri.authority);
+ mod_authn_append_ldap_filter_escape(filter, &r->uri.authority);
} else {
d = template->ptr + buffer_string_length(template);
buffer_append_string_len(filter, b, (size_t)(d - b));
@@ -495,11 +495,11 @@ static void mod_vhostdb_merge_config(plugin_config * const pconf, const config_p
} while ((++cpv)->k_id != -1);
}
-static void mod_vhostdb_patch_config(connection * const con, plugin_data * const p) {
+static void mod_vhostdb_patch_config(request_st * const r, plugin_data * const p) {
p->conf = p->defaults; /* copy small struct instead of memcpy() */
/*memcpy(&p->conf, &p->defaults, sizeof(plugin_config));*/
for (int i = 1, used = p->nconfig; i < used; ++i) {
- if (config_check_cond(con, (uint32_t)p->cvlist[i].k_id))
+ if (config_check_cond(r, (uint32_t)p->cvlist[i].k_id))
mod_vhostdb_merge_config(&p->conf,p->cvlist + p->cvlist[i].v.u2[0]);
}
}