Skip to content

Commit

Permalink
[core] Fixed wrong reject reason on async connect (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris authored Aug 17, 2020
1 parent 45c727d commit 4aa6fbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion srtcore/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,17 @@ void CRendezvousQueue::updateConnStatus(EReadStatus rst, EConnectStatus cst, con
<< "). removing from queue");
// connection timer expired, acknowledge app via epoll
i->m_pUDT->m_bConnecting = false;
i->m_pUDT->m_RejectReason = SRT_REJ_TIMEOUT;
if (!is_zero(i->m_tsTTL))
{
// Timer expired, set TIMEOUT forcefully
i->m_pUDT->m_RejectReason = SRT_REJ_TIMEOUT;
}
else if (i->m_pUDT->m_RejectReason == SRT_REJ_UNKNOWN)
{
// In case of unknown reason, rejection should at least
// suggest error on the peer
i->m_pUDT->m_RejectReason = SRT_REJ_PEER;
}
CUDT::s_UDTUnited.m_EPoll.update_events(i->m_iID, i->m_pUDT->m_sPollID, SRT_EPOLL_ERR, true);
/*
* Setting m_bConnecting to false but keeping socket in rendezvous queue is not a good idea.
Expand Down
2 changes: 1 addition & 1 deletion testing/testmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ void SrtCommon::Error(string src, int reason, int force_result)
cerr << "\nERROR (app): " << src << endl;
throw std::runtime_error(src);
}
string message = srt_getlasterror_str();
string message = srt_strerror(result, errnov);
if (result == SRT_ECONNREJ)
{
if ( Verbose::on )
Expand Down

0 comments on commit 4aa6fbb

Please sign in to comment.