diff --git a/srtcore/core.cpp b/srtcore/core.cpp index 8c696cd4e..29fe71fd0 100644 --- a/srtcore/core.cpp +++ b/srtcore/core.cpp @@ -7663,7 +7663,7 @@ void srt::CUDT::releaseSynch() } // [[using locked(m_RcvBufferLock)]]; -int32_t srt::CUDT::ackDataUpTo(int32_t ack) +void srt::CUDT::ackDataUpTo(int32_t ack) { const int acksize SRT_ATR_UNUSED = CSeqNo::seqoff(m_iRcvLastSkipAck, ack); @@ -7673,16 +7673,7 @@ int32_t srt::CUDT::ackDataUpTo(int32_t ack) m_iRcvLastAck = ack; m_iRcvLastSkipAck = ack; -#if ENABLE_NEW_RCVBUFFER - const std::pair range = m_pRcvBuffer->getAvailablePacketsRange(); - // Some packets acknowledged are not available in the buffer. - if (CSeqNo::seqcmp(range.second, ack) < 0) - { - LOGC(xtlog.Error, log << "IPE: Acknowledged seqno %" << ack << " outruns the RCV buffer state %" << range.first - << " - %" << range.second); - } - return CSeqNo::decseq(range.second); -#else +#if !ENABLE_NEW_RCVBUFFER // NOTE: This is new towards UDT and prevents spurious // wakeup of select/epoll functions when no new packets // were signed off for extraction. @@ -7690,7 +7681,6 @@ int32_t srt::CUDT::ackDataUpTo(int32_t ack) { m_pRcvBuffer->ackData(acksize); } - return ack; #endif } @@ -7930,7 +7920,16 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size) // IF ack %> m_iRcvLastAck if (CSeqNo::seqcmp(ack, m_iRcvLastAck) > 0) { - const int32_t group_read_seq SRT_ATR_UNUSED = ackDataUpTo(ack); + ackDataUpTo(ack); + +#if ENABLE_EXPERIMENTAL_BONDING +#if ENABLE_NEW_RCVBUFFER + const int32_t group_read_seq = m_pRcvBuffer->getFirstReadablePacketInfo(steady_clock::now()).seqno; +#else + const int32_t group_read_seq = CSeqNo::decseq(ack); +#endif +#endif + InvertedLock un_bufflock (m_RcvBufferLock); #if ENABLE_EXPERIMENTAL_BONDING @@ -8015,7 +8014,7 @@ int srt::CUDT::sendCtrlAck(CPacket& ctrlpkt, int size) } } #if ENABLE_EXPERIMENTAL_BONDING - if (m_parent->m_GroupOf) + if (group_read_seq != SRT_SEQNO_NONE && m_parent->m_GroupOf) { // See above explanation for double-checking ScopedLock glock (uglobal().m_GlobControlLock); diff --git a/srtcore/core.h b/srtcore/core.h index 62027b026..4f87ad181 100644 --- a/srtcore/core.h +++ b/srtcore/core.h @@ -1075,8 +1075,7 @@ class CUDT /// @brief Acknowledge reading position up to the @p seq. /// Updates m_iRcvLastAck and m_iRcvLastSkipAck to @p seq. /// @param seq first unacknowledged packet sequence number. - /// @return - int32_t ackDataUpTo(int32_t seq); + void ackDataUpTo(int32_t seq); void handleKeepalive(const char* data, size_t lenghth);