mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 19:57:45 +03:00
- Do not use SOCKS5 proxies in downloadThread.cpp (does not work)
This commit is contained in:
parent
349e58fa22
commit
8ecf79e91c
1 changed files with 14 additions and 12 deletions
|
@ -60,18 +60,20 @@ subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(par
|
||||||
// Proxy enabled
|
// Proxy enabled
|
||||||
QString IP = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString();
|
QString IP = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString();
|
||||||
qDebug("Set proxy, hostname: %s, port: %d", IP.toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
qDebug("Set proxy, hostname: %s, port: %d", IP.toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
||||||
if((intValue==1 || intValue==3) && !IP.startsWith("http://", Qt::CaseInsensitive)) {
|
if(intValue==1 || intValue==3) {
|
||||||
// HTTP Proxy with missing leading http://
|
if(!IP.startsWith("http://", Qt::CaseInsensitive)) {
|
||||||
url_stream->setProxy((QString("http://")+settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString()).toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
// HTTP Proxy without leading http://
|
||||||
}else {
|
url_stream->setProxy((QString("http://")+settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString()).toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
||||||
url_stream->setProxy(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString().toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
}else {
|
||||||
}
|
url_stream->setProxy(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString().toUtf8().data(), settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toInt());
|
||||||
if(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Authentication"), false).toBool()) {
|
}
|
||||||
qDebug("Proxy auth required");
|
if(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Authentication"), false).toBool()) {
|
||||||
// Authentication required
|
qDebug("Proxy auth required");
|
||||||
url_stream->setProxyUser(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Username"), QString()).toString().toUtf8().data());
|
// Authentication required
|
||||||
url_stream->setProxyPassword(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Password"), QString()).toString().toUtf8().data());
|
url_stream->setProxyUser(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Username"), QString()).toString().toUtf8().data());
|
||||||
}
|
url_stream->setProxyPassword(settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Password"), QString()).toString().toUtf8().data());
|
||||||
|
}
|
||||||
|
} //TODO: Support SOCKS5 proxies
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue