Skip to content

Commit 31294e3

Browse files
committed
[core] Removed unused CUDTGroup::m_Positions.
1 parent c639310 commit 31294e3

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

srtcore/group.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,44 +2330,6 @@ int CUDTGroup::recv(char* buf, int len, SRT_MSGCTRL& w_mc)
23302330
throw CUDTException(MJ_AGAIN, MN_RDAVAIL, 0);
23312331
}
23322332

2333-
// [[using locked(m_GroupLock)]]
2334-
CUDTGroup::ReadPos* CUDTGroup::checkPacketAhead()
2335-
{
2336-
typedef map<SRTSOCKET, ReadPos>::iterator pit_t;
2337-
ReadPos* out = 0;
2338-
2339-
// This map no longer maps only ahead links.
2340-
// Here are all links, and whether ahead, it's defined by the sequence.
2341-
for (pit_t i = m_Positions.begin(); i != m_Positions.end(); ++i)
2342-
{
2343-
// i->first: socket ID
2344-
// i->second: ReadPos { sequence, packet }
2345-
// We are not interested with the socket ID because we
2346-
// aren't going to read from it - we have the packet already.
2347-
ReadPos& a = i->second;
2348-
2349-
const int seqdiff = CSeqNo::seqcmp(a.mctrl.pktseq, m_RcvBaseSeqNo);
2350-
if (seqdiff == 1)
2351-
{
2352-
// The very next packet. Return it.
2353-
HLOGC(grlog.Debug,
2354-
log << "group/recv: Base %" << m_RcvBaseSeqNo << " ahead delivery POSSIBLE %" << a.mctrl.pktseq
2355-
<< " #" << a.mctrl.msgno << " from @" << i->first << ")");
2356-
out = &a;
2357-
}
2358-
else if (seqdiff < 1 && !a.packet.empty())
2359-
{
2360-
HLOGC(grlog.Debug,
2361-
log << "group/recv: @" << i->first << " dropping collected ahead %" << a.mctrl.pktseq << "#"
2362-
<< a.mctrl.msgno << " with base %" << m_RcvBaseSeqNo);
2363-
a.packet.clear();
2364-
}
2365-
// In case when it's >1, keep it in ahead
2366-
}
2367-
2368-
return out;
2369-
}
2370-
23712333
const char* CUDTGroup::StateStr(CUDTGroup::GroupState st)
23722334
{
23732335
static const char* const states[] = {"PENDING", "IDLE", "RUNNING", "BROKEN"};

srtcore/group.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ class CUDTGroup
194194
m_bConnected = false;
195195
}
196196

197-
// XXX BUGFIX
198-
m_Positions.erase(id);
199-
200197
return !empty;
201198
}
202199

@@ -646,20 +643,6 @@ class CUDTGroup
646643
time_point m_tsStartTime;
647644
time_point m_tsRcvPeerStartTime;
648645

649-
struct ReadPos
650-
{
651-
std::vector<char> packet;
652-
SRT_MSGCTRL mctrl;
653-
ReadPos(int32_t s)
654-
: mctrl(srt_msgctrl_default)
655-
{
656-
mctrl.pktseq = s;
657-
}
658-
};
659-
std::map<SRTSOCKET, ReadPos> m_Positions;
660-
661-
ReadPos* checkPacketAhead();
662-
663646
void recv_CollectAliveAndBroken(std::vector<srt::CUDTSocket*>& w_alive, std::set<srt::CUDTSocket*>& w_broken);
664647

665648
/// The function polls alive member sockets and retrieves a list of read-ready.

0 commit comments

Comments
 (0)