Skip to content

Commit

Permalink
Fixed new ACK sending (version check)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored Mar 29, 2021
1 parent 50dcce2 commit 41cb53a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7706,24 +7706,24 @@ int CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
data[ACKD_XMRATE] = data[ACKD_BANDWIDTH] * m_iMaxSRTPayloadSize; // bytes/sec
ctrlsz = ACKD_FIELD_SIZE * ACKD_TOTAL_SIZE_VER102;
}
else if (m_uPeerSrtVersion >= SrtVersion(1, 0, 3))
{
// Normal, currently expected version.
data[ACKD_RCVRATE] = rcvRate; // bytes/sec
ctrlsz = ACKD_FIELD_SIZE * ACKD_TOTAL_SIZE_VER143;
}
else if (m_uPeerSrtVersion >= SrtVersion(1, 4, 3) && m_bPeerTLPktDrop && m_bPeerTsbPd)
{
enterCS(m_StatsLock);
const int64_t dropTotal = m_stats.rcvDropTotal;
leaveCS(m_StatsLock);
// Normal, currently expected version.
data[ACKD_RCVRATE] = rcvRate; // bytes/sec

// TODO: only include this field if dropTotal was updated
data[ACKD_RCVDROP_TOTAL] = (unsigned)dropTotal; // truncation is allowed and must be handled by ACK-receiver
ctrlsz = ACKD_FIELD_SIZE * ACKD_TOTAL_SIZE_VER143;
}
else if (m_uPeerSrtVersion >= SrtVersion(1, 0, 3))
{
// Normal, currently expected version.
data[ACKD_RCVRATE] = rcvRate; // bytes/sec
ctrlsz = ACKD_FIELD_SIZE * ACKD_TOTAL_SIZE_VER101;
}
// ELSE: leave the buffer with ...UDTBASE size.

ctrlpkt.pack(UMSG_ACK, &m_iAckSeqNo, data, ctrlsz);
Expand Down

0 comments on commit 41cb53a

Please sign in to comment.