| 1286 | } |
| 1287 | |
| 1288 | static void LoadResponseData(TUdpHttpResponse* res) { |
| 1289 | if (!res || res->DataHolder.Get() == nullptr) |
| 1290 | return; |
| 1291 | { |
| 1292 | TBlockChainIterator reqData(res->DataHolder->Data->GetChain()); |
| 1293 | char pktType; |
| 1294 | reqData.Read(&pktType, 1); |
| 1295 | TGUID guid; |
| 1296 | reqData.Read(&guid, sizeof(guid)); |
| 1297 | Y_ASSERT(res->ReqId == guid); |
| 1298 | if (pktType == PKT_RESPONSE) { |
| 1299 | ReadYArr(&reqData, &res->Data); |
| 1300 | } else if (pktType == PKT_LOCAL_RESPONSE) { |
| 1301 | ReadShm(res->DataHolder->Data->GetSharedData(), &res->Data); |
| 1302 | } else |
| 1303 | Y_ASSERT(0); |
| 1304 | if (reqData.HasFailed()) { |
| 1305 | Y_ASSERT(0 && "wrong format, memory corruption suspected"); |
| 1306 | res->Ok = TUdpHttpResponse::FAILED; |
| 1307 | res->Data.clear(); |
| 1308 | res->Error = "wrong response format"; |
| 1309 | } |
| 1310 | } |
| 1311 | res->DataHolder.Reset(nullptr); |
| 1312 | } |
| 1313 | |
| 1314 | ////////////////////////////////////////////////////////////////////////// |
| 1315 | // IRequestOps::TWaitResponse |
no test coverage detected