| 498 | /////////////////////////////////////////////////////////////////////////////// |
| 499 | |
| 500 | inline void WriteDataPacketHeader(char** buf, const EUdpCmd cmd, const TConnection* connection, |
| 501 | ui64 transferId, int packetId, int ackTos, ui8 netlibaColor, TOptionsVector* optVector) { |
| 502 | Y_ASSERT(IsDataCmd(cmd)); |
| 503 | |
| 504 | const bool ackTosIsCustom = ackTos != TOS_DEFAULT; |
| 505 | const bool netlibaColorIsCustom = netlibaColor != DEFAULT_NETLIBA_COLOR; |
| 506 | |
| 507 | if (ackTosIsCustom) { |
| 508 | optVector->PacketOpt.SetAckTos(ackTos); |
| 509 | } |
| 510 | if (netlibaColorIsCustom) { |
| 511 | optVector->PacketOpt.SetColor(netlibaColor); |
| 512 | } |
| 513 | WriteTransferPacketHeader(buf, cmd, connection, transferId, optVector); |
| 514 | Write(buf, packetId); |
| 515 | } |
| 516 | |
| 517 | inline bool ReadTransferHeader(const char** pktData, const char* pktEnd, ui64* transferId, const TOptionsVector& opt) { |
| 518 | *transferId = Read<ui32>(pktData); |
no test coverage detected