diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-02-17 13:27:45 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-02-17 13:39:08 (GMT) |
commit | 44ef44bc3826c78a10bcf02d3357bf6332c6c3ed (patch) | |
tree | 53053bdacc56009825ab24d3ed313390a9a40d4f /src/network/bearer | |
parent | 42adaaa0dffa9df387a145181bc97ee3bb9a4c7b (diff) | |
download | Qt-44ef44bc3826c78a10bcf02d3357bf6332c6c3ed.zip Qt-44ef44bc3826c78a10bcf02d3357bf6332c6c3ed.tar.gz Qt-44ef44bc3826c78a10bcf02d3357bf6332c6c3ed.tar.bz2 |
Explicit network session for QNetworkAccessManager
Implemented a tunnel to get the QNetworkSession from QNetworkAccessManager
down to the socket engine. This is currently a private API for QNAM.
This patch only implements the FTP backend - the other backends are to
follow.
On Symbian, the native socket engine will extract the native session
(RConnection) from the QNetworkSession implementation, and use that to
open sockets using the explicitly specified session.
When no session is specified on the socket (default for networking usage
outside of QNAM) then the socket is opened with no RConnection specified,
which allows the IP stack to find any route via an open interface.
The QFtp autotest is enhanced to test QFtp with an explicit session as well
as implicit connectivity (where a QNetworkSession is opened by the user,
and then QFtp is used without a specified connection).
This autotest gives better coverage than the FTP test cases in QNetworkReply.
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/bearer')
-rw-r--r-- | src/network/bearer/qnetworksession.cpp | 9 | ||||
-rw-r--r-- | src/network/bearer/qnetworksession_p.h | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index 553410e..0ddd10a 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -705,6 +705,15 @@ void QNetworkSession::disconnectNotify(const char *signal) d->setALREnabled(false); } +#ifdef Q_OS_SYMBIAN +RConnection* QNetworkSessionPrivate::nativeSession(QNetworkSession &s) +{ + if (!s.d) + return 0; + return s.d->nativeSession(); +} +#endif + #include "moc_qnetworksession.cpp" QT_END_NAMESPACE diff --git a/src/network/bearer/qnetworksession_p.h b/src/network/bearer/qnetworksession_p.h index 707ad37..e2fcfe6 100644 --- a/src/network/bearer/qnetworksession_p.h +++ b/src/network/bearer/qnetworksession_p.h @@ -55,9 +55,14 @@ #include "qnetworksession.h" #include "qnetworkconfiguration_p.h" +#include "QtCore/qsharedpointer.h" #ifndef QT_NO_BEARERMANAGEMENT +#ifdef Q_OS_SYMBIAN +class RConnection; +#endif + QT_BEGIN_NAMESPACE class Q_NETWORK_EXPORT QNetworkSessionPrivate : public QObject @@ -102,6 +107,10 @@ public: virtual quint64 bytesReceived() const = 0; virtual quint64 activeTime() const = 0; +#ifdef Q_OS_SYMBIAN + static RConnection* nativeSession(QNetworkSession&); + virtual RConnection* nativeSession() = 0; +#endif protected: inline QNetworkConfigurationPrivatePointer privateConfiguration(const QNetworkConfiguration &config) const { @@ -145,6 +154,8 @@ protected: QT_END_NAMESPACE +Q_DECLARE_METATYPE(QSharedPointer<QNetworkSession>) + #endif // QT_NO_BEARERMANAGEMENT #endif // QNETWORKSESSIONPRIVATE_H |