diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-22 08:28:13 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-23 10:18:39 (GMT) |
commit | e5207123dff4eb6b6eaea244d697ec14c08a502e (patch) | |
tree | 716a750809a5a52bdb754d21602d38efe1832730 /src/network | |
parent | 6844c1b37514a7ceed2378049f8bad887f58d4bf (diff) | |
download | Qt-e5207123dff4eb6b6eaea244d697ec14c08a502e.zip Qt-e5207123dff4eb6b6eaea244d697ec14c08a502e.tar.gz Qt-e5207123dff4eb6b6eaea244d697ec14c08a502e.tar.bz2 |
QNAM HTTP Code: Use new LowDelay socket option
Reviewed-by: Thiago
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index c824fac..3f0b244 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -409,6 +409,7 @@ bool QHttpNetworkConnectionPrivate::sendRequest(QAbstractSocket *socket) channels[i].bytesTotal = channels[i].request.contentLength(); } else { + socket->flush(); // ### Remove this when pipelining is implemented. We want less TCP packets! channels[i].state = WaitingState; break; } @@ -1198,6 +1199,10 @@ void QHttpNetworkConnectionPrivate::_q_connected() QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(q->sender()); if (!socket) return; // ### error + + // improve performance since we get the request sent by the kernel ASAP + socket->setSocketOption(QAbstractSocket::LowDelayOption, 1); + int i = indexOf(socket); // ### FIXME: if the server closes the connection unexpectedly, we shouldn't send the same broken request again! //channels[i].reconnectAttempts = 2; |