From e5207123dff4eb6b6eaea244d697ec14c08a502e Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 22 Jul 2009 10:28:13 +0200 Subject: QNAM HTTP Code: Use new LowDelay socket option Reviewed-by: Thiago --- src/network/access/qhttpnetworkconnection.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(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; -- cgit v0.12