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/access/qhttpnetworkconnection.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    416416        break;
    417417    }
    418     QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
     418    // this used to be called via invokeMethod and a QueuedConnection
     419    _q_startNextRequest();
    419420    return reply;
    420421}
     
    422423void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)
    423424{
    424     Q_Q(QHttpNetworkConnection);
    425 
    426425    QHttpNetworkRequest request = pair.first;
    427426    switch (request.priority()) {
     
    434433        break;
    435434    }
    436     QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
     435    // this used to be called via invokeMethod and a QueuedConnection
     436    _q_startNextRequest();
    437437}
    438438
     
    565565
    566566
    567 QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket)
     567QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket,
     568                                                   const QString &extraDetail)
    568569{
    569570    Q_ASSERT(socket);
     
    582583        break;
    583584    case QNetworkReply::TimeoutError:
    584         errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
     585        errorString = QLatin1String(QT_TRANSLATE_NOOP("Q"));
    585586        break;
    586587    case QNetworkReply::ProxyAuthenticationRequiredError:
     
    601602    default:
    602603        // all other errors are treated as QNetworkReply::UnknownNetworkError
    603         errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
     604        errorString = ;
    604605        break;
    605606    }
     
    692693        }
    693694    }
     695
     696
     697
    694698    QAbstractSocket *socket = 0;
    695699    for (int i = 0; i < channelCount; ++i) {
    696700        QAbstractSocket *chSocket = channels[i].socket;
    697         // send the request using the idle socket
    698         if (!channels[i].isSocketBusy()) {
     701        // socket
     702        if (!channels[i].isSocketBusy()) {
    699703            socket = chSocket;
     704
    700705            break;
    701706        }
    702707    }
    703708
    704     // this socket is free,
    705     if (socket)
    706         dequeueAndSendRequest(socket);
     709    if (!socket) {
     710        for (int i = 0; i < channelCount; ++i) {
     711            QAbstractSocket *chSocket = channels[i].socket;
     712            // try to get a free unconnected socket
     713            if (!channels[i].isSocketBusy()) {
     714                socket = chSocket;
     715                dequeueAndSendRequest(socket);
     716                break;
     717            }
     718        }
     719    }
    707720
    708721    // try to push more into all sockets
     
    732745}
    733746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
    734757
    735758QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 port, bool encrypt, QObject *parent)
Note: See TracChangeset for help on using the changeset viewer.