Fixed termination reason when failed to send keep alive.

git-svn-id: http://voip.null.ro/svn/yate@1959 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-04-30 08:10:40 +00:00
parent bd1ee329be
commit 41b3f6f4b5
1 changed files with 5 additions and 2 deletions

View File

@ -618,8 +618,11 @@ JBEvent* JBStream::getEvent(u_int64_t time)
lookupState(state()),this);
const char* keepAlive = "\t";
unsigned int l = 1;
if (!m_socket.send(keepAlive,l))
terminate(false,0,XMPPError::Internal,m_socket.m_error,true);
if (!m_socket.send(keepAlive,l)) {
// Keep the reason: terminate() might override the last socket error
String reason = m_socket.m_error;
terminate(false,0,XMPPError::HostGone,reason,true);
}
}
}
else if (m_setupTimeout && time > m_setupTimeout) {