diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-29 08:45:22 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-03-29 08:45:22 (GMT) |
commit | de306893b464ed0fa00f98488912fd6269713519 (patch) | |
tree | b1ef87ee3e5afa0722c9da87a45e11ff3f620fdc /src/network/access | |
parent | 4fb6cae4dd0c6a90008780df606abb8a9e73cb2c (diff) | |
parent | 473da75ed84651c70ae0d10e23f09e1a0e4ae799 (diff) | |
download | Qt-de306893b464ed0fa00f98488912fd6269713519.zip Qt-de306893b464ed0fa00f98488912fd6269713519.tar.gz Qt-de306893b464ed0fa00f98488912fd6269713519.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts:
mkspecs/common/symbian/symbian.conf
qmake/generators/symbian/symmake.cpp
src/3rdparty/webkit/WebCore/WebCore.pro
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 41 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel_p.h | 20 |
2 files changed, 44 insertions, 17 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 1d8224c..bc7684a 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -58,6 +58,28 @@ QT_BEGIN_NAMESPACE // TODO: Put channel specific stuff here so it does not polute qhttpnetworkconnection.cpp +QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel() + : socket(0) + , state(IdleState) + , reply(0) + , written(0) + , bytesTotal(0) + , resendCurrent(false) + , lastStatus(0) + , pendingEncrypt(false) + , reconnectAttempts(2) + , authMehtod(QAuthenticatorPrivate::None) + , proxyAuthMehtod(QAuthenticatorPrivate::None) +#ifndef QT_NO_OPENSSL + , ignoreAllSslErrors(false) +#endif + , pipeliningSupported(PipeliningSupportUnknown) + , connection(0) +{ + // Inlining this function in the header leads to compiler error on + // release-armv5, on at least timebox 9.2 and 10.1. +} + void QHttpNetworkConnectionChannel::init() { #ifndef QT_NO_OPENSSL @@ -865,7 +887,14 @@ void QHttpNetworkConnectionChannel::_q_disconnected() void QHttpNetworkConnectionChannel::_q_connected() { // improve performance since we get the request sent by the kernel ASAP - socket->setSocketOption(QAbstractSocket::LowDelayOption, 1); + //socket->setSocketOption(QAbstractSocket::LowDelayOption, 1); + // We have this commented out now. It did not have the effect we wanted. If we want to + // do this properly, Qt has to combine multiple HTTP requests into one buffer + // and send this to the kernel in one syscall and then the kernel immediately sends + // it as one TCP packet because of TCP_NODELAY. + // However, this code is currently not in Qt, so we rely on the kernel combining + // the requests into one TCP packet. + // not sure yet if it helps, but it makes sense socket->setSocketOption(QAbstractSocket::KeepAliveOption, 1); @@ -932,7 +961,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket errorCode = QNetworkReply::UnknownNetworkError; break; } - QPointer<QObject> that = connection; + QPointer<QHttpNetworkConnection> that = connection; QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString()); if (send2Reply) { if (reply) { @@ -987,8 +1016,16 @@ void QHttpNetworkConnectionChannel::_q_encryptedBytesWritten(qint64 bytes) sendRequest(); // otherwise we do nothing } + #endif +void QHttpNetworkConnectionChannel::setConnection(QHttpNetworkConnection *c) +{ + // Inlining this function in the header leads to compiler error on + // release-armv5, on at least timebox 9.2 and 10.1. + connection = c; +} + QT_END_NAMESPACE #include "moc_qhttpnetworkconnectionchannel_p.cpp" diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h index 5032d2b..51cb5e8 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -65,6 +65,7 @@ #include <private/qhttpnetworkrequest_p.h> #include <private/qhttpnetworkreply_p.h> +#include "qhttpnetworkconnection_p.h" #ifndef QT_NO_HTTP @@ -80,7 +81,6 @@ QT_BEGIN_NAMESPACE class QHttpNetworkRequest; class QHttpNetworkReply; class QByteArray; -class QHttpNetworkConnection; #ifndef HttpMessagePair typedef QPair<QHttpNetworkRequest, QHttpNetworkReply*> HttpMessagePair; @@ -127,18 +127,10 @@ public: QList<HttpMessagePair> alreadyPipelinedRequests; - QHttpNetworkConnectionChannel() : socket(0), state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false), - lastStatus(0), pendingEncrypt(false), reconnectAttempts(2), - authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None) -#ifndef QT_NO_OPENSSL - , ignoreAllSslErrors(false) -#endif - , pipeliningSupported(PipeliningSupportUnknown) - , connection(0) - {} - - void setConnection(QHttpNetworkConnection *c) {connection = c;} - QHttpNetworkConnection *connection; + QHttpNetworkConnectionChannel(); + + void setConnection(QHttpNetworkConnection *c); + QPointer<QHttpNetworkConnection> connection; void init(); void close(); @@ -187,8 +179,6 @@ public: #endif }; - - QT_END_NAMESPACE #endif // QT_NO_HTTP |