Skip to content

Commit

Permalink
[core] Added missing lock for isRcvDataReady()
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and maxsharabayko committed Aug 25, 2021
1 parent 8b1be61 commit cbdd676
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2071,11 +2071,13 @@ vector<CUDTSocket*> CUDTGroup::recv_WaitForReadReady(const vector<CUDTSocket*>&

readReady.push_back(*sockiter);
}
else if (sock->core().m_pRcvBuffer->isRcvDataReady())
else
{
// No read-readiness reported by epoll, but probably missed or not yet handled
// as the receiver buffer is read-ready.
readReady.push_back(sock);
ScopedLock lg(sock->core().m_RcvBufferLock);
if (sock->core().m_pRcvBuffer && sock->core().m_pRcvBuffer->isRcvDataReady())
readReady.push_back(sock);
}
}

Expand Down

0 comments on commit cbdd676

Please sign in to comment.