Changeset 651 for trunk/src/network/access/qhttpnetworkconnection.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/access/qhttpnetworkconnection.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 416 416 break; 417 417 } 418 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); 418 // this used to be called via invokeMethod and a QueuedConnection 419 _q_startNextRequest(); 419 420 return reply; 420 421 } … … 422 423 void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair) 423 424 { 424 Q_Q(QHttpNetworkConnection);425 426 425 QHttpNetworkRequest request = pair.first; 427 426 switch (request.priority()) { … … 434 433 break; 435 434 } 436 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); 435 // this used to be called via invokeMethod and a QueuedConnection 436 _q_startNextRequest(); 437 437 } 438 438 … … 565 565 566 566 567 QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket) 567 QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket, 568 const QString &extraDetail) 568 569 { 569 570 Q_ASSERT(socket); … … 582 583 break; 583 584 case QNetworkReply::TimeoutError: 584 errorString = QLatin1String(QT_TRANSLATE_NOOP("Q Http", "HTTP request failed"));585 errorString = QLatin1String(QT_TRANSLATE_NOOP("Q")); 585 586 break; 586 587 case QNetworkReply::ProxyAuthenticationRequiredError: … … 601 602 default: 602 603 // all other errors are treated as QNetworkReply::UnknownNetworkError 603 errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));604 errorString = ; 604 605 break; 605 606 } … … 692 693 } 693 694 } 695 696 697 694 698 QAbstractSocket *socket = 0; 695 699 for (int i = 0; i < channelCount; ++i) { 696 700 QAbstractSocket *chSocket = channels[i].socket; 697 // send the request using the idlesocket698 if (!channels[i].isSocketBusy() ) {701 // socket 702 if (!channels[i].isSocketBusy()) { 699 703 socket = chSocket; 704 700 705 break; 701 706 } 702 707 } 703 708 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 } 707 720 708 721 // try to push more into all sockets … … 732 745 } 733 746 747 748 749 750 751 752 753 754 755 756 734 757 735 758 QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 port, bool encrypt, QObject *parent)
Note:
See TracChangeset
for help on using the changeset viewer.