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

Method FinishRequest

library/cpp/netliba/v6/udp_http.cpp:336–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334 bool ReportSendRequestAcc;
335
336 void FinishRequest(TOutRequestHash::iterator i, TUdpHttpResponse::EResult ok, TAutoPtr<TRequest> data, const char* error = nullptr) {
337 TOutRequestState& s = i->second;
338 TUdpHttpResponse* res = new TUdpHttpResponse;
339 res->DataHolder = data;
340 res->ReqId = i->first;
341 res->PeerAddress = s.Address;
342 res->Ok = ok;
343 if (ok == TUdpHttpResponse::FAILED)
344 res->Error = error ? error : "request failed";
345 else if (ok == TUdpHttpResponse::CANCELED)
346 res->Error = error ? error : "request cancelled";
347 TSyncRequests::iterator k = SyncRequests.find(res->ReqId);
348 if (k != SyncRequests.end()) {
349 TIntrusivePtr<TWaitResponse>& wr = k->second;
350 wr->SetResponse(res);
351 SyncRequests.erase(k);
352 } else {
353 s.UserQueues->AddResponse(res);
354 }
355
356 OutRequests.erase(i);
357 }
358 int SendWithHighPriority(const TUdpAddress& addr, TAutoPtr<TRopeDataPacket> data) {
359 ui32 crc32 = CalcChecksum(data->GetChain());
360 return Host->Send(addr, data.Release(), crc32, nullptr, PP_HIGH);

Callers

nothing calls this directly

Calls 5

findMethod · 0.45
endMethod · 0.45
SetResponseMethod · 0.45
eraseMethod · 0.45
AddResponseMethod · 0.45

Tested by

no test coverage detected