summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-07-07 08:50:33 (GMT)
committeraxis <qt-info@nokia.com>2009-07-07 08:50:33 (GMT)
commit1e192edd72789241e7397dcbc5ee326b2aed5790 (patch)
tree430961aed08cdfa25717bde84c3f74a2f75673fe /src/network
parent2aac0c8b71fffd7c0335c1429bd1f2405adaa5e7 (diff)
parent343e8b7e75c98a4fd1b692a230de8d1132988705 (diff)
downloadQt-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')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp10
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h3
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp6
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/network/socket/qlocalserver_tcp.cpp2
5 files changed, 15 insertions, 8 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 {
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index c2743ef..103b948 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -366,7 +366,7 @@ static QNetworkProxy::Capabilities defaultCapabilitiesForType(QNetworkProxy::Pro
int(QNetworkProxy::HostNameLookupCapability)),
};
- if (int(type) < 0 && int(type) > int(QNetworkProxy::FtpCachingProxy))
+ if (int(type) < 0 || int(type) > int(QNetworkProxy::FtpCachingProxy))
type = QNetworkProxy::DefaultProxy;
return QNetworkProxy::Capabilities(defaults[int(type)]);
}
diff --git a/src/network/socket/qlocalserver_tcp.cpp b/src/network/socket/qlocalserver_tcp.cpp
index b248f2f..bcf822e 100644
--- a/src/network/socket/qlocalserver_tcp.cpp
+++ b/src/network/socket/qlocalserver_tcp.cpp
@@ -92,7 +92,7 @@ void QLocalServerPrivate::waitForNewConnection(int msec, bool *timedOut)
{
if (pendingConnections.isEmpty())
tcpServer.waitForNewConnection(msec, timedOut);
- else
+ else if (timedOut)
*timedOut = false;
}