Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7807,6 +7807,9 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
dropToGroupRecvBase();
#endif

/* tsbpd thread may also call ackData when skipping packet so protect code */
Comment thread
gou4shi1 marked this conversation as resolved.
Outdated
UniqueLock bufflock(m_RcvBufferLock);

{
// If there is no loss, the ACK is the current largest sequence number plus 1;
// Otherwise it is the smallest sequence number in the receiver loss list.
Expand Down Expand Up @@ -7835,18 +7838,16 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
// to save time on buffer processing and bandwidth/AS measurement, a lite ACK only feeds back an ACK number
if (size == SEND_LITE_ACK)
{
bufflock.unlock();
ctrlpkt.pack(UMSG_ACK, NULL, &ack, size);
ctrlpkt.m_iID = m_PeerID;
nbsent = m_pSndQueue->sendto(m_PeerAddr, ctrlpkt);
DebugAck(CONID() + "sendCtrl(lite): ", local_prevack, ack);
return nbsent;
}

// There are new received packets to acknowledge, update related information.
/* tsbpd thread may also call ackData when skipping packet so protect code */
UniqueLock bufflock(m_RcvBufferLock);

// IF ack %> m_iRcvLastAck
// There are new received packets to acknowledge, update related information.
if (CSeqNo::seqcmp(ack, m_iRcvLastAck) > 0)
{
ackDataUpTo(ack);
Expand Down