summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qsocks5socketengine.cpp
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2018-11-06 16:51:31 +0300
committerAlexandr Akulich <akulichalexander@gmail.com>2018-11-07 18:38:23 +0000
commit7b9de1d4da67573d6bb0a6bf2fb0cdd1b7fb86a3 (patch)
tree94e48bd97f4680d1596b8d25811237f32c48a277 /src/network/socket/qsocks5socketengine.cpp
parenta545b85bdd8d227c63dda07728de4d1bac285cf5 (diff)
QSocks5SocketEngine: Remove too optimistic check for UDP proxy setup
The engine used to send a UDP datagram to the local address to check the proxy setup, but the check fails in case of the proxy hosted in WAN and the local address hidden behind a NAT. In other words the check fails because a public proxy hosted somewhere in internet has no access to local addresses such as 192.168.1.2. Remove the check to fix the issue; we still have other means to detect network errors. Change-Id: Ib6df263c87ebd7d6e88a0b5e024e78a559995234 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/socket/qsocks5socketengine.cpp')
-rw-r--r--src/network/socket/qsocks5socketengine.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index a07ea65046..dd2bc90855 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -1383,23 +1383,6 @@ bool QSocks5SocketEngine::bind(const QHostAddress &addr, quint16 port)
d->localAddress = QHostAddress();
d->udpData->associatePort = d->localPort;
d->localPort = 0;
- QUdpSocket dummy;
-#ifndef QT_NO_BEARERMANAGEMENT
- dummy.setProperty("_q_networksession", property("_q_networksession"));
-#endif
- dummy.setProxy(QNetworkProxy::NoProxy);
- if (!dummy.bind()
- || writeDatagram(0,0, QIpPacketHeader(d->data->controlSocket->localAddress(), dummy.localPort())) != 0
- || !dummy.waitForReadyRead(qt_subtract_from_timeout(msecs, stopWatch.elapsed()))
- || dummy.readDatagram(0,0, &d->localAddress, &d->localPort) != 0) {
- QSOCKS5_DEBUG << "udp actual address and port lookup failed";
- setState(QAbstractSocket::UnconnectedState);
- setError(dummy.error(), dummy.errorString());
- d->data->controlSocket->close();
- //### reset and error
- return false;
- }
- QSOCKS5_DEBUG << "udp actual address and port" << d->localAddress << ':' << d->localPort;
return true;
#endif // QT_NO_UDPSOCKET
}