diff options
author | axis <qt-info@nokia.com> | 2009-07-07 08:50:33 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-07-07 08:50:33 (GMT) |
commit | 1e192edd72789241e7397dcbc5ee326b2aed5790 (patch) | |
tree | 430961aed08cdfa25717bde84c3f74a2f75673fe /src/network/access | |
parent | 2aac0c8b71fffd7c0335c1429bd1f2405adaa5e7 (diff) | |
parent | 343e8b7e75c98a4fd1b692a230de8d1132988705 (diff) | |
download | Qt-1e192edd72789241e7397dcbc5ee326b2aed5790.zip Qt-1e192edd72789241e7397dcbc5ee326b2aed5790.tar.gz Qt-1e192edd72789241e7397dcbc5ee326b2aed5790.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
configure.exe
src/network/access/qhttpnetworkconnection_p.h
tests/auto/qstyle/qstyle.pro
tests/auto/qstyle/tst_qstyle.cpp
tools/configure/configureapp.cpp
configure.exe will be recompiled in next commit. Took ours.
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 10 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnection_p.h | 3 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 6 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 7755721..d53f93d 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -137,7 +137,9 @@ int QHttpNetworkConnectionPrivate::indexOf(QAbstractSocket *socket) const for (int i = 0; i < channelCount; ++i) if (channels[i].socket == socket) return i; - return -1; + + qFatal("Called with unknown socket object."); + return 0; } bool QHttpNetworkConnectionPrivate::isSocketBusy(QAbstractSocket *socket) const @@ -517,7 +519,7 @@ void QHttpNetworkConnectionPrivate::receiveReply(QAbstractSocket *socket, QHttpN // try to reconnect/resend before sending an error. if (channels[i].reconnectAttempts-- > 0) { resendCurrentRequest(socket); - } else { + } else if (reply) { reply->d_func()->errorString = errorDetail(QNetworkReply::RemoteHostClosedError, socket); emit reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString); QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); @@ -790,6 +792,7 @@ void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, Q_ASSERT(socket); int i = indexOf(socket); + if (channels[i].authMehtod != QAuthenticatorPrivate::None) { if (!(channels[i].authMehtod == QAuthenticatorPrivate::Ntlm && channels[i].lastStatus != 401)) { QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].authenticator); @@ -1324,7 +1327,8 @@ void QHttpNetworkConnectionPrivate::_q_encrypted() QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(q->sender()); if (!socket) return; // ### error - channels[indexOf(socket)].state = IdleState; + int i = indexOf(socket); + channels[i].state = IdleState; sendRequest(socket); } diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index e0ab2e7..feb974c 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -245,7 +245,8 @@ public: bool ignoreSSLErrors; #endif Channel() : socket(0), state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false), - reconnectAttempts(2), authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None) + lastStatus(0), pendingEncrypt(false), reconnectAttempts(2), + authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None) #ifndef QT_NO_OPENSSL , ignoreSSLErrors(false) #endif diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index d903d03..63a9c2d 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -52,10 +52,12 @@ QT_BEGIN_NAMESPACE inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate() - : copyDevice(0), networkCache(0), + : backend(0), outgoingData(0), + copyDevice(0), networkCache(0), cacheEnabled(false), cacheSaveDevice(0), notificationHandlingPaused(false), bytesDownloaded(0), lastBytesDownloaded(-1), bytesUploaded(-1), + httpStatusCode(0), state(Idle) { } @@ -129,7 +131,7 @@ void QNetworkReplyImplPrivate::_q_sourceReadChannelFinished() void QNetworkReplyImplPrivate::_q_copyReadyRead() { Q_Q(QNetworkReplyImpl); - if (!copyDevice && !q->isOpen()) + if (!copyDevice || !q->isOpen()) return; forever { |