mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Add debugging for alastair
This commit is contained in:
@@ -767,20 +767,26 @@ Servent::printCurrentTransfers()
|
|||||||
bool
|
bool
|
||||||
Servent::isIPWhitelisted( QHostAddress ip )
|
Servent::isIPWhitelisted( QHostAddress ip )
|
||||||
{
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Performing checks against ip" << ip.toString();
|
||||||
typedef QPair< QHostAddress, int > range;
|
typedef QPair< QHostAddress, int > range;
|
||||||
QList< range > subnetEntries;
|
QList< range > subnetEntries;
|
||||||
|
|
||||||
QList< QNetworkInterface > networkInterfaces = QNetworkInterface::allInterfaces();
|
QList< QNetworkInterface > networkInterfaces = QNetworkInterface::allInterfaces();
|
||||||
foreach( QNetworkInterface interface, networkInterfaces )
|
foreach( QNetworkInterface interface, networkInterfaces )
|
||||||
{
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking interface" << interface.humanReadableName();
|
||||||
QList< QNetworkAddressEntry > addressEntries = interface.addressEntries();
|
QList< QNetworkAddressEntry > addressEntries = interface.addressEntries();
|
||||||
foreach( QNetworkAddressEntry addressEntry, addressEntries )
|
foreach( QNetworkAddressEntry addressEntry, addressEntries )
|
||||||
{
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking address entry with ip" << addressEntry.ip().toString() << "and prefix length" << addressEntry.prefixLength();
|
||||||
if ( ip.isInSubnet( addressEntry.ip(), addressEntry.prefixLength() ) )
|
if ( ip.isInSubnet( addressEntry.ip(), addressEntry.prefixLength() ) )
|
||||||
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "success";
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "failure";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user