Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/access/qhttpnetworkheader.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    6161{
    6262    bool ok = false;
    63     QByteArray value = headerField("content-length");
     63    // We are not using the headerField() method here because servers might send us multiple content-length
     64    // headers which is crap (see QTBUG-15311). Therefore just take the first content-length header field.
     65    QByteArray value;
     66    QList<QPair<QByteArray, QByteArray> >::ConstIterator it = fields.constBegin(),
     67                                                        end = fields.constEnd();
     68    for ( ; it != end; ++it)
     69        if (qstricmp("content-length", it->first) == 0) {
     70            value = it->second;
     71            break;
     72        }
     73
    6474    qint64 length = value.toULongLong(&ok);
    6575    if (ok)
Note: See TracChangeset for help on using the changeset viewer.