Skip to content

Commit

Permalink
[core] Refax: removed the synconmsg property and its handling in the …
Browse files Browse the repository at this point in the history
…group (#2509)

The SRT_GFLAG_SYNCONMSG flag cannot be set on a group (not implemented).
The incoming connection request processing still retains the check for the flag to be unset.
  • Loading branch information
ethouris authored Nov 2, 2022
1 parent 53735e1 commit f7a024a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 36 deletions.
8 changes: 0 additions & 8 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,14 +1481,6 @@ int srt::CUDTUnited::groupConnect(CUDTGroup* pg, SRT_SOCKGROUPCONFIG* targets, i

int isn = g.currentSchedSequence();

// Don't synchronize ISN in case of synch on msgno. Every link
// may send their own payloads independently.
if (g.synconmsgno())
{
HLOGC(aclog.Debug, log << "groupConnect: NOT synchronizing sequence numbers: will sync on msgno");
isn = -1;
}

// Set it the groupconnect option, as all in-group sockets should have.
ns->core().m_config.iGroupConnect = 1;

Expand Down
37 changes: 12 additions & 25 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,12 +1286,6 @@ size_t srt::CUDT::fillHsExtGroup(uint32_t* pcmdspec)
SRT_GROUP_TYPE tp = m_parent->m_GroupOf->type();
uint32_t flags = 0;

// Note: if agent is a listener, and the current version supports
// both sync methods, this flag might have been changed according to
// the wish of the caller.
if (m_parent->m_GroupOf->synconmsgno())
flags |= SRT_GFLAG_SYNCONMSG;

// NOTE: this code remains as is for historical reasons.
// The initial implementation stated that the peer id be
// extracted so that it can be reported and possibly the
Expand Down Expand Up @@ -3391,29 +3385,22 @@ void srt::CUDT::synchronizeWithGroup(CUDTGroup* gp)
// with updateAfterSrtHandshake().
updateSrtSndSettings();

if (gp->synconmsgno())
// These are the values that are normally set initially by setters.
int32_t snd_isn = m_iSndLastAck, rcv_isn = m_iRcvLastAck;
if (!gp->applyGroupSequences(m_SocketID, (snd_isn), (rcv_isn)))
{
HLOGC(gmlog.Debug, log << CONID() << "synchronizeWithGroup: NOT synchronizing sequence numbers.");
HLOGC(gmlog.Debug,
log << CONID() << "synchronizeWithGroup: DERIVED ISN: RCV=%" << m_iRcvLastAck << " -> %" << rcv_isn
<< " (shift by " << CSeqNo::seqcmp(rcv_isn, m_iRcvLastAck) << ") SND=%" << m_iSndLastAck
<< " -> %" << snd_isn << " (shift by " << CSeqNo::seqcmp(snd_isn, m_iSndLastAck) << ")");
setInitialRcvSeq(rcv_isn);
setInitialSndSeq(snd_isn);
}
else
{
// These are the values that are normally set initially by setters.
int32_t snd_isn = m_iSndLastAck, rcv_isn = m_iRcvLastAck;
if (!gp->applyGroupSequences(m_SocketID, (snd_isn), (rcv_isn)))
{
HLOGC(gmlog.Debug,
log << CONID() << "synchronizeWithGroup: DERIVED ISN: RCV=%" << m_iRcvLastAck << " -> %" << rcv_isn
<< " (shift by " << CSeqNo::seqcmp(rcv_isn, m_iRcvLastAck) << ") SND=%" << m_iSndLastAck
<< " -> %" << snd_isn << " (shift by " << CSeqNo::seqcmp(snd_isn, m_iSndLastAck) << ")");
setInitialRcvSeq(rcv_isn);
setInitialSndSeq(snd_isn);
}
else
{
HLOGC(gmlog.Debug,
log << CONID() << "synchronizeWithGroup: DEFINED ISN: RCV=%" << m_iRcvLastAck << " SND=%"
<< m_iSndLastAck);
}
HLOGC(gmlog.Debug,
log << CONID() << "synchronizeWithGroup: DEFINED ISN: RCV=%" << m_iRcvLastAck << " SND=%"
<< m_iSndLastAck);
}
}
#endif
Expand Down
1 change: 0 additions & 1 deletion srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ CUDTGroup::CUDTGroup(SRT_GROUP_TYPE gtype)
: m_Global(CUDT::uglobal())
, m_GroupID(-1)
, m_PeerGroupID(-1)
, m_bSyncOnMsgNo(false)
, m_type(gtype)
, m_listener()
, m_iBusy()
Expand Down
2 changes: 0 additions & 2 deletions srtcore/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ class CUDTGroup
void erase(gli_t it);
};
GroupContainer m_Group;
const bool m_bSyncOnMsgNo; // It goes into a dedicated HS field. Could be true for balancing groups (not implemented).
SRT_GROUP_TYPE m_type;
CUDTSocket* m_listener; // A "group" can only have one listener.
srt::sync::atomic<int> m_iBusy;
Expand Down Expand Up @@ -813,7 +812,6 @@ class CUDTGroup
SRTU_PROPERTY_RW_CHAIN(CUDTGroup, int32_t, currentSchedSequence, m_iLastSchedSeqNo);
SRTU_PROPERTY_RRW(std::set<int>&, epollset, m_sPollID);
SRTU_PROPERTY_RW_CHAIN(CUDTGroup, int64_t, latency, m_iTsbPdDelay_us);
SRTU_PROPERTY_RO(bool, synconmsgno, m_bSyncOnMsgNo);
SRTU_PROPERTY_RO(bool, closing, m_bClosing);
};

Expand Down

0 comments on commit f7a024a

Please sign in to comment.