summaryrefslogtreecommitdiff
path: root/src/configfile-glue.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-09-11 17:25:43 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-10-11 12:19:26 -0400
commit2e0676fd6dbab9da6b838f8f803bfc5dec11b346 (patch)
treec5a0e1841c9fc71691a82e64b7b6f3d68b5ae60a /src/configfile-glue.c
parent68ec5ad64226883182602d42eb9e2d4c100fed74 (diff)
downloadlighttpd-git-2e0676fd6dbab9da6b838f8f803bfc5dec11b346.tar.gz
[core] extend (data_string *) to store header id
(optional addition to (data_string *), used by http_header.[ch]) extend (data_string *) instead of creating another data_* TYPE_* (new data type would probably have (data_string *) as base class) (might revisit choice in the future) HTTP_HEADER_UNSPECIFIED has been removed. It was used in select locations as an optimization to avoid looking up enum header_header_e before checking the array, but the ordering in the array now relies on having the id. Having the id allows for a quick check if a common header is present or not in the htags bitmask, before checking the array, and allows for integer comparison in the log(n) search of the array, instead of strncasecmp(). With HTTP_HEADER_UNSPECIFIED removed, add optimization to set bit in htags for HTTP_HEADER_OTHER when an "other" header is added, but do not clear the bit, as there might be addtl "other" headers
Diffstat (limited to 'src/configfile-glue.c')
-rw-r--r--src/configfile-glue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/configfile-glue.c b/src/configfile-glue.c
index b53e8995..c8aca54b 100644
--- a/src/configfile-glue.c
+++ b/src/configfile-glue.c
@@ -572,7 +572,7 @@ static cond_result_t config_check_cond_nocache(request_st * const r, const data_
break;
case COMP_HTTP_REQUEST_HEADER:
- *((const buffer **)&l) = http_header_request_get(r, HTTP_HEADER_UNSPECIFIED, CONST_BUF_LEN(dc->comp_tag));
+ *((const buffer **)&l) = http_header_request_get(r, dc->ext, CONST_BUF_LEN(dc->comp_tag));
if (NULL == l) l = (buffer *)&empty_string;
break;
case COMP_HTTP_REQUEST_METHOD: