Skip to content

Commit

Permalink
[core] Fixed a data race on listener's config.
Browse files Browse the repository at this point in the history
Co-authored-by: yomnes0 <yomnes@haivision.com>
  • Loading branch information
maxsharabayko and yomnes0 committed Aug 7, 2024
1 parent bcc2f21 commit 4270a11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,

try
{
// Protect the config of the listener socket from a data race.
ScopedLock lck(ls->core().m_ConnectionLock);
ns = new CUDTSocket(*ls);
// No need to check the peer, this is the address from which the request has come.
ns->m_PeerAddr = peer;
Expand Down

0 comments on commit 4270a11

Please sign in to comment.