Skip to content

Commit

Permalink
[core] Removed unused CUDTGroup::m_Positions.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Jul 18, 2023
1 parent 00fd3f5 commit ac34b1c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
38 changes: 0 additions & 38 deletions srtcore/group.cpp
Expand Up @@ -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<SRTSOCKET, ReadPos>::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"};
Expand Down
17 changes: 0 additions & 17 deletions srtcore/group.h
Expand Up @@ -194,9 +194,6 @@ class CUDTGroup
m_bConnected = false;
}

// XXX BUGFIX
m_Positions.erase(id);

return !empty;
}

Expand Down Expand Up @@ -646,20 +643,6 @@ class CUDTGroup
time_point m_tsStartTime;
time_point m_tsRcvPeerStartTime;

struct ReadPos
{
std::vector<char> packet;
SRT_MSGCTRL mctrl;
ReadPos(int32_t s)
: mctrl(srt_msgctrl_default)
{
mctrl.pktseq = s;
}
};
std::map<SRTSOCKET, ReadPos> m_Positions;

ReadPos* checkPacketAhead();

void recv_CollectAliveAndBroken(std::vector<srt::CUDTSocket*>& w_alive, std::set<srt::CUDTSocket*>& w_broken);

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

0 comments on commit ac34b1c

Please sign in to comment.