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

Method SendRequestImpl

library/cpp/netliba/v6/udp_http.cpp:827–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825
826 public:
827 void SendRequestImpl(const TUdpAddress& addr, const TString& url, TVector<char>* data, const TGUID& reqId,
828 TWaitResponse* wr, TRequesterUserQueues* userQueues) {
829 if (data && data->size() > MAX_PACKET_SIZE) {
830 Y_ABORT_UNLESS(0, "data size is too large");
831 }
832 //printf("SendRequest(%s)\n", url.c_str());
833 if (wr)
834 wr->SetReqId(reqId);
835
836 TAutoPtr<TRopeDataPacket> ms = new TRopeDataPacket;
837 if (data && data->ysize() > MIN_SHARED_MEM_PACKET && IsLocalFast(addr)) {
838 int dataSize = data->ysize();
839 TIntrusivePtr<TSharedMemory> shm = new TSharedMemory;
840 if (shm->Create(dataSize)) {
841 ms->Write((char)PKT_LOCAL_REQUEST);
842 ms->WriteStroka(url);
843 memcpy(shm->GetPtr(), &(*data)[0], dataSize);
844 TVector<char> empty;
845 data->swap(empty);
846 ms->AttachSharedData(shm);
847 }
848 }
849 if (ms->GetSharedData() == nullptr) {
850 ms->Write((char)PKT_REQUEST);
851 ms->WriteStroka(url);
852 ms->WriteDestructive(data);
853 }
854
855 SendReqList.Enqueue(new TSendRequest(addr, &ms, reqId, wr, userQueues));
856 Host->CancelWait();
857 }
858
859 void SendRequest(const TUdpAddress& addr, const TString& url, TVector<char>* data, const TGUID& reqId) override {
860 SendRequestImpl(addr, url, data, reqId, nullptr, UserQueues.Get());

Callers 1

SendRequestMethod · 0.45

Calls 14

IsLocalFastFunction · 0.85
sizeMethod · 0.45
SetReqIdMethod · 0.45
ysizeMethod · 0.45
CreateMethod · 0.45
WriteMethod · 0.45
WriteStrokaMethod · 0.45
GetPtrMethod · 0.45
swapMethod · 0.45
AttachSharedDataMethod · 0.45
GetSharedDataMethod · 0.45
WriteDestructiveMethod · 0.45

Tested by

no test coverage detected