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

Method StartNextRequest

library/cpp/neh/http2.cpp:547–574  ·  view source on GitHub ↗

start next request on keep-alive connection

Source from the content-addressed store, hash-verified

545
546 //start next request on keep-alive connection
547 bool StartNextRequest(THttpRequestRef& req) {
548 if (Finalized_) {
549 return false;
550 }
551
552 {
553 //thread safe linking connection->request
554 TGuard<TSpinLock> g(SL_);
555 Req_ = req;
556 }
557
558 RequestWritten_ = false;
559 BeginReadResponse_ = false;
560
561 try {
562 TErrorCode ec;
563 SendRequest(req->BuildRequest(), ec); //throw std::bad_alloc
564 if (ec.Value() == ECANCELED) {
565 OnCancel();
566 } else if (ec) {
567 OnError(ec);
568 }
569 } catch (...) {
570 OnError(CurrentExceptionMessage());
571 throw;
572 }
573 return true;
574 }
575
576 //connection received from cache must be validated before using
577 //(process removing closed conection from cache consume some time)

Callers 1

RunMethod · 0.80

Calls 3

CurrentExceptionMessageFunction · 0.85
BuildRequestMethod · 0.80
ValueMethod · 0.45

Tested by

no test coverage detected