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

Method SendRequest

library/cpp/neh/netliba_udp_http.cpp:283–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 }
282
283 void SendRequest(const TUdpAddress& addr, const TString& url, const TString& data, const TGUID& reqId) override {
284 Y_ABORT_UNLESS(
285 data.size() < MAX_PACKET_SIZE,
286 "data size is too large; data.size()=%" PRISZT ", MAX_PACKET_SIZE=%" PRISZT,
287 data.size(), MAX_PACKET_SIZE);
288
289 TAutoPtr<TRopeDataPacket> ms = new TRopeDataPacket;
290 if (data.size() > MIN_SHARED_MEM_PACKET && IsLocal(addr)) {
291 TIntrusivePtr<TSharedMemory> shm = new TSharedMemory;
292 if (shm->Create(data.size())) {
293 ms->Write((char)PKT_LOCAL_REQUEST);
294 ms->WriteStroka(url);
295 memcpy(shm->GetPtr(), data.begin(), data.size());
296 ms->AttachSharedData(shm);
297 }
298 }
299 if (ms->GetSharedData() == nullptr) {
300 ms->Write((char)PKT_REQUEST);
301 ms->WriteStroka(url);
302 struct TStrokaStorage: public TThrRefBase, public TString {
303 TStrokaStorage(const TString& s)
304 : TString(s)
305 {
306 }
307 };
308 TStrokaStorage* ss = new TStrokaStorage(data);
309 ms->Write((int)ss->size());
310 ms->AddBlock(ss, ss->begin(), ss->size());
311 }
312
313 SendReqList_.Enqueue(new TSendRequest(addr, &ms, reqId, EventCollector_));
314 Host_->CancelWait();
315 }
316
317 void CancelRequest(const TGUID& reqId) override {
318 CancelReqList_.Enqueue(reqId);

Callers

nothing calls this directly

Calls 12

IsLocalFunction · 0.70
sizeMethod · 0.45
CreateMethod · 0.45
WriteMethod · 0.45
WriteStrokaMethod · 0.45
GetPtrMethod · 0.45
beginMethod · 0.45
AttachSharedDataMethod · 0.45
GetSharedDataMethod · 0.45
AddBlockMethod · 0.45
EnqueueMethod · 0.45
CancelWaitMethod · 0.45

Tested by

no test coverage detected