Skip to content

Commit 4270a11

Browse files
[core] Fixed a data race on listener's config.
Co-authored-by: yomnes0 <[email protected]>
1 parent bcc2f21 commit 4270a11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

srtcore/api.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ int srt::CUDTUnited::newConnection(const SRTSOCKET listen,
537537

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

0 commit comments

Comments
 (0)