diff options
author | Peter Hartmann <phartmann@blackberry.com> | 2013-04-30 14:48:22 +0200 |
---|---|---|
committer | Peter Hartmann <phartmann@blackberry.com> | 2013-06-03 12:50:15 +0200 |
commit | 054e85bfdae2af37f0c2ee17d131e0b3cb2d2f25 (patch) | |
tree | ab51c7b9c845455c94a3997c23da2bb77d0673f1 /src/network/access/qhttpnetworkrequest.cpp | |
parent | 84eb6200ff0850db8bab8d32b70e571ca9db2bda (diff) | |
download | qt4-tools-054e85bfdae2af37f0c2ee17d131e0b3cb2d2f25.tar.gz |
[BB10-internal] QSslConfiguration: add API to persist and resume SSL sessions4.8-bb10
Session tickets can be cached on the client side for hours (e.g.
graph.facebook.com: ~ 24 hours, api.twitter.com: 4 hours), because the
server does not need to maintain state.
We need public API for it so an application can cache the session (e.g.
to disk) and resume a session already with the 1st handshake, saving
one network round trip.
Task-number: QTBUG-20668
(backport of commit 3be197881f100d1c3c8f3ce00501d7a32eb51119)
Change-Id: I4c7f3a749edf0012b52deeb495706e550d24c42d
Signed-off-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src/network/access/qhttpnetworkrequest.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkrequest.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp index 3fc6229e29..d437f6363a 100644 --- a/src/network/access/qhttpnetworkrequest.cpp +++ b/src/network/access/qhttpnetworkrequest.cpp @@ -50,6 +50,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Oper QHttpNetworkRequest::Priority pri, const QUrl &newUrl) : QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0), autoDecompress(false), pipeliningAllowed(false), withCredentials(true) + , m_cacheSslSession(false) { } @@ -64,6 +65,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest customVerb = other.customVerb; withCredentials = other.withCredentials; ssl = other.ssl; + m_cacheSslSession = other.m_cacheSslSession; } QHttpNetworkRequestPrivate::~QHttpNetworkRequestPrivate() @@ -75,7 +77,8 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (ssl == other.ssl) - && (uploadByteDevice == other.uploadByteDevice); + && (uploadByteDevice == other.uploadByteDevice) + && (m_cacheSslSession == other.m_cacheSslSession); } QByteArray QHttpNetworkRequestPrivate::methodName() const @@ -311,6 +314,16 @@ QNonContiguousByteDevice* QHttpNetworkRequest::uploadByteDevice() const return d->uploadByteDevice; } +bool QHttpNetworkRequest::cacheSslSession() +{ + return d->m_cacheSslSession; +} + +void QHttpNetworkRequest::setCacheSslSession(bool cacheSession) +{ + d->m_cacheSslSession = cacheSession; +} + int QHttpNetworkRequest::majorVersion() const { return 1; |