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

Method FinishRequest

library/cpp/netliba/v12/udp_http.cpp:355–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 bool ReportSendRequestAcc;
354
355 void FinishRequest(TOutRequestHash::iterator i, TUdpHttpResponse::EResult ok, TAutoPtr<TUdpRequest> data, const char* error = nullptr) {
356 TOutRequestState& s = i->second;
357 TUdpHttpResponse* res = new TUdpHttpResponse;
358 res->DataHolder = data;
359 res->ReqId = i->first;
360 res->PeerAddress = s.Connection->GetAddress();
361 res->Ok = ok;
362 if (ok == TUdpHttpResponse::FAILED)
363 res->Error = error ? error : "request failed";
364 else if (ok == TUdpHttpResponse::CANCELED)
365 res->Error = error ? error : "request cancelled";
366 const auto k = SyncRequests.find(res->ReqId);
367 if (k != SyncRequests.end()) {
368 TIntrusivePtr<TWaitResponse>& wr = k->second;
369 wr->SetResponse(res);
370 SyncRequests.erase(k);
371 } else {
372 s.UserQueues->AddResponse(res);
373 }
374
375 OutRequests.erase(i);
376 }
377 TTransfer SendWithSystemPriority(const TIntrusivePtr<IConnection>& connection, TAutoPtr<TRopeDataPacket> data, const TTos& tos, const ui8 netlibaColor) {
378 return Host->Send(connection, data.Release(), PP_SYSTEM, tos, netlibaColor);
379 }

Callers

nothing calls this directly

Calls 6

GetAddressMethod · 0.80
findMethod · 0.45
endMethod · 0.45
SetResponseMethod · 0.45
eraseMethod · 0.45
AddResponseMethod · 0.45

Tested by

no test coverage detected