Skip to content

Commit

Permalink
[core] Removed group syncing when sending control ACK (#2935).
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored Apr 22, 2024
1 parent 4f925fb commit 973be58
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
39 changes: 0 additions & 39 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7818,40 +7818,6 @@ void srt::CUDT::releaseSynch()
leaveCS(m_RecvLock);
}


#if ENABLE_BONDING
void srt::CUDT::dropToGroupRecvBase()
{
int32_t group_recv_base = SRT_SEQNO_NONE;
if (m_parent->m_GroupOf)
{
// Check is first done before locking to avoid unnecessary
// mutex locking. The condition for this field is that it
// can be either never set, already reset, or ever set
// and possibly dangling. The re-check after lock eliminates
// the dangling case.
ScopedLock glock (uglobal().m_GlobControlLock);

// Note that getRcvBaseSeqNo() will lock m_GroupOf->m_GroupLock,
// but this is an intended order.
if (m_parent->m_GroupOf)
group_recv_base = m_parent->m_GroupOf->getRcvBaseSeqNo();
}
if (group_recv_base == SRT_SEQNO_NONE)
return;

ScopedLock lck(m_RcvBufferLock);
const int cnt = rcvDropTooLateUpTo(CSeqNo::incseq(group_recv_base), DROP_DISCARD);
if (cnt > 0)
{
HLOGC(grlog.Debug,
log << CONID() << "dropToGroupRecvBase: dropped " << cnt << " packets before ACK: group_recv_base="
<< group_recv_base << " m_iRcvLastAck=" << m_iRcvLastAck
<< " m_iRcvCurrSeqNo=" << m_iRcvCurrSeqNo << " m_bTsbPd=" << m_bTsbPd);
}
}
#endif

namespace srt {
#if ENABLE_HEAVY_LOGGING
static void DebugAck(string hdr, int prev, int ack)
Expand Down Expand Up @@ -8068,11 +8034,6 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size)
#endif
string reason; // just for "a reason" of giving particular % for ACK

#if ENABLE_BONDING
// TODO: The group drops other members upon reading, maybe no longer needed here?
dropToGroupRecvBase();
#endif

// The TSBPD thread may change the first lost sequence record (TLPKTDROP).
// To avoid it the m_RcvBufferLock has to be acquired.
UniqueLock bufflock(m_RcvBufferLock);
Expand Down
6 changes: 0 additions & 6 deletions srtcore/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,12 +1156,6 @@ class CUDT
static void addLossRecord(std::vector<int32_t>& lossrecord, int32_t lo, int32_t hi);
int32_t bake(const sockaddr_any& addr, int32_t previous_cookie = 0, int correction = 0);

#if ENABLE_BONDING
/// @brief Drop packets in the recv buffer behind group_recv_base.
/// Updates m_iRcvLastSkipAck if it's behind group_recv_base.
void dropToGroupRecvBase();
#endif

void processKeepalive(const CPacket& ctrlpkt, const time_point& tsArrival);


Expand Down

0 comments on commit 973be58

Please sign in to comment.