Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/socket/qhttpsocketengine.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    213213{
    214214    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);
    227216
    228217    if (d->socket->state() == QAbstractSocket::UnconnectedState
     
    231220    }
    232221
    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) {
    237223        // If nothing has been read so far, and the direct socket read
    238224        // failed, return the socket's error. Otherwise, fall through and
     
    561547
    562548    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
    564550
    565551    int statusCode = responseHeader.statusCode();
Note: See TracChangeset for help on using the changeset viewer.