summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qhttpsocketengine.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-06 12:44:20 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-06 12:44:20 (GMT)
commitd63accf173ed58c7746ecd1e3a40ecac263f186f (patch)
tree87573a93956f4844bde449bde3161972db826eb1 /src/network/socket/qhttpsocketengine.cpp
parentb0fd5e82c0d7d62a01cce2c1cdcb925bc5a34182 (diff)
parente8b3defc466fff9110ee00b6e730d405cde52abc (diff)
downloadQt-d63accf173ed58c7746ecd1e3a40ecac263f186f.zip
Qt-d63accf173ed58c7746ecd1e3a40ecac263f186f.tar.gz
Qt-d63accf173ed58c7746ecd1e3a40ecac263f186f.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (27 commits) Fix QT_NO_CONTEXTMENU Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 865abd2871c801c1d3d0f4eebd985b2daab89ebe ) Fix license check failure. QHttpSocketEngine: Remove unneeded code doc: Clarified that .lnk files are System files on Windows. doc: Clarified that the scene owns its items and destroys them. QAbstractSocket: Fix warnings when compiling with QABSTRACTSOCKET_DEBUG QAbstractSocket: Warn when wrong QHostInfo was received doc: Fixed references to currsor position(). Prevent a crash when creating an inputContext from the QApplication dtor. doc: Added some missing macro descriptions. Small optimization in QIODevice::readAll() doc: Added note explaining grabMouse() for Cocoa and Carbon. doc: Replaced usses of rootState() with state machine pointer. doc: Fixed typo. doc: Clarified which values were added in Qt 4.4. Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 5d691a1c283938dfbdf891883d8cff8a6ef040bf ) doc: Clarified next and previous activation order. Fix typo in QFSFileEnginePrivate::canonicalized tst_qhostinfo benchmark: Fix license header ...
Diffstat (limited to 'src/network/socket/qhttpsocketengine.cpp')
-rw-r--r--src/network/socket/qhttpsocketengine.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 5c28318..635a0c6 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -212,28 +212,14 @@ qint64 QHttpSocketEngine::bytesAvailable() const
qint64 QHttpSocketEngine::read(char *data, qint64 maxlen)
{
Q_D(QHttpSocketEngine);
- qint64 bytesRead = 0;
-
- if (!d->readBuffer.isEmpty()) {
- // Read as much from the buffer as we can.
- bytesRead = qMin((qint64)d->readBuffer.size(), maxlen);
- memcpy(data, d->readBuffer.constData(), bytesRead);
- data += bytesRead;
- maxlen -= bytesRead;
- d->readBuffer = d->readBuffer.mid(bytesRead);
- }
-
- qint64 bytesReadFromSocket = d->socket->read(data, maxlen);
+ qint64 bytesRead = d->socket->read(data, maxlen);
if (d->socket->state() == QAbstractSocket::UnconnectedState
&& d->socket->bytesAvailable() == 0) {
emitReadNotification();
}
- if (bytesReadFromSocket > 0) {
- // Add to what we read so far.
- bytesRead += bytesReadFromSocket;
- } else if (bytesRead == 0 && bytesReadFromSocket == -1) {
+ if (bytesRead == -1) {
// If nothing has been read so far, and the direct socket read
// failed, return the socket's error. Otherwise, fall through and
// return as much as we read so far.
@@ -560,7 +546,7 @@ void QHttpSocketEngine::slotSocketReadNotification()
}
QHttpResponseHeader responseHeader(QString::fromLatin1(d->readBuffer));
- d->readBuffer.clear();
+ d->readBuffer.clear(); // we parsed the proxy protocol response. from now on direct socket reading will be done
int statusCode = responseHeader.statusCode();
if (statusCode == 200) {