From c6097e1d7667457765c42e73ef26aa74b961ca4d Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Fri, 28 Nov 2014 23:53:49 +0300 Subject: [PATCH] src: faster general header value loop --- http_parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/http_parser.c b/http_parser.c index 65bf077..263eaeb 100644 --- a/http_parser.c +++ b/http_parser.c @@ -1516,6 +1516,15 @@ size_t http_parser_execute (http_parser *parser, switch (h_state) { case h_general: + for (; p != data + len; p++) { + ch = *p; + if (ch == CR || ch == LF) { + --p; + break; + } + } + if (p == data + len) + --p; break; case h_connection: