Skip to content

Commit

Permalink
CRendezvousQueue::updateConnStatus() may update mismatched connections
Browse files Browse the repository at this point in the history
  • Loading branch information
NKTelnet authored and rndi committed Sep 13, 2019
1 parent 76447cd commit 2891e1b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,17 @@ void CRendezvousQueue::updateConnStatus(EReadStatus rst, EConnectStatus cst, con
// In the below call, only the underlying `processRendezvous` function will be attempting
// to interpret these data (for caller-listener this was already done by `processConnectRequest`
// before calling this function), and it checks for the data presence.
if (!i->m_pUDT->processAsyncConnectRequest(rst, cst, response, i->m_pPeerAddr))
bool success;
if (i->m_iID != response.m_iID)
{
success = i->m_pUDT->processAsyncConnectRequest(RST_AGAIN, CONN_AGAIN, response, i->m_pPeerAddr);
}
else
{
success = i->m_pUDT->processAsyncConnectRequest(rst, cst, response, i->m_pPeerAddr);
}

if (!success)
{
// cst == CONN_REJECT can only be result of worker_ProcessAddressedPacket and
// its already set in this case.
Expand Down

0 comments on commit 2891e1b

Please sign in to comment.