Skip to content

Commit

Permalink
[core] Fixed group synchronization of accepted sockets.
Browse files Browse the repository at this point in the history
Fixes #2941.
  • Loading branch information
maxsharabayko committed Apr 26, 2024
1 parent bb24f25 commit 5fd96c3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5800,6 +5800,16 @@ void srt::CUDT::acceptAndRespond(const sockaddr_any& agent, const sockaddr_any&
throw CUDTException(MJ_SETUP, MN_REJECTED, 0);
}

#if ENABLE_BONDING
// The socket and the group are only linked to each other after interpretSrtHandshake(..) has been called.
// Keep the group alive for the lifetime of this function,
// and do it BEFORE acquiring m_ConnectionLock to avoid
// lock inversion.
// This will check if a socket belongs to a group and if so
// it will remember this group and keep it alive here.
CUDTUnited::GroupKeeper group_keeper(uglobal(), m_parent);
#endif

if (!prepareBuffers(NULL))
{
HLOGC(cnlog.Debug,
Expand Down

0 comments on commit 5fd96c3

Please sign in to comment.