Changeset 651 for trunk/src/network/socket/qhttpsocketengine.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/network/socket/qhttpsocketengine.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 213 213 { 214 214 Q_D(QHttpSocketEngine); 215 qint64 bytesRead = 0; 216 217 if (!d->readBuffer.isEmpty()) { 218 // Read as much from the buffer as we can. 219 bytesRead = qMin((qint64)d->readBuffer.size(), maxlen); 220 memcpy(data, d->readBuffer.constData(), bytesRead); 221 data += bytesRead; 222 maxlen -= bytesRead; 223 d->readBuffer = d->readBuffer.mid(bytesRead); 224 } 225 226 qint64 bytesReadFromSocket = d->socket->read(data, maxlen); 215 qint64 bytesRead = d->socket->read(data, maxlen); 227 216 228 217 if (d->socket->state() == QAbstractSocket::UnconnectedState … … 231 220 } 232 221 233 if (bytesReadFromSocket > 0) { 234 // Add to what we read so far. 235 bytesRead += bytesReadFromSocket; 236 } else if (bytesRead == 0 && bytesReadFromSocket == -1) { 222 if (bytesRead == -1) { 237 223 // If nothing has been read so far, and the direct socket read 238 224 // failed, return the socket's error. Otherwise, fall through and … … 561 547 562 548 QHttpResponseHeader responseHeader(QString::fromLatin1(d->readBuffer)); 563 d->readBuffer.clear(); 549 d->readBuffer.clear(); // we parsed the proxy protocol response. from now on direct socket reading will be done 564 550 565 551 int statusCode = responseHeader.statusCode();
Note:
See TracChangeset
for help on using the changeset viewer.