Convert features.socks5 to QT_[REQUIRE_]CONFIG
The sources were already added conditionally in the project file since 179fe5981fa. Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
029e5cde33
commit
c6b9c6e5f2
@ -227,7 +227,9 @@
|
|||||||
#ifndef QT_NO_NETWORKPROXY
|
#ifndef QT_NO_NETWORKPROXY
|
||||||
|
|
||||||
#include "private/qnetworkrequest_p.h"
|
#include "private/qnetworkrequest_p.h"
|
||||||
|
#if QT_CONFIG(socks5)
|
||||||
#include "private/qsocks5socketengine_p.h"
|
#include "private/qsocks5socketengine_p.h"
|
||||||
|
#endif
|
||||||
#include "private/qhttpsocketengine_p.h"
|
#include "private/qhttpsocketengine_p.h"
|
||||||
#include "qauthenticator.h"
|
#include "qauthenticator.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
@ -251,7 +253,7 @@ public:
|
|||||||
: mutex(QMutex::Recursive)
|
: mutex(QMutex::Recursive)
|
||||||
, applicationLevelProxy(0)
|
, applicationLevelProxy(0)
|
||||||
, applicationLevelProxyFactory(0)
|
, applicationLevelProxyFactory(0)
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
, socks5SocketEngineHandler(0)
|
, socks5SocketEngineHandler(0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_HTTP
|
#ifndef QT_NO_HTTP
|
||||||
@ -263,7 +265,7 @@ public:
|
|||||||
, useSystemProxies(false)
|
, useSystemProxies(false)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
socks5SocketEngineHandler = new QSocks5SocketEngineHandler();
|
socks5SocketEngineHandler = new QSocks5SocketEngineHandler();
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_HTTP
|
#ifndef QT_NO_HTTP
|
||||||
@ -275,7 +277,7 @@ public:
|
|||||||
{
|
{
|
||||||
delete applicationLevelProxy;
|
delete applicationLevelProxy;
|
||||||
delete applicationLevelProxyFactory;
|
delete applicationLevelProxyFactory;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
delete socks5SocketEngineHandler;
|
delete socks5SocketEngineHandler;
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_HTTP
|
#ifndef QT_NO_HTTP
|
||||||
@ -335,7 +337,7 @@ private:
|
|||||||
QMutex mutex;
|
QMutex mutex;
|
||||||
QNetworkProxy *applicationLevelProxy;
|
QNetworkProxy *applicationLevelProxy;
|
||||||
QNetworkProxyFactory *applicationLevelProxyFactory;
|
QNetworkProxyFactory *applicationLevelProxyFactory;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
QSocks5SocketEngineHandler *socks5SocketEngineHandler;
|
QSocks5SocketEngineHandler *socks5SocketEngineHandler;
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_HTTP
|
#ifndef QT_NO_HTTP
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
|
|
||||||
#include "qsocks5socketengine_p.h"
|
#include "qsocks5socketengine_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_SOCKS5
|
|
||||||
|
|
||||||
#include "qtcpsocket.h"
|
#include "qtcpsocket.h"
|
||||||
#include "qudpsocket.h"
|
#include "qudpsocket.h"
|
||||||
#include "qtcpserver.h"
|
#include "qtcpserver.h"
|
||||||
@ -1938,6 +1936,4 @@ QAbstractSocketEngine *QSocks5SocketEngineHandler::createSocketEngine(qintptr so
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_NO_SOCKS5
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -55,9 +55,9 @@
|
|||||||
#include "qabstractsocketengine_p.h"
|
#include "qabstractsocketengine_p.h"
|
||||||
#include "qnetworkproxy.h"
|
#include "qnetworkproxy.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_REQUIRE_CONFIG(socks5);
|
||||||
|
|
||||||
#ifndef QT_NO_SOCKS5
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QSocks5SocketEnginePrivate;
|
class QSocks5SocketEnginePrivate;
|
||||||
|
|
||||||
@ -291,7 +291,6 @@ public:
|
|||||||
virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent) Q_DECL_OVERRIDE;
|
virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent) Q_DECL_OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
#endif // QT_NO_SOCKS5
|
|
||||||
#endif // QSOCKS5SOCKETENGINE_H
|
#endif // QSOCKS5SOCKETENGINE_H
|
||||||
|
@ -186,7 +186,7 @@ void tst_QFtp::initTestCase_data()
|
|||||||
QTest::addColumn<bool>("setSession");
|
QTest::addColumn<bool>("setSession");
|
||||||
|
|
||||||
QTest::newRow("WithoutProxy") << false << 0 << false;
|
QTest::newRow("WithoutProxy") << false << 0 << false;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy) << false;
|
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy) << false;
|
||||||
#endif
|
#endif
|
||||||
//### doesn't work well yet.
|
//### doesn't work well yet.
|
||||||
@ -194,7 +194,7 @@ void tst_QFtp::initTestCase_data()
|
|||||||
|
|
||||||
#ifndef QT_NO_BEARERMANAGEMENT
|
#ifndef QT_NO_BEARERMANAGEMENT
|
||||||
QTest::newRow("WithoutProxyWithSession") << false << 0 << true;
|
QTest::newRow("WithoutProxyWithSession") << false << 0 << true;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
QTest::newRow("WithSocks5ProxyAndSession") << true << int(QNetworkProxy::Socks5Proxy) << true;
|
QTest::newRow("WithSocks5ProxyAndSession") << true << int(QNetworkProxy::Socks5Proxy) << true;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,7 +149,7 @@ void tst_QTcpServer::initTestCase_data()
|
|||||||
QTest::addColumn<int>("proxyType");
|
QTest::addColumn<int>("proxyType");
|
||||||
|
|
||||||
QTest::newRow("WithoutProxy") << false << 0;
|
QTest::newRow("WithoutProxy") << false << 0;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
|
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ void tst_QUdpSocket::initTestCase_data()
|
|||||||
QTest::addColumn<int>("proxyType");
|
QTest::addColumn<int>("proxyType");
|
||||||
|
|
||||||
QTest::newRow("WithoutProxy") << false << 0;
|
QTest::newRow("WithoutProxy") << false << 0;
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
if (!newTestServer)
|
if (!newTestServer)
|
||||||
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
|
QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
|
||||||
#endif
|
#endif
|
||||||
@ -233,14 +233,14 @@ void tst_QUdpSocket::init()
|
|||||||
{
|
{
|
||||||
QFETCH_GLOBAL(bool, setProxy);
|
QFETCH_GLOBAL(bool, setProxy);
|
||||||
if (setProxy) {
|
if (setProxy) {
|
||||||
#ifndef QT_NO_SOCKS5
|
#if QT_CONFIG(socks5)
|
||||||
QFETCH_GLOBAL(int, proxyType);
|
QFETCH_GLOBAL(int, proxyType);
|
||||||
if (proxyType == QNetworkProxy::Socks5Proxy) {
|
if (proxyType == QNetworkProxy::Socks5Proxy) {
|
||||||
QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
|
QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
QSKIP("No proxy support");
|
QSKIP("No proxy support");
|
||||||
#endif // !QT_NO_SOCKS5
|
#endif // QT_CONFIG(socks5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user