aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-27 11:51:12 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-27 11:51:12 +0100
commit469410001bf283b658515391514d4c2077731d04 (patch)
treef25f2bd6f60614214f86cc5f28e08c1849c1c05b
parent62ee3ef1ca13872e1f9b07f6e4e53cea8b684d72 (diff)
http.c: Break on found header
Once a given HTTP header from the list has been found, it makes no sense to keep reading the rest from it.
-rw-r--r--http.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/http.c b/http.c
index 2868d07..014dcc6 100644
--- a/http.c
+++ b/http.c
@@ -1592,8 +1592,13 @@ static int process_header(struct http_ctx *const h, const char *const line,
const struct header *const hdr = &headers[i];
int ret;
- if (!strncasecmp(line, hdr->header, n) && (ret = hdr->f(h, value)))
- return ret;
+ if (!strncasecmp(line, hdr->header, n))
+ {
+ if ((ret = hdr->f(h, value)))
+ return ret;
+
+ break;
+ }
}
return append_header(h, line, n, value);