Skip to content

Commit a60d98a

Browse files
committed
[core] Protect RCV buffer access from socket stats
1 parent 4b70a63 commit a60d98a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

srtcore/core.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -7449,7 +7449,8 @@ void srt::CUDT::bstats(CBytePerfMon *perf, bool clear, bool instantaneous)
74497449

74507450
if (m_pRcvBuffer)
74517451
{
7452-
perf->byteAvailRcvBuf = getAvailRcvBufferSizeLock() * m_config.iMSS;
7452+
ScopedLock lck(m_RcvBufferLock);
7453+
perf->byteAvailRcvBuf = getAvailRcvBufferSizeNoLock() * m_config.iMSS;
74537454
if (instantaneous) // no need for historical API for Rcv side
74547455
{
74557456
perf->pktRcvBuf = m_pRcvBuffer->getRcvDataSize(perf->byteRcvBuf, perf->msRcvBuf);

0 commit comments

Comments
 (0)