From: Eduard Bagdasaryan Date: Mon, 2 Jul 2018 03:14:14 +0000 (+0000) Subject: Optimization: Reuse CharacterSets when parsing HTTP responses (#231) X-Git-Tag: SQUID_4_2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50fea67769d9a5f84011026986e07546d21a940a;p=thirdparty%2Fsquid.git Optimization: Reuse CharacterSets when parsing HTTP responses (#231) Expensive CharacterSet objects creation and manipulation was happening for virtually every HTTP miss since 6fe0370. Also removed code duplication. --- diff --git a/src/http/one/ResponseParser.cc b/src/http/one/ResponseParser.cc index e22bedfe67..98ac559094 100644 --- a/src/http/one/ResponseParser.cc +++ b/src/http/one/ResponseParser.cc @@ -121,16 +121,7 @@ Http::One::ResponseParser::parseResponseFirstLine() { Http1::Tokenizer tok(buf_); - CharacterSet WspDelim = CharacterSet::SP; // strict parse only accepts SP - - if (Config.onoff.relaxed_header_parser) { - // RFC 7230 section 3.5 - // tolerant parser MAY accept any of SP, HTAB, VT (%x0B), FF (%x0C), or bare CR - // as whitespace between status-line fields - WspDelim += CharacterSet::HTAB - + CharacterSet("VT,FF","\x0B\x0C") - + CharacterSet::CR; - } + const CharacterSet &WspDelim = DelimiterCharacters(); if (msgProtocol_.protocol != AnyP::PROTO_NONE) { debugs(74, 6, "continue incremental parse for " << msgProtocol_);