mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 06:13:36 -07:00
- Fixed compiling with latest libtorrent svn/trunk
- Added some errors messages if fastresume fails
This commit is contained in:
parent
a01a461dd0
commit
1c5262b1ed
4 changed files with 49 additions and 10 deletions
35
src/GUI.cpp
35
src/GUI.cpp
|
@ -1168,7 +1168,10 @@ void GUI::configureSession(bool deleteOptions){
|
||||||
qDebug("Configuring session");
|
qDebug("Configuring session");
|
||||||
QPair<int, int> limits;
|
QPair<int, int> limits;
|
||||||
unsigned short old_listenPort, new_listenPort;
|
unsigned short old_listenPort, new_listenPort;
|
||||||
session_settings proxySettings;
|
#ifdef V_0_13
|
||||||
|
proxy_settings proxySettings;
|
||||||
|
#endif
|
||||||
|
session_settings sessionSettings;
|
||||||
// Configure session regarding options
|
// Configure session regarding options
|
||||||
BTSession.setDefaultSavePath(options->getSavePath());
|
BTSession.setDefaultSavePath(options->getSavePath());
|
||||||
old_listenPort = BTSession.getListenPort();
|
old_listenPort = BTSession.getListenPort();
|
||||||
|
@ -1222,15 +1225,33 @@ void GUI::configureSession(bool deleteOptions){
|
||||||
}
|
}
|
||||||
// Apply Proxy settings
|
// Apply Proxy settings
|
||||||
if(options->isProxyEnabled()){
|
if(options->isProxyEnabled()){
|
||||||
proxySettings.proxy_ip = options->getProxyIp().toStdString();
|
#ifndef V_0_13
|
||||||
proxySettings.proxy_port = options->getProxyPort();
|
sessionSettings.proxy_ip = options->getProxyIp().toStdString();
|
||||||
|
sessionSettings.proxy_port = options->getProxyPort();
|
||||||
|
#endif
|
||||||
|
#ifdef V_0_13
|
||||||
|
proxySettings.hostname = options->getProxyIp().toStdString();
|
||||||
|
proxySettings.port = options->getProxyPort();
|
||||||
|
proxySettings.type = proxy_settings::http;
|
||||||
|
#endif
|
||||||
if(options->isProxyAuthEnabled()){
|
if(options->isProxyAuthEnabled()){
|
||||||
proxySettings.proxy_login = options->getProxyUsername().toStdString();
|
#ifndef V_0_13
|
||||||
proxySettings.proxy_password = options->getProxyPassword().toStdString();
|
sessionSettings.proxy_login = options->getProxyUsername().toStdString();
|
||||||
|
sessionSettings.proxy_password = options->getProxyPassword().toStdString();
|
||||||
|
#endif
|
||||||
|
#ifdef V_0_13
|
||||||
|
proxySettings.username = options->getProxyUsername().toStdString();
|
||||||
|
proxySettings.password = options->getProxyPassword().toStdString();
|
||||||
|
proxySettings.type = proxy_settings::http_pw;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxySettings.user_agent = "qBittorrent "VERSION;
|
#ifdef V_0_13
|
||||||
BTSession.setSessionSettings(proxySettings);
|
BTSession.setProxySettings(proxySettings);
|
||||||
|
#endif
|
||||||
|
sessionSettings.user_agent = "qBittorrent "VERSION;
|
||||||
|
BTSession.setSessionSettings(sessionSettings);
|
||||||
|
|
||||||
// Scan dir stuff
|
// Scan dir stuff
|
||||||
if(options->getScanDir().isNull()){
|
if(options->getScanDir().isNull()){
|
||||||
BTSession.disableDirectoryScanning();
|
BTSession.disableDirectoryScanning();
|
||||||
|
|
|
@ -229,8 +229,12 @@ void bittorrent::addTorrent(const QString& path, bool fromScanDir, const QString
|
||||||
resume_file.unsetf(std::ios_base::skipws);
|
resume_file.unsetf(std::ios_base::skipws);
|
||||||
resume_data = bdecode(std::istream_iterator<char>(resume_file), std::istream_iterator<char>());
|
resume_data = bdecode(std::istream_iterator<char>(resume_file), std::istream_iterator<char>());
|
||||||
fastResume=true;
|
fastResume=true;
|
||||||
}catch (invalid_encoding&) {}
|
}catch (invalid_encoding&) {
|
||||||
catch (fs::filesystem_error&) {}
|
std::cerr << "Encoding error while loading fastsume data for " << t.name().c_str() << '\n';
|
||||||
|
}
|
||||||
|
catch (fs::filesystem_error&) {
|
||||||
|
std::cerr << "Filesystem error while loading fastsume data for " << t.name().c_str() << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QString savePath = getSavePath(hash);
|
QString savePath = getSavePath(hash);
|
||||||
// Adding files to bittorrent session
|
// Adding files to bittorrent session
|
||||||
|
@ -627,6 +631,14 @@ void bittorrent::setSessionSettings(session_settings sessionSettings){
|
||||||
s->set_settings(sessionSettings);
|
s->set_settings(sessionSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef V_0_13
|
||||||
|
void bittorrent::setProxySettings(proxy_settings proxySettings){
|
||||||
|
s->set_peer_proxy(proxySettings);
|
||||||
|
s->set_web_seed_proxy(proxySettings);
|
||||||
|
s->set_tracker_proxy(proxySettings);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Read alerts sent by the bittorrent session
|
// Read alerts sent by the bittorrent session
|
||||||
void bittorrent::readAlerts(){
|
void bittorrent::readAlerts(){
|
||||||
// look at session alerts and display some infos
|
// look at session alerts and display some infos
|
||||||
|
@ -651,6 +663,9 @@ void bittorrent::readAlerts(){
|
||||||
emit trackerAuthenticationRequired(p->handle);
|
emit trackerAuthenticationRequired(p->handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fastresume_rejected_alert* p = dynamic_cast<fastresume_rejected_alert*>(a.get())) {
|
||||||
|
std::cerr << "Error while using fastresume data for " << p->handle.name() << ", msg: " << p->msg() << '\n';
|
||||||
|
}
|
||||||
a = s->pop_alert();
|
a = s->pop_alert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,9 @@ class bittorrent : public QObject{
|
||||||
void setGlobalRatio(float ratio);
|
void setGlobalRatio(float ratio);
|
||||||
void setDHTPort(int dht_port);
|
void setDHTPort(int dht_port);
|
||||||
void setSessionSettings(session_settings sessionSettings);
|
void setSessionSettings(session_settings sessionSettings);
|
||||||
|
#ifdef V_0_13
|
||||||
|
void setProxySettings(proxy_settings proxySettings);
|
||||||
|
#endif
|
||||||
void setDefaultSavePath(const QString& savepath);
|
void setDefaultSavePath(const QString& savepath);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|
|
@ -11,7 +11,7 @@ TARGET = qbittorrent
|
||||||
CONFIG += qt thread x11
|
CONFIG += qt thread x11
|
||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
DEFINES += VERSION=\\\"v0.9.3rc1\\\"
|
DEFINES += VERSION=\\\"v0.9.3rc2\\\"
|
||||||
DEFINES += VERSION_MAJOR=0
|
DEFINES += VERSION_MAJOR=0
|
||||||
DEFINES += VERSION_MINOR=9
|
DEFINES += VERSION_MINOR=9
|
||||||
DEFINES += VERSION_BUGFIX=3
|
DEFINES += VERSION_BUGFIX=3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue