From 77911b166f7772eb1dd692a5c0987a2acb04dcac Mon Sep 17 00:00:00 2001 From: Sektor van Skijlen Date: Thu, 21 May 2026 11:43:56 +0200 Subject: [PATCH 1/6] Trial changes for SRT package --- scripts/win-installer/build-win-installer.ps1 | 41 +++++++++++++++---- srtcore/queue.cpp | 9 +++- srtcore/queue.h | 2 +- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/scripts/win-installer/build-win-installer.ps1 b/scripts/win-installer/build-win-installer.ps1 index f486eac0b..44ebfb8cd 100644 --- a/scripts/win-installer/build-win-installer.ps1 +++ b/scripts/win-installer/build-win-installer.ps1 @@ -37,7 +37,8 @@ param( [string]$Version = "", [switch]$NoBuild = $false, - [switch]$NoPause = $false + [switch]$NoPause = $false, + [string]$OnlyPlatform = "" ) Write-Output "Building the SRT static libraries installer for Windows" @@ -113,6 +114,9 @@ function ssl-lib($pf, $conf, $lib) { return "$(ssl-libdir $pf $conf)\$($LIBFILE. Write-Output "Searching OpenSSL libraries ..." $Missing = 0 foreach ($Platform in $SSL.Keys) { + if ($OnlyPlatform -ne "" -and $Platform -ne $OnlyPlatform) { + continue + } if (-not (Test-Path -PathType Container $(ssl-include $Platform))) { Write-Output "**** Missing $(ssl-include $Platform)" $Missing = $Missing + 1 @@ -173,7 +177,13 @@ Write-Output "NSIS: $NSIS" #----------------------------------------------------------------------------- if (-not $NoBuild) { + Write-Output "BUILD ENABLED - configuring build; LIMIT TO PLATFORM: $OnlyPlatform" foreach ($Platform in $ARCH.Keys) { + if ($OnlyPlatform -ne "" -and $Platform -ne $OnlyPlatform) { + Write-Output "Skipping platform $Platform." + continue + } + Write-Output "Preparing platform $Platform." # Build directory. Cleanup to force a fresh cmake config. $BuildDir = "$TmpDir\build.$Platform" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $BuildDir @@ -181,11 +191,15 @@ if (-not $NoBuild) { # Run CMake. Write-Output "Configuring build for platform $Platform ..." - & $CMake -S $RepoDir -B $BuildDir -A $Platform ` - -DENABLE_STDCXX_SYNC=ON ` - -DOPENSSL_INCLUDE_DIR="$(ssl-include $Platform)" ` - -DOPENSSL_ROOT_DIR="$(ssl-libdir $Platform Release)" - + $params = @("-S", "$RepoDir", + "-B", "$BuildDir", + "-A", "$Platform", + "-DENABLE_STDCXX_SYNC=ON", + "-DOPENSSL_INCLUDE_DIR=$(ssl-include $Platform)", + "-DOPENSSL_ROOT_DIR=$(ssl-libdir $Platform Release)" + ) + Write-Output "Running cmake $params" + & $CMake $params # Patch version string in version.h Get-Content "$BuildDir\version.h" | ForEach-Object { @@ -197,7 +211,17 @@ if (-not $NoBuild) { # Compile SRT. Write-Output "Building for platform $Platform ..." foreach ($Conf in $LIBDIR.Keys) { - & $MSBuild "$BuildDir\SRT.sln" /nologo /maxcpucount /property:Configuration=$Conf /property:Platform=$Platform /target:srt_static + # The solution file format depends on the CMake version. + # Try new XML solution file format first. + $SolFile = "$BuildDir\SRT.slnx" + if (-not (Test-Path $SolFile)) { + # Try legacy solution file format. + $SolFile = "$BuildDir\SRT.sln" + } + if (-not (Test-Path $SolFile)) { + Exit-Script "Solution file $BuildDir\SRT.sln[x] not found, check CMake output" + } + & $MSBuild $SolFile /nologo /maxcpucount /property:Configuration=$Conf /property:Platform=$Platform /target:srt_static } } } @@ -207,6 +231,9 @@ Write-Output "Checking compiled libraries ..." $Missing = 0 foreach ($Conf in $LIBDIR.Keys) { foreach ($Platform in $SSL.Keys) { + if ($OnlyPlatform -ne "" -and $Platform -ne $OnlyPlatform) { + continue + } $Path = "$TmpDir\build.$Platform\$Conf\srt_static.lib" if (-not (Test-Path $Path)) { Write-Output "**** Missing $Path" diff --git a/srtcore/queue.cpp b/srtcore/queue.cpp index 4ced92d6f..5331a1a72 100644 --- a/srtcore/queue.cpp +++ b/srtcore/queue.cpp @@ -1251,7 +1251,7 @@ void srt::CRcvQueue::init(int qsize, size_t payload, int version, int hsize, CCh } } -void* srt::CRcvQueue::worker(void* param) +void* srt::CRcvQueue::worker(void* param) ATR_NOEXCEPT { CRcvQueue* self = (CRcvQueue*)param; sockaddr_any sa(self->getIPversion()); @@ -1328,7 +1328,12 @@ void* srt::CRcvQueue::worker(void* param) << "CChannel reported ERROR DURING TRANSMISSION - IPE. INTERRUPTING worker anyway."); } cst = CONN_REJECT; - break; + + // DO NOT interrupt though - the worker thread must run until all + // sockets are removed from the multiplexer. Alternatively you can forcefully + // remove all sockets from the receive U list. + continue; + // break; } // OTHERWISE: this is an "AGAIN" situation. No data was read, but the process should continue. diff --git a/srtcore/queue.h b/srtcore/queue.h index 930ddd92a..d3473aae6 100644 --- a/srtcore/queue.h +++ b/srtcore/queue.h @@ -519,7 +519,7 @@ class CRcvQueue void stop(); private: - static void* worker(void* param); + static void* worker(void* param) ATR_NOEXCEPT; sync::CThread m_WorkerThread; // Subroutines of worker EReadStatus worker_RetrieveUnit(int32_t& id, CUnit*& unit, sockaddr_any& sa); From b7a94bfcd829c9e1f481ed644e3542ae702d6f8b Mon Sep 17 00:00:00 2001 From: Sektor van Skijlen Date: Fri, 22 May 2026 10:03:23 +0200 Subject: [PATCH 2/6] [core] Added death-garbage-aware cleanup --- srtcore/api.cpp | 106 +++++++++++++++++++++++++++++----------------- srtcore/queue.cpp | 13 ++++-- srtcore/queue.h | 2 + 3 files changed, 79 insertions(+), 42 deletions(-) diff --git a/srtcore/api.cpp b/srtcore/api.cpp index cc3bd49b7..5f1bf3cc9 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -2896,54 +2896,84 @@ void srt::CUDTUnited::checkBrokenSockets() leaveCS(ls->second->m_AcceptLock); } - for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) - { - CUDTSocket* ps = j->second; - - // NOTE: There is still a hypothetical risk here that ps - // was made busy while the socket was already moved to m_ClosedSocket, - // if the socket was acquired through CUDTUnited::acquireSocket (that is, - // busy flag acquisition was done through the CUDTSocket* pointer rather - // than through the numeric ID). Therefore this way of busy acquisition - // should be done only if at the moment of acquisition there are certainly - // other conditions applying on the socket that prevent it from being deleted. - if (ps->isStillBusy()) + if (!m_bGCStatus) + { + // The GC thread should have deleted all sockets by now; if there + // are any left, then likely the GC was interrupted before it could + // finish the job. We assume then that all threads have been wiped, + // so all we can do is to delete all threads forcefully. + + for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) { - HLOGC(smlog.Debug, log << "checkBrokenSockets: @" << ps->m_SocketID << " is still busy, SKIPPING THIS CYCLE."); - continue; - } + CUDTSocket* ps = j->second; + CUDT* pu = &ps->core(); + CRNode* rnode = pu->m_pRNode; - CUDT& u = ps->core(); + // Ignore BUSY flag. + // Ignore Linger. + // Regard CRcvUList membership. - // HLOGC(smlog.Debug, log << "checking CLOSED socket: " << j->first); - if (!is_zero(u.m_tsLingerExpiration)) - { - // asynchronous close: - if ((!u.m_pSndBuffer) || (0 == u.m_pSndBuffer->getCurrBufSize()) || - (u.m_tsLingerExpiration <= steady_clock::now())) + if (rnode && rnode->m_bOnList) { - HLOGC(smlog.Debug, log << "checkBrokenSockets: marking CLOSED qualified @" << ps->m_SocketID); - u.m_tsLingerExpiration = steady_clock::time_point(); - u.m_bClosing = true; - ps->m_tsClosureTimeStamp = steady_clock::now(); + // Unstable rnode membership. + pu->m_pRcvQueue->forceRemove(pu); } + + tbr.push_back(j->first); } - // timeout 1 second to destroy a socket AND it has been removed from - // RcvUList - const steady_clock::time_point now = steady_clock::now(); - const steady_clock::duration closed_ago = now - ps->m_tsClosureTimeStamp.load(); - if (closed_ago > seconds_from(1)) + } + else + { + for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) { - CRNode* rnode = u.m_pRNode; - if (!rnode || !rnode->m_bOnList) + CUDTSocket* ps = j->second; + + // NOTE: There is still a hypothetical risk here that ps + // was made busy while the socket was already moved to m_ClosedSocket, + // if the socket was acquired through CUDTUnited::acquireSocket (that is, + // busy flag acquisition was done through the CUDTSocket* pointer rather + // than through the numeric ID). Therefore this way of busy acquisition + // should be done only if at the moment of acquisition there are certainly + // other conditions applying on the socket that prevent it from being deleted. + if (ps->isStillBusy()) { - HLOGC(smlog.Debug, - log << "checkBrokenSockets: @" << ps->m_SocketID << " closed " - << FormatDuration(closed_ago) << " ago and removed from RcvQ - will remove"); + HLOGC(smlog.Debug, log << "checkBrokenSockets: @" << ps->m_SocketID << " is still busy, SKIPPING THIS CYCLE."); + continue; + } + + CUDT& u = ps->core(); + + // HLOGC(smlog.Debug, log << "checking CLOSED socket: " << j->first); + if (!is_zero(u.m_tsLingerExpiration)) + { + // asynchronous close: + if ((!u.m_pSndBuffer) || (0 == u.m_pSndBuffer->getCurrBufSize()) || + (u.m_tsLingerExpiration <= steady_clock::now())) + { + HLOGC(smlog.Debug, log << "checkBrokenSockets: marking CLOSED qualified @" << ps->m_SocketID); + u.m_tsLingerExpiration = steady_clock::time_point(); + u.m_bClosing = true; + ps->m_tsClosureTimeStamp = steady_clock::now(); + } + } + + // timeout 1 second to destroy a socket AND it has been removed from + // RcvUList + const steady_clock::time_point now = steady_clock::now(); + const steady_clock::duration closed_ago = now - ps->m_tsClosureTimeStamp.load(); + if (closed_ago > seconds_from(1)) + { + CRNode* rnode = u.m_pRNode; + if (!rnode || !rnode->m_bOnList) + { + HLOGC(smlog.Debug, + log << "checkBrokenSockets: @" << ps->m_SocketID << " closed " + << FormatDuration(closed_ago) << " ago and removed from RcvQ - will remove"); - // HLOGC(smlog.Debug, log << "will unref socket: " << j->first); - tbr.push_back(j->first); + // HLOGC(smlog.Debug, log << "will unref socket: " << j->first); + tbr.push_back(j->first); + } } } } diff --git a/srtcore/queue.cpp b/srtcore/queue.cpp index 4ced92d6f..defd2273e 100644 --- a/srtcore/queue.cpp +++ b/srtcore/queue.cpp @@ -1350,10 +1350,7 @@ void* srt::CRcvQueue::worker(void* param) { HLOGC(qrlog.Debug, log << CUDTUnited::CONID(u->m_SocketID) << " SOCKET broken, REMOVING FROM RCV QUEUE/MAP."); - // the socket must be removed from Hash table first, then RcvUList - self->m_pHash->remove(u->m_SocketID); - self->m_pRcvUList->remove(u); - u->m_pRNode->m_bOnList = false; + self->forceRemove(u); } ul = self->m_pRcvUList->m_pUList; @@ -1842,6 +1839,14 @@ void srt::CRcvQueue::storePktClone(int32_t id, const CPacket& pkt) } } +void srt::CRcvQueue::forceRemove(CUDT* u) +{ + // the socket must be removed from Hash table first, then RcvUList + m_pHash->remove(u->m_SocketID); + m_pRcvUList->remove(u); + u->m_pRNode->m_bOnList = false; +} + void srt::CMultiplexer::resetAtFork() { if (m_pRcvQueue != NULL) diff --git a/srtcore/queue.h b/srtcore/queue.h index 930ddd92a..d0e931e47 100644 --- a/srtcore/queue.h +++ b/srtcore/queue.h @@ -517,6 +517,8 @@ class CRcvQueue int getIPversion() { return m_iIPversion; } + void forceRemove(CUDT* u); + void stop(); private: static void* worker(void* param); From 989f9823b080a62466db1f4cb54a392802b0ba14 Mon Sep 17 00:00:00 2001 From: Sektor van Skijlen Date: Fri, 22 May 2026 11:10:43 +0200 Subject: [PATCH 3/6] post fixes --- scripts/win-installer/build-win-installer.ps1 | 7 +++++-- srtcore/api.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/win-installer/build-win-installer.ps1 b/scripts/win-installer/build-win-installer.ps1 index 44ebfb8cd..c788e01ab 100644 --- a/scripts/win-installer/build-win-installer.ps1 +++ b/scripts/win-installer/build-win-installer.ps1 @@ -177,7 +177,10 @@ Write-Output "NSIS: $NSIS" #----------------------------------------------------------------------------- if (-not $NoBuild) { - Write-Output "BUILD ENABLED - configuring build; LIMIT TO PLATFORM: $OnlyPlatform" + Write-Output "BUILD ENABLED - configuring build" + if ($OnlyPlatform -ne "") { + Write-Output "LIMIT TO PLATFORM: $OnlyPlatform" + } foreach ($Platform in $ARCH.Keys) { if ($OnlyPlatform -ne "" -and $Platform -ne $OnlyPlatform) { Write-Output "Skipping platform $Platform." @@ -198,7 +201,7 @@ if (-not $NoBuild) { "-DOPENSSL_INCLUDE_DIR=$(ssl-include $Platform)", "-DOPENSSL_ROOT_DIR=$(ssl-libdir $Platform Release)" ) - Write-Output "Running cmake $params" + Write-Output "Running: cmake $params" & $CMake $params # Patch version string in version.h Get-Content "$BuildDir\version.h" | diff --git a/srtcore/api.cpp b/srtcore/api.cpp index 5f1bf3cc9..03c5c9897 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -2901,7 +2901,7 @@ void srt::CUDTUnited::checkBrokenSockets() // The GC thread should have deleted all sockets by now; if there // are any left, then likely the GC was interrupted before it could // finish the job. We assume then that all threads have been wiped, - // so all we can do is to delete all threads forcefully. + // so all we can do is to delete all sockets forcefully. for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) { From 9b20dfeb77214cd7f01e6e214a91d346b133fa16 Mon Sep 17 00:00:00 2001 From: Mikolaj Malecki Date: Tue, 2 Jun 2026 12:25:41 +0200 Subject: [PATCH 4/6] Fixed: removed special procedure for cleanup on final destruction. Removed cleaning up sockets after GC exit. Added description --- docs/API/API-functions.md | 16 ++++-- srtcore/api.cpp | 106 ++++++++++++++------------------------ test/test_bonding.cpp | 2 +- 3 files changed, 53 insertions(+), 71 deletions(-) diff --git a/docs/API/API-functions.md b/docs/API/API-functions.md index fc82776ab..0e6da34b6 100644 --- a/docs/API/API-functions.md +++ b/docs/API/API-functions.md @@ -269,14 +269,24 @@ exiting the application that uses the SRT library. This cleanup function will st be called from the C++ global destructor, if not called by the application, although relying on this behavior is strongly discouraged. +**IMPORTANT NOTES**: + +1. This function must be called from within `main()`, preferably at the end. +Calling it from any C++ global destructor is pointless, as SRT does it by +itself. But relying on it is strongly discouraged - at best only if you are +completely certain that all resources in the application are maintained in the +strict creation-destruction order, including threads. If this condition isn't +satisfied, then the behavior of the cleanup outside of `main()` is undefined. + +2. The startup/cleanup calls have an instance counter. This means that if you +call [`srt_startup`](#srt_startup) multiple times, you need to call the +`srt_cleanup` function exactly the same number of times. + | Returns | | |:----------------------------- |:--------------------------------------------------------------- | | 0 | A possibility to return other values is reserved for future use | | | | -**IMPORTANT**: Note that the startup/cleanup calls have an instance counter. -This means that if you call [`srt_startup`](#srt_startup) multiple times, you need to call the -`srt_cleanup` function exactly the same number of times. [:arrow_up:   Back to List of Functions & Structures](#srt-api-functions) diff --git a/srtcore/api.cpp b/srtcore/api.cpp index 03c5c9897..9dc795cf0 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -222,7 +222,9 @@ srt::CUDTUnited::~CUDTUnited() enterCS(m_InitLock); stopGarbageCollector(); leaveCS(m_InitLock); - closeAllSockets(); + + // DO NOT call closeAllSockets() here; instead rely on that + // all sockets have been closed when exitting the GC. releaseMutex(m_GlobControlLock); releaseMutex(m_IDLock); releaseMutex(m_InitLock); @@ -2896,84 +2898,54 @@ void srt::CUDTUnited::checkBrokenSockets() leaveCS(ls->second->m_AcceptLock); } - if (!m_bGCStatus) + for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) { - // The GC thread should have deleted all sockets by now; if there - // are any left, then likely the GC was interrupted before it could - // finish the job. We assume then that all threads have been wiped, - // so all we can do is to delete all sockets forcefully. + CUDTSocket* ps = j->second; - for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) + // NOTE: There is still a hypothetical risk here that ps + // was made busy while the socket was already moved to m_ClosedSocket, + // if the socket was acquired through CUDTUnited::acquireSocket (that is, + // busy flag acquisition was done through the CUDTSocket* pointer rather + // than through the numeric ID). Therefore this way of busy acquisition + // should be done only if at the moment of acquisition there are certainly + // other conditions applying on the socket that prevent it from being deleted. + if (ps->isStillBusy()) { - CUDTSocket* ps = j->second; - CUDT* pu = &ps->core(); - CRNode* rnode = pu->m_pRNode; + HLOGC(smlog.Debug, log << "checkBrokenSockets: @" << ps->m_SocketID << " is still busy, SKIPPING THIS CYCLE."); + continue; + } - // Ignore BUSY flag. - // Ignore Linger. - // Regard CRcvUList membership. + CUDT& u = ps->core(); - if (rnode && rnode->m_bOnList) + // HLOGC(smlog.Debug, log << "checking CLOSED socket: " << j->first); + if (!is_zero(u.m_tsLingerExpiration)) + { + // asynchronous close: + if ((!u.m_pSndBuffer) || (0 == u.m_pSndBuffer->getCurrBufSize()) || + (u.m_tsLingerExpiration <= steady_clock::now())) { - // Unstable rnode membership. - pu->m_pRcvQueue->forceRemove(pu); + HLOGC(smlog.Debug, log << "checkBrokenSockets: marking CLOSED qualified @" << ps->m_SocketID); + u.m_tsLingerExpiration = steady_clock::time_point(); + u.m_bClosing = true; + ps->m_tsClosureTimeStamp = steady_clock::now(); } - - tbr.push_back(j->first); } - } - else - { - for (sockets_t::iterator j = m_ClosedSockets.begin(); j != m_ClosedSockets.end(); ++j) + // timeout 1 second to destroy a socket AND it has been removed from + // RcvUList + const steady_clock::time_point now = steady_clock::now(); + const steady_clock::duration closed_ago = now - ps->m_tsClosureTimeStamp.load(); + if (closed_ago > seconds_from(1)) { - CUDTSocket* ps = j->second; - - // NOTE: There is still a hypothetical risk here that ps - // was made busy while the socket was already moved to m_ClosedSocket, - // if the socket was acquired through CUDTUnited::acquireSocket (that is, - // busy flag acquisition was done through the CUDTSocket* pointer rather - // than through the numeric ID). Therefore this way of busy acquisition - // should be done only if at the moment of acquisition there are certainly - // other conditions applying on the socket that prevent it from being deleted. - if (ps->isStillBusy()) + CRNode* rnode = u.m_pRNode; + if (!rnode || !rnode->m_bOnList) { - HLOGC(smlog.Debug, log << "checkBrokenSockets: @" << ps->m_SocketID << " is still busy, SKIPPING THIS CYCLE."); - continue; - } - - CUDT& u = ps->core(); - - // HLOGC(smlog.Debug, log << "checking CLOSED socket: " << j->first); - if (!is_zero(u.m_tsLingerExpiration)) - { - // asynchronous close: - if ((!u.m_pSndBuffer) || (0 == u.m_pSndBuffer->getCurrBufSize()) || - (u.m_tsLingerExpiration <= steady_clock::now())) - { - HLOGC(smlog.Debug, log << "checkBrokenSockets: marking CLOSED qualified @" << ps->m_SocketID); - u.m_tsLingerExpiration = steady_clock::time_point(); - u.m_bClosing = true; - ps->m_tsClosureTimeStamp = steady_clock::now(); - } - } - - // timeout 1 second to destroy a socket AND it has been removed from - // RcvUList - const steady_clock::time_point now = steady_clock::now(); - const steady_clock::duration closed_ago = now - ps->m_tsClosureTimeStamp.load(); - if (closed_ago > seconds_from(1)) - { - CRNode* rnode = u.m_pRNode; - if (!rnode || !rnode->m_bOnList) - { - HLOGC(smlog.Debug, - log << "checkBrokenSockets: @" << ps->m_SocketID << " closed " - << FormatDuration(closed_ago) << " ago and removed from RcvQ - will remove"); + HLOGC(smlog.Debug, + log << "checkBrokenSockets: @" << ps->m_SocketID << " closed " + << FormatDuration(closed_ago) << " ago and removed from RcvQ - will remove"); - // HLOGC(smlog.Debug, log << "will unref socket: " << j->first); - tbr.push_back(j->first); - } + // HLOGC(smlog.Debug, log << "will unref socket: " << j->first); + tbr.push_back(j->first); } } } diff --git a/test/test_bonding.cpp b/test/test_bonding.cpp index 11d2904f6..fa20b6098 100644 --- a/test/test_bonding.cpp +++ b/test/test_bonding.cpp @@ -530,7 +530,7 @@ TEST(Bonding, Options) #if SRT_ENABLE_ENCRYPTION - uint32_t kms = -1; + int32_t kms = -1; EXPECT_NE(srt_getsockflag(grp, SRTO_KMSTATE, &kms, &optsize), SRT_ERROR); EXPECT_EQ(optsize, (int) sizeof kms); From 0fd986762e0efb560346fa6542dd2f01e9566e1a Mon Sep 17 00:00:00 2001 From: Mikolaj Malecki Date: Tue, 2 Jun 2026 12:28:36 +0200 Subject: [PATCH 5/6] Renamed forceRemove --- srtcore/queue.cpp | 5 ++--- srtcore/queue.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/srtcore/queue.cpp b/srtcore/queue.cpp index c725a6aba..69eb63a8d 100644 --- a/srtcore/queue.cpp +++ b/srtcore/queue.cpp @@ -1333,7 +1333,6 @@ void* srt::CRcvQueue::worker(void* param) ATR_NOEXCEPT // sockets are removed from the multiplexer. Alternatively you can forcefully // remove all sockets from the receive U list. continue; - // break; } // OTHERWISE: this is an "AGAIN" situation. No data was read, but the process should continue. @@ -1355,7 +1354,7 @@ void* srt::CRcvQueue::worker(void* param) ATR_NOEXCEPT { HLOGC(qrlog.Debug, log << CUDTUnited::CONID(u->m_SocketID) << " SOCKET broken, REMOVING FROM RCV QUEUE/MAP."); - self->forceRemove(u); + self->removeFromLists(u); } ul = self->m_pRcvUList->m_pUList; @@ -1844,7 +1843,7 @@ void srt::CRcvQueue::storePktClone(int32_t id, const CPacket& pkt) } } -void srt::CRcvQueue::forceRemove(CUDT* u) +void srt::CRcvQueue::removeFromLists(CUDT* u) { // the socket must be removed from Hash table first, then RcvUList m_pHash->remove(u->m_SocketID); diff --git a/srtcore/queue.h b/srtcore/queue.h index 55874a52c..2b537a59d 100644 --- a/srtcore/queue.h +++ b/srtcore/queue.h @@ -517,7 +517,7 @@ class CRcvQueue int getIPversion() { return m_iIPversion; } - void forceRemove(CUDT* u); + void removeFromLists(CUDT* u); void stop(); private: From bd30ac875a8c67600fb92556811a376831841a7f Mon Sep 17 00:00:00 2001 From: Mikolaj Malecki Date: Tue, 2 Jun 2026 12:45:22 +0200 Subject: [PATCH 6/6] Fixed codespell --- srtcore/api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srtcore/api.cpp b/srtcore/api.cpp index 9dc795cf0..7b5709571 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -224,7 +224,7 @@ srt::CUDTUnited::~CUDTUnited() leaveCS(m_InitLock); // DO NOT call closeAllSockets() here; instead rely on that - // all sockets have been closed when exitting the GC. + // all sockets have been closed when exiting the GC. releaseMutex(m_GlobControlLock); releaseMutex(m_IDLock); releaseMutex(m_InitLock);