| 1137 | } |
| 1138 | |
| 1139 | static void LoadResponseData(TUdpHttpResponse* res) { |
| 1140 | if (!res || res->DataHolder.Get() == nullptr) |
| 1141 | return; |
| 1142 | { |
| 1143 | TBlockChainIterator reqData(res->DataHolder->Data->GetChain()); |
| 1144 | char pktType; |
| 1145 | reqData.Read(&pktType, 1); |
| 1146 | TGUID guid; |
| 1147 | reqData.Read(&guid, sizeof(guid)); |
| 1148 | Y_ASSERT(res->ReqId == guid); |
| 1149 | if (pktType == PKT_RESPONSE) { |
| 1150 | ReadYArr(&reqData, &res->Data); |
| 1151 | } else if (pktType == PKT_LOCAL_RESPONSE) { |
| 1152 | ReadShm(res->DataHolder->Data->GetSharedData(), &res->Data); |
| 1153 | } else |
| 1154 | Y_ASSERT(0); |
| 1155 | if (reqData.HasFailed()) { |
| 1156 | Y_ASSERT(0 && "wrong format, memory corruption suspected"); |
| 1157 | res->Ok = TUdpHttpResponse::FAILED; |
| 1158 | res->Data.clear(); |
| 1159 | res->Error = "wrong response format"; |
| 1160 | } |
| 1161 | } |
| 1162 | res->DataHolder.Reset(nullptr); |
| 1163 | } |
| 1164 | |
| 1165 | ////////////////////////////////////////////////////////////////////////// |
| 1166 | // IRequestOps::TWaitResponse |
no test coverage detected