mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Handle disconnects during connection attempts (i.e. vanishing connection objects)
This commit is contained in:
@@ -851,7 +851,11 @@ Servent::connectToPeer(const peerinfo_ptr& peerInfo, const QList<SipInfo>& sipIn
|
|||||||
{
|
{
|
||||||
if ( sipInfos.isEmpty() )
|
if ( sipInfos.isEmpty() )
|
||||||
{
|
{
|
||||||
|
if ( conn != NULL ) {
|
||||||
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "No more possible SIP endpoints for " << conn->name() << " skipping.";
|
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "No more possible SIP endpoints for " << conn->name() << " skipping.";
|
||||||
|
} else {
|
||||||
|
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "No more possible SIP endpoints for <null connection> skipping.";
|
||||||
|
}
|
||||||
// If a peerinfo was supplied and has a ControlConnection which should be destroyed, than use this
|
// If a peerinfo was supplied and has a ControlConnection which should be destroyed, than use this
|
||||||
if ( !peerInfo.isNull() && peerInfo->controlConnection() )
|
if ( !peerInfo.isNull() && peerInfo->controlConnection() )
|
||||||
delete peerInfo->controlConnection();
|
delete peerInfo->controlConnection();
|
||||||
@@ -922,11 +926,14 @@ Servent::connectToPeer(const peerinfo_ptr& peerInfo, const QList<SipInfo>& sipIn
|
|||||||
void
|
void
|
||||||
Servent::connectToPeerFailed( const peerinfo_ptr& peerInfo, QList<SipInfo> sipInfo, Connection* conn, QTcpSocketExtra* socket )
|
Servent::connectToPeerFailed( const peerinfo_ptr& peerInfo, QList<SipInfo> sipInfo, Connection* conn, QTcpSocketExtra* socket )
|
||||||
{
|
{
|
||||||
|
bool connIsNull = socket->_conn.isNull();
|
||||||
cleanupSocket( socket );
|
cleanupSocket( socket );
|
||||||
|
|
||||||
// Try next SipInfo
|
if ( !connIsNull ) {
|
||||||
|
// Try next SipInfo (don't do this if the connection was destroyed in between)
|
||||||
connectToPeer( peerInfo, sipInfo, conn );
|
connectToPeer( peerInfo, sipInfo, conn );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::socketError( QAbstractSocket::SocketError e )
|
Servent::socketError( QAbstractSocket::SocketError e )
|
||||||
|
Reference in New Issue
Block a user