diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-09 13:46:57 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-10 12:52:14 (GMT) |
commit | 0b646f2336a17aa6ae1cb4da89cba71c1adfd5ed (patch) | |
tree | cc81c1867adbea12a3727f885f9c25030d768e07 | |
parent | 28100e436bb662756c2cb0be471785bcd2dbef83 (diff) | |
download | Qt-0b646f2336a17aa6ae1cb4da89cba71c1adfd5ed.zip Qt-0b646f2336a17aa6ae1cb4da89cba71c1adfd5ed.tar.gz Qt-0b646f2336a17aa6ae1cb4da89cba71c1adfd5ed.tar.bz2 |
Network session support for proxy socket engines
The proxy socket engines forward the network session to the "real" socket
they use natively.
Reviewed-by: Markus Goetz
-rw-r--r-- | src/network/socket/qhttpsocketengine.cpp | 3 | ||||
-rw-r--r-- | src/network/socket/qsocks5socketengine.cpp | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 598efb6..c580b03 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -72,6 +72,9 @@ bool QHttpSocketEngine::initialize(QAbstractSocket::SocketType type, QAbstractSo setProtocol(protocol); setSocketType(type); d->socket = new QTcpSocket(this); +#ifndef QT_NO_BEARERMANAGEMENT + d->socket->setProperty("_q_networkSession", property("_q_networkSession")); +#endif // Explicitly disable proxying on the proxy socket itself to avoid // unwanted recursion. diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 91dfdf3..16c0faa 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -556,7 +556,9 @@ void QSocks5SocketEnginePrivate::initialize(Socks5Mode socks5Mode) udpData = new QSocks5UdpAssociateData; data = udpData; udpData->udpSocket = new QUdpSocket(q); +#ifndef QT_NO_BEARERMANAGEMENT udpData->udpSocket->setProperty("_q_networksession", q->property("_q_networksession")); +#endif udpData->udpSocket->setProxy(QNetworkProxy::NoProxy); QObject::connect(udpData->udpSocket, SIGNAL(readyRead()), q, SLOT(_q_udpSocketReadNotification()), @@ -568,7 +570,9 @@ void QSocks5SocketEnginePrivate::initialize(Socks5Mode socks5Mode) } data->controlSocket = new QTcpSocket(q); +#ifndef QT_NO_BEARERMANAGEMENT data->controlSocket->setProperty("_q_networksession", q->property("_q_networksession")); +#endif data->controlSocket->setProxy(QNetworkProxy::NoProxy); QObject::connect(data->controlSocket, SIGNAL(connected()), q, SLOT(_q_controlSocketConnected()), Qt::DirectConnection); @@ -1378,7 +1382,9 @@ bool QSocks5SocketEngine::bind(const QHostAddress &address, quint16 port) 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, d->data->controlSocket->localAddress(), dummy.localPort()) != 0 |