|
|
@ -54,6 +54,7 @@ |
|
|
|
#include "httpserver.h" |
|
|
|
#include "httpserver.h" |
|
|
|
#include "qinisettings.h" |
|
|
|
#include "qinisettings.h" |
|
|
|
#include "bandwidthscheduler.h" |
|
|
|
#include "bandwidthscheduler.h" |
|
|
|
|
|
|
|
#include <libtorrent/version.hpp> |
|
|
|
#include <libtorrent/extensions/ut_metadata.hpp> |
|
|
|
#include <libtorrent/extensions/ut_metadata.hpp> |
|
|
|
#include <libtorrent/version.hpp> |
|
|
|
#include <libtorrent/version.hpp> |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 14 |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 14 |
|
|
@ -67,7 +68,6 @@ |
|
|
|
#include <libtorrent/identify_client.hpp> |
|
|
|
#include <libtorrent/identify_client.hpp> |
|
|
|
#include <libtorrent/alert_types.hpp> |
|
|
|
#include <libtorrent/alert_types.hpp> |
|
|
|
#include <libtorrent/torrent_info.hpp> |
|
|
|
#include <libtorrent/torrent_info.hpp> |
|
|
|
#include <libtorrent/version.hpp> |
|
|
|
|
|
|
|
#include <libtorrent/upnp.hpp> |
|
|
|
#include <libtorrent/upnp.hpp> |
|
|
|
#include <libtorrent/natpmp.hpp> |
|
|
|
#include <libtorrent/natpmp.hpp> |
|
|
|
#include <boost/filesystem/exception.hpp> |
|
|
|
#include <boost/filesystem/exception.hpp> |
|
|
@ -427,24 +427,35 @@ void QBtSession::configureSession() { |
|
|
|
// IP address to announce to trackers
|
|
|
|
// IP address to announce to trackers
|
|
|
|
QString announce_ip = pref.getNetworkAddress(); |
|
|
|
QString announce_ip = pref.getNetworkAddress(); |
|
|
|
if(!announce_ip.isEmpty()) { |
|
|
|
if(!announce_ip.isEmpty()) { |
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 |
|
|
|
|
|
|
|
sessionSettings.announce_ip = announce_ip.toStdString(); |
|
|
|
|
|
|
|
#else |
|
|
|
boost::system::error_code ec; |
|
|
|
boost::system::error_code ec; |
|
|
|
boost::asio::ip::address addr = boost::asio::ip::address::from_string(announce_ip.toStdString(), ec); |
|
|
|
boost::asio::ip::address addr = boost::asio::ip::address::from_string(announce_ip.toStdString(), ec); |
|
|
|
if(!ec) { |
|
|
|
if(!ec) { |
|
|
|
addConsoleMessage(tr("Reporting IP address %1 to trackers...").arg(announce_ip)); |
|
|
|
addConsoleMessage(tr("Reporting IP address %1 to trackers...").arg(announce_ip)); |
|
|
|
sessionSettings.announce_ip = addr; |
|
|
|
sessionSettings.announce_ip = addr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
// Super seeding
|
|
|
|
// Super seeding
|
|
|
|
#if LIBTORRENT_VERSION_MINOR > 14 |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 14 |
|
|
|
sessionSettings.strict_super_seeding = pref.isSuperSeedingEnabled(); |
|
|
|
sessionSettings.strict_super_seeding = pref.isSuperSeedingEnabled(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
qDebug() << "Settings SessionSettings"; |
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 |
|
|
|
setSessionSettings(sessionSettings); |
|
|
|
// * Max Half-open connections
|
|
|
|
// Bittorrent
|
|
|
|
sessionSettings.half_open_limit = pref.getMaxHalfOpenConnections(); |
|
|
|
|
|
|
|
// * Max connections limit
|
|
|
|
|
|
|
|
sessionSettings.connections_limit = pref.getMaxConnecs(); |
|
|
|
|
|
|
|
#else |
|
|
|
// * Max Half-open connections
|
|
|
|
// * Max Half-open connections
|
|
|
|
s->set_max_half_open_connections(pref.getMaxHalfOpenConnections()); |
|
|
|
s->set_max_half_open_connections(pref.getMaxHalfOpenConnections()); |
|
|
|
// * Max connections limit
|
|
|
|
// * Max connections limit
|
|
|
|
setMaxConnections(pref.getMaxConnecs()); |
|
|
|
setMaxConnections(pref.getMaxConnecs()); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
qDebug() << "Settings SessionSettings"; |
|
|
|
|
|
|
|
setSessionSettings(sessionSettings); |
|
|
|
|
|
|
|
// Bittorrent
|
|
|
|
// * Max connections per torrent limit
|
|
|
|
// * Max connections per torrent limit
|
|
|
|
setMaxConnectionsPerTorrent(pref.getMaxConnecsPerTorrent()); |
|
|
|
setMaxConnectionsPerTorrent(pref.getMaxConnecsPerTorrent()); |
|
|
|
// * Max uploads per torrent limit
|
|
|
|
// * Max uploads per torrent limit
|
|
|
|