Skip to content

Commit

Permalink
[core] Fixed missing m_RcvLossLock in processData().
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and maxsharabayko committed Sep 29, 2022
1 parent 22588e4 commit 70a8eb2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9995,6 +9995,7 @@ int srt::CUDT::processData(CUnit* in_unit)
// Check if packet was retransmitted on request or on ack timeout
// Search the sequence in the loss record.
rexmit_reason = " by ";
ScopedLock lock(m_RcvLossLock);
if (!m_pRcvLossList->find(packet.m_iSeqNo, packet.m_iSeqNo))
rexmit_reason += "BLIND";
else
Expand Down Expand Up @@ -10337,7 +10338,7 @@ int srt::CUDT::processData(CUnit* in_unit)
{
// pack loss list for (possibly belated) NAK
// The LOSSREPORT will be sent in a while.

ScopedLock lock(m_RcvLossLock);
for (loss_seqs_t::iterator i = srt_loss_seqs.begin(); i != srt_loss_seqs.end(); ++i)
{
m_FreshLoss.push_back(CRcvFreshLoss(i->first, i->second, initial_loss_ttl));
Expand Down Expand Up @@ -10409,9 +10410,6 @@ int srt::CUDT::processData(CUnit* in_unit)
{
// A loss is detected
{
// TODO: Can unlock rcvloss after m_pRcvLossList->insert(...)?
// And probably protect m_FreshLoss as well.

HLOGC(qrlog.Debug,
log << CONID() << "processData: LOSS DETECTED, %: " << Printable(srt_loss_seqs) << " - RECORDING.");
// if record_loss == false, nothing will be contained here
Expand Down

0 comments on commit 70a8eb2

Please sign in to comment.