logger->addMessage(tr("qBittorrent is trying to listen on any interface port: %1","e.g: qBittorrent is trying to listen on any interface port: TCP/6881").arg(QString::number(port)),Log::INFO);
logger->addMessage(tr("qBittorrent is trying to listen on interface %1 port: %2","e.g: qBittorrent is trying to listen on interface 192.168.0.1 port: TCP/6881").arg(ip).arg(port),Log::INFO);
logger->addMessage(tr("qBittorrent is trying to listen on any interface port: %1","e.g: qBittorrent is trying to listen on any interface port: TCP/6881").arg(QString::number(port)),Log::INFO);
logger->addMessage(tr("qBittorrent failed to listen on any interface port: %1. Reason: %2","e.g: qBittorrent failed to listen on any interface port: TCP/6881. Reason: no such interface").arg(QString::number(port)).arg(Utils::String::fromStdString(ec.message())),Log::CRITICAL);
// At this point there was a valid network interface, with no suitable IP.
if(IPs.size()==0){
logger->addMessage(tr("qBittorrent didn't find an %1 local address to listen on","qBittorrent didn't find an IPv4 local address to listen on").arg(listenIPv6?"IPv6":"IPv4"),Log::CRITICAL);
IPs.append("127.0.0.1");// Force listening to localhost and avoid accidental connection that will expose user data.
returnIPs;
}
returnIPs;
}
// Set the ports range in which is chosen the port
// the BitTorrent session will listen to
voidSession::setListeningPort()
{
Preferences*constpref=Preferences::instance();
constunsignedshortport=pref->getSessionPort();
qDebug()<<Q_FUNC_INFO<<port;
Logger*constlogger=Logger::instance();
std::pair<int,int>ports(port,port);
libt::error_codeec;
constQStringListIPs=getListeningIPs();
foreach(constQStringip,IPs){
if(ip.isEmpty()){
logger->addMessage(tr("qBittorrent is trying to listen on any interface port: %1","e.g: qBittorrent is trying to listen on any interface port: TCP/6881").arg(QString::number(port)),Log::INFO);
logger->addMessage(tr("qBittorrent failed to listen on any interface port: %1. Reason: %2","e.g: qBittorrent failed to listen on any interface port: TCP/6881. Reason: no such interface").arg(QString::number(port)).arg(Utils::String::fromStdString(ec.message())),Log::CRITICAL);
logger->addMessage(tr("qBittorrent is trying to listen on interface %1 port: %2","e.g: qBittorrent is trying to listen on interface 192.168.0.1 port: TCP/6881").arg(ipString).arg(port),Log::INFO);
logger->addMessage(tr("qBittorrent is trying to listen on interface %1 port: %2","e.g: qBittorrent is trying to listen on interface 192.168.0.1 port: TCP/6881").arg(ip).arg(port),Log::INFO);
return;
}
}
logger->addMessage(tr("qBittorrent didn't find an %1 local address to listen on","qBittorrent didn't find an IPv4 local address to listen on").arg(listen_ipv6?"IPv6":"IPv4"),Log::CRITICAL);