MCPcopy Create free account
hub / github.com/catboost/catboost / ParseHttpVersion

Method ParseHttpVersion

library/cpp/http/push_parser/http_parser.cpp:230–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void THttpParser::ParseHttpVersion(TStringBuf httpVersion) {
231 if (!httpVersion.StartsWith("HTTP/", 5)) {
232 throw yexception() << "expect 'HTTP/'";
233 }
234 httpVersion.Skip(5);
235 {
236 TStringBuf major, minor;
237 Split(httpVersion, '.', major, minor);
238 HttpVersion_.Major = FromString<unsigned>(major);
239 HttpVersion_.Minor = FromString<unsigned>(minor);
240 if (Y_LIKELY(HttpVersion_.Major > 1 || HttpVersion_.Minor > 0)) {
241 // since HTTP/1.1 Keep-Alive is default behaviour
242 KeepAlive_ = true;
243 }
244 }
245}
246
247void THttpParser::ParseHeaderLine() {
248 if (!!HeaderLine_) {

Callers

nothing calls this directly

Calls 4

yexceptionClass · 0.85
SplitFunction · 0.50
StartsWithMethod · 0.45
SkipMethod · 0.45

Tested by

no test coverage detected