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

Method ApplyHeaderLine

library/cpp/http/push_parser/http_parser.cpp:339–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339void THttpParser::ApplyHeaderLine(const TStringBuf& name, const TStringBuf& val) {
340 if (AsciiEqualsIgnoreCase(name, TStringBuf("connection"))) {
341 KeepAlive_ = AsciiEqualsIgnoreCase(val, TStringBuf("keep-alive"));
342 } else if (AsciiEqualsIgnoreCase(name, TStringBuf("content-length"))) {
343 Y_ENSURE(val.size(), "NEH: Content-Length cannot be empty string. ");
344 ContentLength_ = FromString<ui64>(val);
345 HasContentLength_ = true;
346 } else if (AsciiEqualsIgnoreCase(name, TStringBuf("transfer-encoding"))) {
347 if (AsciiEqualsIgnoreCase(val, TStringBuf("chunked"))) {
348 ChunkInputState_ = new TChunkInputState();
349 }
350 } else if (AsciiEqualsIgnoreCase(name, TStringBuf("accept-encoding"))) {
351 TStringBuf encodings(val);
352 while (encodings.size()) {
353 TStringBuf enc = encodings.NextTok(',').After(' ').Before(' ');
354 if (!enc) {
355 continue;
356 }
357 TString s(enc);
358 s.to_lower();
359 AcceptEncodings_.insert(s);
360 }
361 } else if (AsciiEqualsIgnoreCase(name, TStringBuf("content-encoding"))) {
362 TString s(val);
363 s.to_lower();
364 ContentEncoding_ = s;
365 }
366}

Callers

nothing calls this directly

Calls 7

AsciiEqualsIgnoreCaseFunction · 0.85
BeforeMethod · 0.80
AfterMethod · 0.80
sizeMethod · 0.45
NextTokMethod · 0.45
to_lowerMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected