diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
commit | 4159ee840549df11287294f0928e90f35f3e06ff (patch) | |
tree | 4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /src/network/access | |
parent | 59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff) | |
parent | c8c39ecc37c156ac2677de09a26548dfc274b564 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
config.tests/unix/ptrsize.test
configure
src/corelib/global/qnamespace.h
src/network/socket/qabstractsocket.cpp
tests/auto/other/networkselftest/networkselftest.pro
Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkaccesscache.cpp | 6 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkcookiejar.cpp | 4 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 9 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/network/access/qnetworkaccesscache.cpp b/src/network/access/qnetworkaccesscache.cpp index 19316bda75..3d029f118b 100644 --- a/src/network/access/qnetworkaccesscache.cpp +++ b/src/network/access/qnetworkaccesscache.cpp @@ -151,7 +151,7 @@ void QNetworkAccessCache::linkEntry(const QByteArray &key) oldest = node; } - node->timestamp = QDateTime::currentDateTime().addSecs(ExpiryTime); + node->timestamp = QDateTime::currentDateTimeUtc().addSecs(ExpiryTime); newest = node; } @@ -190,7 +190,7 @@ void QNetworkAccessCache::updateTimer() if (!oldest) return; - int interval = QDateTime::currentDateTime().secsTo(oldest->timestamp); + int interval = QDateTime::currentDateTimeUtc().secsTo(oldest->timestamp); if (interval <= 0) { interval = 0; } else { @@ -216,7 +216,7 @@ bool QNetworkAccessCache::emitEntryReady(Node *node, QObject *target, const char void QNetworkAccessCache::timerEvent(QTimerEvent *) { // expire old items - QDateTime now = QDateTime::currentDateTime(); + const QDateTime now = QDateTime::currentDateTimeUtc(); while (oldest && oldest->timestamp < now) { Node *next = oldest->newer; diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 8a24fc55fd..2d8f192d03 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -901,7 +901,7 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt // We do not support RFC 2965 Set-Cookie2-style cookies QList<QNetworkCookie> result; - QDateTime now = QDateTime::currentDateTime().toUTC(); + const QDateTime now = QDateTime::currentDateTimeUtc(); int position = 0; const int length = cookieString.length(); diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp index 3cefb28f68..39f94a451f 100644 --- a/src/network/access/qnetworkcookiejar.cpp +++ b/src/network/access/qnetworkcookiejar.cpp @@ -216,7 +216,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const // It does not implement a very good cross-domain verification yet. Q_D(const QNetworkCookieJar); - QDateTime now = QDateTime::currentDateTime(); + const QDateTime now = QDateTime::currentDateTimeUtc(); QList<QNetworkCookie> result; bool isEncrypted = url.scheme().toLower() == QLatin1String("https"); @@ -265,7 +265,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const bool QNetworkCookieJar::insertCookie(const QNetworkCookie &cookie) { Q_D(QNetworkCookieJar); - QDateTime now = QDateTime::currentDateTime(); + const QDateTime now = QDateTime::currentDateTimeUtc(); bool isDeletion = !cookie.isSessionCookie() && cookie.expirationDate() < now; diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index c90cd288d2..2c31afc225 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -512,7 +512,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h return false; } - QDateTime currentDateTime = QDateTime::currentDateTime(); + QDateTime currentDateTime = QDateTime::currentDateTimeUtc(); QDateTime expirationDate = metaData.expirationDate(); bool response_is_fresh; @@ -545,7 +545,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h date_value = dateHeader.toTime_t(); } - int now = currentDateTime.toUTC().toTime_t(); + int now = currentDateTime.toTime_t(); int request_time = now; int response_time = now; @@ -1784,8 +1784,9 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation() #endif } else { #ifndef QT_NO_BEARERMANAGEMENT - QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)), - q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection); + if (session) + QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)), + q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection); #endif } |