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

Function LoadResponseData

library/cpp/netliba/v12/udp_http.cpp:1288–1312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

GetResponseMethod · 0.70

Calls 8

ReadYArrFunction · 0.70
ReadShmFunction · 0.70
GetMethod · 0.45
ReadMethod · 0.45
GetSharedDataMethod · 0.45
HasFailedMethod · 0.45
clearMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected