Permalink
Browse files

Update patch to apply on qt 4.5.2

  • Loading branch information...
1 parent 46ef8b2 commit b99f71d90a5384d2524c62f8dc1e53c1e028615c Benjamin C Meyer committed Jun 30, 2009
Showing with 21 additions and 24 deletions.
  1. +21 −24 llmozlib2/qt_patches/0007-Add-a-flag-to-QAuthenticator-tryAgainLater-that-wh.patch
@@ -1,4 +1,4 @@
-From 452dc05df2d2b84c8a393b56500931a26ffc7731 Mon Sep 17 00:00:00 2001
+From 4bf03be767e00b0f12242f7657dfa7d0cc53202b Mon Sep 17 00:00:00 2001
From: Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Date: Mon, 29 Jun 2009 18:49:00 -0400
Subject: [PATCH] Add a flag to QAuthenticator (tryAgainLater) that when set causes
@@ -16,18 +16,18 @@ into Qt or asked to go in a public Qt build such as Debian's.
4 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
-index f0c694d..7ef4960 100644
+index c068f2d..4b81545 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
-@@ -51,6 +51,7 @@
+@@ -50,6 +50,7 @@
#include <qpair.h>
#include <qhttp.h>
#include <qdebug.h>
+#include <qtimer.h>
#ifndef QT_NO_HTTP
-@@ -675,8 +676,16 @@ void QHttpNetworkConnectionPrivate::receiveReply(QAbstractSocket *socket, QHttpN
+@@ -605,8 +606,16 @@ void QHttpNetworkConnectionPrivate::receiveReply(QAbstractSocket *socket, QHttpN
}
}
@@ -44,10 +44,10 @@ index f0c694d..7ef4960 100644
#ifndef QT_NO_COMPRESS
// expand the whole data.
if (expectContent(reply) && reply->d_func()->autoDecompress && !reply->d_func()->streamEnd)
-@@ -684,7 +693,12 @@ void QHttpNetworkConnectionPrivate::allDone(QAbstractSocket *socket, QHttpNetwor
+@@ -614,7 +623,12 @@ void QHttpNetworkConnectionPrivate::allDone(QAbstractSocket *socket, QHttpNetwor
#endif
// while handling 401 & 407, we might reset the status code, so save this.
- bool emitFinished = shouldEmitSignals(reply);
+ bool emitFinished = emitSignals(reply);
- handleStatus(socket, reply);
+ if (!handleStatus(socket, reply)) {
+ allDoneStack.push(QPair<QAbstractSocket*, QHttpNetworkReply*>(socket, reply));
@@ -58,7 +58,7 @@ index f0c694d..7ef4960 100644
// ### at this point there should be no more data on the socket
// close if server requested
int i = indexOf(socket);
-@@ -700,7 +714,7 @@ void QHttpNetworkConnectionPrivate::allDone(QAbstractSocket *socket, QHttpNetwor
+@@ -630,7 +644,7 @@ void QHttpNetworkConnectionPrivate::allDone(QAbstractSocket *socket, QHttpNetwor
channels[i].reconnectAttempts = 2;
}
@@ -67,7 +67,7 @@ index f0c694d..7ef4960 100644
{
Q_ASSERT(socket);
Q_ASSERT(reply);
-@@ -709,12 +723,13 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN
+@@ -639,16 +653,19 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN
int statusCode = reply->statusCode();
bool resend = false;
@@ -80,19 +80,16 @@ index f0c694d..7ef4960 100644
- if (resend) {
+ if (handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend, tryAgainLater)) {
+ if (resend && !tryAgainLater) {
- int i = indexOf(socket);
-
- QNonContiguousByteDevice* uploadByteDevice = channels[i].request.uploadByteDevice();
-@@ -735,6 +750,8 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN
- QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
+ eraseData(reply);
+ sendRequest(socket);
}
} else {
+ if (tryAgainLater)
+ return false;
int i = indexOf(socket);
emit channels[i].reply->headerChanged();
emit channels[i].reply->readyRead();
-@@ -749,6 +766,9 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN
+@@ -663,6 +680,9 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN
default:
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
}
@@ -102,7 +99,7 @@ index f0c694d..7ef4960 100644
}
void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthenticator *auth, bool isProxy)
-@@ -774,7 +794,7 @@ void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthentica
+@@ -688,7 +708,7 @@ void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthentica
bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket *socket, QHttpNetworkReply *reply,
@@ -111,7 +108,7 @@ index f0c694d..7ef4960 100644
{
Q_ASSERT(socket);
Q_ASSERT(reply);
-@@ -824,7 +844,14 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
+@@ -738,7 +758,14 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
if (!isProxy) {
pendingAuthSignal = true;
emit q->authenticationRequired(reply->request(), auth, q);
@@ -127,7 +124,7 @@ index f0c694d..7ef4960 100644
} else {
pendingProxyAuthSignal = true;
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
-index 64a6faa..f0a9233 100644
+index f573a82..686a69c 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -60,6 +60,7 @@
@@ -138,15 +135,15 @@ index 64a6faa..f0a9233 100644
#include <private/qhttpnetworkheader_p.h>
#include <private/qhttpnetworkrequest_p.h>
-@@ -152,6 +153,7 @@ private:
+@@ -153,6 +154,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_encrypted())
Q_PRIVATE_SLOT(d_func(), void _q_sslErrors(const QList<QSslError>&))
#endif
+ Q_PRIVATE_SLOT(d_func(), void _q_allDoneNext())
};
-@@ -258,9 +260,9 @@ public:
+@@ -260,9 +262,9 @@ public:
qint64 bytesAvailable(const QHttpNetworkReply &reply, bool compressed = false) const;
qint64 read(QHttpNetworkReply &reply, QByteArray &data, qint64 maxSize, bool compressed);
void emitReplyError(QAbstractSocket *socket, QHttpNetworkReply *reply, QNetworkReply::NetworkError errorCode);
@@ -155,10 +152,10 @@ index 64a6faa..f0a9233 100644
void allDone(QAbstractSocket *socket, QHttpNetworkReply *reply);
- void handleStatus(QAbstractSocket *socket, QHttpNetworkReply *reply);
+ bool handleStatus(QAbstractSocket *socket, QHttpNetworkReply *reply);
- inline bool shouldEmitSignals(QHttpNetworkReply *reply);
+ inline bool emitSignals(QHttpNetworkReply *reply);
inline bool expectContent(QHttpNetworkReply *reply);
-@@ -277,6 +279,10 @@ public:
+@@ -279,6 +281,10 @@ public:
//The request queues
QList<HttpMessagePair> highPriorityQueue;
QList<HttpMessagePair> lowPriorityQueue;
@@ -170,10 +167,10 @@ index 64a6faa..f0a9233 100644
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
-index a26a1fc..7c5a034 100644
+index e760021..19585a9 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
-@@ -92,6 +92,7 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
+@@ -91,6 +91,7 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
*/
QAuthenticator::QAuthenticator()
: d(0)
@@ -182,7 +179,7 @@ index a26a1fc..7c5a034 100644
}
diff --git a/src/network/kernel/qauthenticator.h b/src/network/kernel/qauthenticator.h
-index feea26b..5b5c1ed 100644
+index ce6ffa0..368c265 100644
--- a/src/network/kernel/qauthenticator.h
+++ b/src/network/kernel/qauthenticator.h
@@ -75,6 +75,8 @@ public:

0 comments on commit b99f71d

Please sign in to comment.