diff --git a/srtcore/queue.cpp b/srtcore/queue.cpp index 20f25f3b4..fc1eb3edd 100644 --- a/srtcore/queue.cpp +++ b/srtcore/queue.cpp @@ -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. diff --git a/testing/testmedia.cpp b/testing/testmedia.cpp index 7892672d5..50f5f6a71 100755 --- a/testing/testmedia.cpp +++ b/testing/testmedia.cpp @@ -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 )