From ac34b1c8d5661c03fb10e187090b29f3f4906114 Mon Sep 17 00:00:00 2001 From: Maxim Sharabayko Date: Tue, 18 Jul 2023 12:43:56 +0200 Subject: [PATCH] [core] Removed unused CUDTGroup::m_Positions. --- srtcore/group.cpp | 38 -------------------------------------- srtcore/group.h | 17 ----------------- 2 files changed, 55 deletions(-) diff --git a/srtcore/group.cpp b/srtcore/group.cpp index 0855196a36..fedfdcf765 100644 --- a/srtcore/group.cpp +++ b/srtcore/group.cpp @@ -2330,44 +2330,6 @@ int CUDTGroup::recv(char* buf, int len, SRT_MSGCTRL& w_mc) throw CUDTException(MJ_AGAIN, MN_RDAVAIL, 0); } -// [[using locked(m_GroupLock)]] -CUDTGroup::ReadPos* CUDTGroup::checkPacketAhead() -{ - typedef map::iterator pit_t; - ReadPos* out = 0; - - // This map no longer maps only ahead links. - // Here are all links, and whether ahead, it's defined by the sequence. - for (pit_t i = m_Positions.begin(); i != m_Positions.end(); ++i) - { - // i->first: socket ID - // i->second: ReadPos { sequence, packet } - // We are not interested with the socket ID because we - // aren't going to read from it - we have the packet already. - ReadPos& a = i->second; - - const int seqdiff = CSeqNo::seqcmp(a.mctrl.pktseq, m_RcvBaseSeqNo); - if (seqdiff == 1) - { - // The very next packet. Return it. - HLOGC(grlog.Debug, - log << "group/recv: Base %" << m_RcvBaseSeqNo << " ahead delivery POSSIBLE %" << a.mctrl.pktseq - << " #" << a.mctrl.msgno << " from @" << i->first << ")"); - out = &a; - } - else if (seqdiff < 1 && !a.packet.empty()) - { - HLOGC(grlog.Debug, - log << "group/recv: @" << i->first << " dropping collected ahead %" << a.mctrl.pktseq << "#" - << a.mctrl.msgno << " with base %" << m_RcvBaseSeqNo); - a.packet.clear(); - } - // In case when it's >1, keep it in ahead - } - - return out; -} - const char* CUDTGroup::StateStr(CUDTGroup::GroupState st) { static const char* const states[] = {"PENDING", "IDLE", "RUNNING", "BROKEN"}; diff --git a/srtcore/group.h b/srtcore/group.h index 09e0722671..c2863b44e7 100644 --- a/srtcore/group.h +++ b/srtcore/group.h @@ -194,9 +194,6 @@ class CUDTGroup m_bConnected = false; } - // XXX BUGFIX - m_Positions.erase(id); - return !empty; } @@ -646,20 +643,6 @@ class CUDTGroup time_point m_tsStartTime; time_point m_tsRcvPeerStartTime; - struct ReadPos - { - std::vector packet; - SRT_MSGCTRL mctrl; - ReadPos(int32_t s) - : mctrl(srt_msgctrl_default) - { - mctrl.pktseq = s; - } - }; - std::map m_Positions; - - ReadPos* checkPacketAhead(); - void recv_CollectAliveAndBroken(std::vector& w_alive, std::set& w_broken); /// The function polls alive member sockets and retrieves a list of read-ready.