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

Method OnConnect

library/cpp/neh/http2.cpp:1212–1231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210 }
1211
1212 void THttpRequest::OnConnect(THttpConn* c) {
1213 THttpConnRef extraConn;
1214 {
1215 TGuard<TSpinLock> g(SL_);
1216 if (Y_UNLIKELY(!!Conn2_)) {
1217 //has pair concurrent conn, 'should stay only one'
1218 if (Conn2_.Get() == c) {
1219#ifdef DEBUG_STAT
1220 ++TDebugStat::Conn2Success;
1221#endif
1222 Conn2_.Swap(Conn_);
1223 }
1224 extraConn.Swap(Conn2_);
1225 }
1226 }
1227 if (!!extraConn) {
1228 extraConn->DetachRequest(); //prevent call OnError()
1229 extraConn->Close();
1230 }
1231 }
1232
1233 void THttpRequest::OnResponse(TAutoPtr<THttpParser>& rsp) {
1234 DBGOUT("THttpRequest::OnResponse()");

Callers 1

OnConnectMethod · 0.45

Calls 4

DetachRequestMethod · 0.80
GetMethod · 0.45
SwapMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected