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

Function LoadRequestData

library/cpp/netliba/v12/udp_http.cpp:1240–1286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1238 }
1239
1240 static void LoadRequestData(TUdpHttpRequest* res) {
1241 if (!res)
1242 return;
1243 {
1244 TBlockChainIterator reqData(res->DataHolder->Data->GetChain());
1245 char pktType;
1246 reqData.Read(&pktType, 1);
1247
1248 TGUID reqId;
1249 reqData.Read(&reqId, sizeof(reqId));
1250 Y_ASSERT(reqId == res->ReqId);
1251
1252 TVector<char> flags;
1253 ReadYArr(&reqData, &flags);
1254 Y_ASSERT(!reqData.HasFailed());
1255
1256 if (flags.size() >= 8 + 2) {
1257 res->Colors.SetResponseDataTos((i16&)flags[0]);
1258 res->Colors.SetResponseAckTos((i16&)flags[2]);
1259 res->Colors.SetRequestDataTos((i16&)flags[4]);
1260 res->Colors.SetRequestAckTos((i16&)flags[6]);
1261 res->Colors.SetNetlibaRequestColor((ui8&)flags[8]);
1262 res->Colors.SetNetlibaResponseColor((ui8&)flags[9]);
1263 }
1264
1265 if (flags.size() >= 8 + 2 + 1) {
1266 if (flags[10] & HF_HP_QUEUE) {
1267 res->Colors.SetPriority(PP_HIGH);
1268 }
1269 }
1270
1271 ReadArr(&reqData, &res->Url);
1272
1273 if (pktType == PKT_REQUEST) {
1274 ReadYArr(&reqData, &res->Data);
1275 } else if (pktType == PKT_LOCAL_REQUEST) {
1276 ReadShm(res->DataHolder->Data->GetSharedData(), &res->Data);
1277 } else
1278 Y_ASSERT(0);
1279 if (reqData.HasFailed()) {
1280 Y_ASSERT(0 && "wrong format, memory corruption suspected");
1281 res->Url = "";
1282 res->Data.clear();
1283 }
1284 }
1285 res->DataHolder.Reset(nullptr);
1286 }
1287
1288 static void LoadResponseData(TUdpHttpResponse* res) {
1289 if (!res || res->DataHolder.Get() == nullptr)

Callers 1

GetRequestMethod · 0.70

Calls 15

SetResponseDataTosMethod · 0.80
SetResponseAckTosMethod · 0.80
SetRequestDataTosMethod · 0.80
SetRequestAckTosMethod · 0.80
SetPriorityMethod · 0.80
ReadYArrFunction · 0.70
ReadArrFunction · 0.70
ReadShmFunction · 0.70
ReadMethod · 0.45
HasFailedMethod · 0.45

Tested by

no test coverage detected