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

Method OnReadSome

library/cpp/neh/http2.cpp:1550–1587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1548 }
1549
1550 void OnReadSome(const TErrorCode& ec, size_t amount, IHandlingContext& ctx) {
1551 if (ec || !amount) {
1552 OnError();
1553
1554 return;
1555 }
1556
1557 DBGOUT("ReadSome(" << (!AS_ ? -666 : AS_->Native()) << "): " << amount);
1558 try {
1559 size_t buffPos = 0;
1560 //DBGOUT("receive and parse: " << TStringBuf(Buff_.Get(), amount));
1561 while (P_->Parse(Buff_.Get() + buffPos, amount - buffPos)) {
1562 if (!P_->IsKeepAlive() || LeftRequestsToDisconnect_ == 1) {
1563 SeenMessageWithoutKeepalive_ = true;
1564 }
1565
1566 char rt = *P_->FirstLine().data();
1567 const size_t extraDataSize = P_->GetExtraDataSize();
1568 if (rt == 'P' || rt == 'p') {
1569 OnRequest(new TRequestPost(WeakThis_, P_));
1570 } else {
1571 OnRequest(new TRequestGet(WeakThis_, P_));
1572 }
1573 if (extraDataSize) {
1574 // has http pipelining
1575 buffPos = amount - extraDataSize;
1576 ExpectNewRequest();
1577 } else {
1578 ExpectNewRequest();
1579 ctx.ContinueUseHandler(HS_.GetKeepAliveTimeout());
1580 return;
1581 }
1582 }
1583 ctx.ContinueUseHandler(THttp2Options::ServerInputDeadline);
1584 } catch (...) {
1585 OnError();
1586 }
1587 }
1588
1589 void OnRequest(TRequest* r) {
1590 DBGOUT("OnRequest()");

Callers

nothing calls this directly

Calls 8

NativeMethod · 0.80
GetExtraDataSizeMethod · 0.80
ContinueUseHandlerMethod · 0.80
GetKeepAliveTimeoutMethod · 0.80
ParseMethod · 0.45
GetMethod · 0.45
IsKeepAliveMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected