Skip to content

Commit

Permalink
[core] rename syncWithSocket() to syncWithFirstSocket()
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 committed May 13, 2023
1 parent 02351e3 commit 4c68203
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 0 additions & 4 deletions docs/dev/low-level-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ CRcvQueue::worker_TryAsyncRend_OrStore
[IF Responder]
{
CUDT::makeMePeerOf
[LOCKS m_GroupLock]
CUDTGroup::syncWithSocket
CUDTGroup::find --> [LOCKED m_GroupLock]
}
debugGroup -- > [LOCKED m_GroupLock]
Expand Down Expand Up @@ -189,8 +187,6 @@ CRcvQueue::worker_ProcessConnectionRequest
[IF Responder]
{
CUDT::makeMePeerOf
[LOCKS m_GroupLock]
CUDTGroup::syncWithSocket
CUDTGroup::find --> [LOCKED m_GroupLock]
}
debugGroup -- > [LOCKED m_GroupLock]
Expand Down
6 changes: 3 additions & 3 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3151,10 +3151,10 @@ bool srt::CUDT::interpretGroup(const int32_t groupdata[], size_t data_size SRT_A
log << CONID() << "HS/RSP: group $" << pg->id() << " -> peer $" << pg->peerid()
<< ", copying characteristic data");

// The call to syncWithSocket is copying
// The call to syncWithFirstSocket is copying
// some interesting data from the first connected
// socket. This should be only done for the first successful connection.
pg->syncWithSocket(*this, HSD_INITIATOR);
pg->syncWithFirstSocket(*this, HSD_INITIATOR);
}
// Otherwise the peer id must be the same as existing, otherwise
// this group is considered already bound to another peer group.
Expand Down Expand Up @@ -3269,7 +3269,7 @@ SRTSOCKET srt::CUDT::makeMePeerOf(SRTSOCKET peergroup, SRT_GROUP_TYPE gtp, uint3

gp->set_peerid(peergroup);
gp->deriveSettings(this);
gp->syncWithSocket(s->core(), HSD_RESPONDER);
gp->syncWithFirstSocket(s->core(), HSD_RESPONDER);

// This can only happen on a listener (it's only called on a site that is
// HSD_RESPONDER), so it was a response for a groupwise connection.
Expand Down
3 changes: 1 addition & 2 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,7 @@ SRT_SOCKSTATUS CUDTGroup::getStatus()
return SRTS_BROKEN;
}

// [[using locked(m_GroupLock)]];
void CUDTGroup::syncWithSocket(const CUDT& core, const HandshakeSide side)
void CUDTGroup::syncWithFirstSocket(const CUDT& core, const HandshakeSide side)
{
if (side == HSD_RESPONDER)
{
Expand Down
2 changes: 1 addition & 1 deletion srtcore/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class CUDTGroup
/// @param ack The past-the-last-received ACK sequence number
void readyPackets(srt::CUDT* core, int32_t ack);

void syncWithSocket(const srt::CUDT& core, const HandshakeSide side);
void syncWithFirstSocket(const srt::CUDT& core, const HandshakeSide side);
int getGroupData(SRT_SOCKGROUPDATA* pdata, size_t* psize);
int getGroupData_LOCKED(SRT_SOCKGROUPDATA* pdata, size_t* psize);

Expand Down

0 comments on commit 4c68203

Please sign in to comment.