| 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()"); |
nothing calls this directly
no test coverage detected