Skip to content

Commit

Permalink
Added more logs around rejection (#198)
Browse files Browse the repository at this point in the history
* Added more logs around rejection
  • Loading branch information
ethouris authored and rndi committed Jan 9, 2018
1 parent a4bf533 commit de28dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ int CUDTUnited::newConnection(const SRTSOCKET listen, const sockaddr* peer, CHan
m_Sockets.erase(ns->m_SocketID);
}
error = 1;
LOGP(mglog.Debug,
"newConnection: error while accepting, connection rejected");
goto ERR_ROLLBACK;
}

Expand Down Expand Up @@ -501,6 +499,10 @@ int CUDTUnited::newConnection(const SRTSOCKET listen, const sockaddr* peer, CHan
// XXX the exact value of 'error' is ignored
if (error > 0)
{
#if ENABLE_LOGGING
static const char* why [] = {"?", "ACCEPT ERROR", "IPE when mapping a socket", "IPE when inserting a socket" };
LOGC(mglog.Error, log << CONID(ns->m_SocketID) << "newConnection: connection rejected due to: " << why[error]);
#endif
ns->m_pUDT->close();
ns->m_Status = SRTS_CLOSED;
ns->m_TimeStamp = CTimer::getTime();
Expand Down
1 change: 1 addition & 0 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4029,6 +4029,7 @@ void CUDT::acceptAndRespond(const sockaddr* peer, CHandShake* hs, const CPacket&
LOGC(mglog.Debug, log << "acceptAndRespond: creating CONCLUSION response (HSv5: with HSRSP/KMRSP) buffer size=" << size);
if (!createSrtHandshake(Ref(response), Ref(*hs), SRT_CMD_HSRSP, SRT_CMD_KMRSP, kmdata, kmdatasize))
{
LOGC(mglog.Error, log << "acceptAndRespond: error creating handshake response");
throw CUDTException(MJ_SETUP, MN_REJECTED, 0);
}

Expand Down

0 comments on commit de28dbf

Please sign in to comment.