mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
* Added logging to Servent.
This commit is contained in:
@@ -109,31 +109,30 @@ Servent::startListening( QHostAddress ha, bool upnp, int port )
|
|||||||
defPortAlso = listen( ha, defPort );
|
defPortAlso = listen( ha, defPort );
|
||||||
if( !defPortAlso )
|
if( !defPortAlso )
|
||||||
{
|
{
|
||||||
qDebug() << "Failed to listen on both port" << m_port << "and port" << defPort;
|
tLog() << "Failed to listen on both port" << m_port << "and port" << defPort;
|
||||||
qDebug() << "Error string is" << errorString();
|
tLog() << "Error string is" << errorString();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << "Servent listening on port" << defPort << "servent thread:" << thread();
|
tLog() << "Servent listening on port" << defPort << "servent thread:" << thread();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool defPortAlso = listen( ha, defPort );
|
bool defPortAlso = listen( ha, defPort );
|
||||||
qDebug() << "Servent listening on port" << m_port << "servent thread:" << thread();
|
tLog() << "Servent listening on port" << m_port << "servent thread:" << thread();
|
||||||
if( defPortAlso )
|
if( defPortAlso )
|
||||||
qDebug() << "Servent also listening on port" << defPort << "servent thread:" << thread();
|
tLog() << "Servent also listening on port" << defPort << "servent thread:" << thread();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --lanhack means to advertise your LAN IP over jabber as if it were externallyVisible
|
// --lanhack means to advertise your LAN IP over jabber as if it were externallyVisible
|
||||||
qDebug() << "Address mode =" << (int)(TomahawkSettings::instance()->externalAddressMode());
|
tLog() << "Address mode =" << (int)(TomahawkSettings::instance()->externalAddressMode());
|
||||||
qDebug() << "Static host/port preferred =" << ( TomahawkSettings::instance()->preferStaticHostPort() ? "true" : "false" );
|
tLog() << "Static host/port preferred =" << ( TomahawkSettings::instance()->preferStaticHostPort() ? "true" : "false" );
|
||||||
|
|
||||||
if( TomahawkSettings::instance()->preferStaticHostPort() )
|
if( TomahawkSettings::instance()->preferStaticHostPort() )
|
||||||
{
|
{
|
||||||
qDebug() << "Forcing static preferred host and port";
|
tLog() << "Forcing static preferred host and port";
|
||||||
m_externalHostname = TomahawkSettings::instance()->externalHostname();
|
m_externalHostname = TomahawkSettings::instance()->externalHostname();
|
||||||
m_externalPort = TomahawkSettings::instance()->externalPort();
|
m_externalPort = TomahawkSettings::instance()->externalPort();
|
||||||
// qDebug() << m_externalHostname << m_externalPort;
|
|
||||||
emit ready();
|
emit ready();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -163,7 +162,7 @@ Servent::startListening( QHostAddress ha, bool upnp, int port )
|
|||||||
|
|
||||||
case TomahawkSettings::Upnp:
|
case TomahawkSettings::Upnp:
|
||||||
// TODO check if we have a public/internet IP on this machine directly
|
// TODO check if we have a public/internet IP on this machine directly
|
||||||
qDebug() << "External address mode set to upnp....";
|
tLog() << "External address mode set to upnp....";
|
||||||
m_portfwd = new PortFwdThread( m_port );
|
m_portfwd = new PortFwdThread( m_port );
|
||||||
connect( m_portfwd, SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ),
|
connect( m_portfwd, SIGNAL( externalAddressDetected( QHostAddress, unsigned int ) ),
|
||||||
SLOT( setExternalAddress( QHostAddress, unsigned int ) ) );
|
SLOT( setExternalAddress( QHostAddress, unsigned int ) ) );
|
||||||
|
Reference in New Issue
Block a user