Skip to content

Commit

Permalink
Update queue.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Aug 7, 2023
1 parent 4a91b9c commit fc5f906
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,6 @@ srt::CRcvQueue::~CRcvQueue()
while (!i->second.empty())
{
CPacket* pkt = i->second.front();
delete[] pkt->m_pcData;
delete pkt;
i->second.pop();
}
Expand Down Expand Up @@ -1365,14 +1364,12 @@ srt::EReadStatus srt::CRcvQueue::worker_RetrieveUnit(int32_t& w_id, CUnit*& w_un
{
// no space, skip this packet
CPacket temp;
temp.m_pcData = new char[m_szPayloadSize];
temp.setLength(m_szPayloadSize);
temp.allocate(m_szPayloadSize);
THREAD_PAUSED();
EReadStatus rst = m_pChannel->recvfrom((w_addr), (temp));
THREAD_RESUMED();
// Note: this will print nothing about the packet details unless heavy logging is on.
LOGC(qrlog.Error, log << CONID() << "LOCAL STORAGE DEPLETED. Dropping 1 packet: " << temp.Info());
delete[] temp.m_pcData;

// Be transparent for RST_ERROR, but ignore the correct
// data read and fake that the packet was dropped.
Expand Down Expand Up @@ -1734,7 +1731,6 @@ void srt::CRcvQueue::removeConnector(const SRTSOCKET& id)
log << "removeConnector: ... and its packet queue with " << i->second.size() << " packets collected");
while (!i->second.empty())
{
delete[] i->second.front()->m_pcData;
delete i->second.front();
i->second.pop();
}
Expand Down Expand Up @@ -1780,7 +1776,7 @@ void srt::CRcvQueue::storePkt(int32_t id, CPacket* pkt)
}
else
{
// avoid storing too many packets, in case of malfunction or attack
// Avoid storing too many packets, in case of malfunction or attack.
if (i->second.size() > 16)
{
delete pkt;
Expand All @@ -1793,7 +1789,7 @@ void srt::CRcvQueue::storePkt(int32_t id, CPacket* pkt)

void srt::CMultiplexer::destroy()
{
// Reverse order of the assigned
// Reverse order of the assigned.
delete m_pRcvQueue;
delete m_pSndQueue;
delete m_pTimer;
Expand Down

0 comments on commit fc5f906

Please sign in to comment.