summaryrefslogtreecommitdiff
path: root/src/mod_proxy.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-06-06 01:17:43 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-06-06 02:48:43 -0400
commite20b5318d51f32b259c9edc8a16d919b139e6d10 (patch)
tree7541e1a01074e4c3095f82780447844ffb233d77 /src/mod_proxy.c
parent02cd38687b6e805651483a9ac2827377b1d1977a (diff)
downloadlighttpd-git-e20b5318d51f32b259c9edc8a16d919b139e6d10.tar.gz
[core] use buffer_eq_icase_ssn func
specialized buffer_eq_icase_ssn func replace strncasecmp() in cases where string lengths are known to be at least as large as the len being compared case-insensitively
Diffstat (limited to 'src/mod_proxy.c')
-rw-r--r--src/mod_proxy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index a6b05b83..3336fab1 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -309,7 +309,7 @@ static const buffer * http_header_remap_host_match (buffer *b, size_t off, http_
if (NULL == k) continue;
mlen = buffer_string_length(k);
}
- if (mlen == alen && 0 == strncasecmp(s, k->ptr, alen)) {
+ if (buffer_eq_icase_ss(s, alen, k->ptr, mlen)) {
if (buffer_is_equal_string(ds->value, CONST_STR_LEN("-"))) {
return remap_hdrs->http_host;
}
@@ -462,7 +462,7 @@ static void http_header_remap_setcookie (buffer *b, size_t off, http_header_rema
++e;
switch ((int)(e - s - 1)) {
case 4:
- if (0 == strncasecmp(s, "path", 4)) {
+ if (buffer_eq_icase_ssn(s, "path", 4)) {
if (*e == '"') ++e;
if (*e != '/') continue;
off = (size_t)(e - b->ptr);
@@ -472,7 +472,7 @@ static void http_header_remap_setcookie (buffer *b, size_t off, http_header_rema
}
break;
case 6:
- if (0 == strncasecmp(s, "domain", 6)) {
+ if (buffer_eq_icase_ssn(s, "domain", 6)) {
size_t alen = 0;
if (*e == '"') ++e;
if (*e == '.') ++e;