| 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); |
nothing calls this directly
no test coverage detected