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

Method StartRequest

library/cpp/neh/http2.cpp:523–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521 }
522
523 void StartRequest(THttpRequestRef req, const TEndpoint& ep, size_t addrId, TDuration slowConn) {
524 {
525 //thread safe linking connection->request
526 TGuard<TSpinLock> g(SL_);
527 Req_ = req;
528 }
529 AddrId_ = addrId;
530 try {
531 TDuration connectDeadline(THttp2Options::ConnectTimeout);
532 if (THttp2Options::ConnectTimeout > slowConn) {
533 //use append non fatal connect deadline, so on first timedout
534 //report about slow connecting to THttpRequest, and continue wait ConnectDeadline_ period
535 connectDeadline = slowConn;
536 ConnectDeadline_ = THttp2Options::ConnectTimeout - slowConn;
537 }
538 DBGOUT("AsyncConnect to " << ep.IpToString());
539 AS_.AsyncConnect(ep, std::bind(&THttpConn::OnConnect, THttpConnRef(this), _1, _2), connectDeadline);
540 } catch (...) {
541 ReleaseRequest();
542 throw;
543 }
544 }
545
546 //start next request on keep-alive connection
547 bool StartNextRequest(THttpRequestRef& req) {

Callers 3

RunMethod · 0.80
OnConnectFailedMethod · 0.80

Calls 2

IpToStringMethod · 0.80
AsyncConnectMethod · 0.45

Tested by

no test coverage detected