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

Method ParseDataPacketHeader

library/cpp/netliba/v12/udp_host.cpp:939–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937 }
938
939 bool TUdpHost::ParseDataPacketHeader(const char* header, const char* headerEnd, TTransfer* transfer, int* packetId) {
940 EUdpCmd cmd;
941 ui8 originalCmd;
942 if (ReadBasicPacketHeader(&header, headerEnd, &cmd, &originalCmd)) {
943 TGUID connectionGuid, thatSideGuid;
944 TConnectionSettings settings;
945 TOptionsVector opt;
946 if (IsDataCmd(cmd) && ReadInConnectionPacketHeaderTail(&header, headerEnd, originalCmd, &connectionGuid, &thatSideGuid, &settings, &opt)) {
947 ui64 transferId;
948 if (ReadTransferHeader(&header, headerEnd, &transferId, opt)) {
949 int ackTos;
950 ui8 netlibaColor;
951 if (ReadPacketHeaderTail(&header, headerEnd, packetId, &ackTos, &netlibaColor, opt)) {
952 // hash map find only if everything else is OK
953 if (const TIntrusivePtr<IConnection>* connection = Connections.FindPtr(connectionGuid)) {
954 transfer->Connection = *connection;
955 transfer->Id = transferId;
956 return true;
957 }
958 }
959 }
960 }
961 }
962 return false;
963 }
964
965 void TUdpHost::FailTransfersForConnection(TConnection* connection) {
966 for (TSendTransfers::TIdIterator i = connection->GetSendQueue().Begin(); i != connection->GetSendQueue().End();) {

Callers

nothing calls this directly

Calls 6

ReadBasicPacketHeaderFunction · 0.85
IsDataCmdFunction · 0.85
ReadTransferHeaderFunction · 0.85
ReadPacketHeaderTailFunction · 0.85
FindPtrMethod · 0.45

Tested by

no test coverage detected