Skip to content

Commit

Permalink
[core] Protect RCV buffer access from socket stats
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Mar 8, 2022
1 parent 4b70a63 commit a60d98a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion srtcore/core.cpp
Expand Up @@ -7449,7 +7449,8 @@ void srt::CUDT::bstats(CBytePerfMon *perf, bool clear, bool instantaneous)

if (m_pRcvBuffer)
{
perf->byteAvailRcvBuf = getAvailRcvBufferSizeLock() * m_config.iMSS;
ScopedLock lck(m_RcvBufferLock);
perf->byteAvailRcvBuf = getAvailRcvBufferSizeNoLock() * m_config.iMSS;
if (instantaneous) // no need for historical API for Rcv side
{
perf->pktRcvBuf = m_pRcvBuffer->getRcvDataSize(perf->byteRcvBuf, perf->msRcvBuf);
Expand Down

0 comments on commit a60d98a

Please sign in to comment.