Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Qt patches with things spotted by thiago

  • Loading branch information...
commit e8e39781d223eeeed55046667582a62425d97c48 1 parent 80d5df9
Benjamin C Meyer authored
View
22 llmozlib2/qt_patches/0001-Change-cookie-expiration-reading-to-match-the-behavi.patch
@@ -1,4 +1,4 @@
-From 2d38b08ae67382e4c4e353d427e9ec195e5109da Mon Sep 17 00:00:00 2001
+From 17d3efe4650f2ea61cc0166710dc4eaf38a8c50e Mon Sep 17 00:00:00 2001
From: Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Date: Thu, 26 Feb 2009 12:21:37 -0500
Subject: [PATCH] Change cookie expiration reading to match the behavior of Firefox.
@@ -8,11 +8,11 @@ Subject: [PATCH] Change cookie expiration reading to match the behavior of Firef
See documentation in parseDateString for more details about the implementation.
---
- src/network/access/qnetworkcookie.cpp | 437 +++++++++++++++++++++++++++++----
- 1 files changed, 384 insertions(+), 53 deletions(-)
+ src/network/access/qnetworkcookie.cpp | 439 +++++++++++++++++++++++++++++----
+ 1 files changed, 386 insertions(+), 53 deletions(-)
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
-index b076bbe..6890a72 100644
+index b076bbe..9a467fd 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -44,6 +44,7 @@
@@ -23,7 +23,7 @@ index b076bbe..6890a72 100644
#include "QtCore/qurl.h"
#include "private/qobject_p.h"
-@@ -508,6 +509,385 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const
+@@ -508,6 +509,387 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const
return result;
}
@@ -162,11 +162,13 @@ index b076bbe..6890a72 100644
+ && (at == 0
+ || isWhitespace(dateString[at - 1])
+ || dateString[at - 1] == ','
-+ || (dateString[at - 1] == 't'))) {
++ || (at >= 3
++ && (dateString[at - 3] == 'g')
++ && (dateString[at - 2] == 'm')
++ && (dateString[at - 1] == 't')))) {
+
+ int end = 1;
-+ while (dateString[at + end] >= '0' && dateString[at + end] <= '9'
-+ && end < 5)
++ while (end < 5 && dateString[at + end] >= '0' && dateString[at + end] <= '9')
+ ++end;
+ int minutes = 0;
+ int hours = 0;
@@ -240,7 +242,7 @@ index b076bbe..6890a72 100644
+ // Could be month, day or year
+ if (isNum) {
+ int length = 1;
-+ if (dateString.length() >= at + 1
++ if (dateString.length() > at + 1
+ && isNumber(dateString[at + 1]))
+ ++length;
+ int x = atoi(dateString.mid(at, length).constData());
@@ -409,7 +411,7 @@ index b076bbe..6890a72 100644
/*!
Parses the cookie string \a cookieString as received from a server
response in the "Set-Cookie:" header. If there's a parsing error,
-@@ -561,64 +941,15 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
+@@ -561,64 +943,15 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
field.first = field.first.toLower(); // everything but the NAME=VALUE is case-insensitive
if (field.first == "expires") {
View
10 llmozlib2/qt_patches/0002-When-parsing-a-cookie-string-the-character-is-sp.patch
@@ -1,4 +1,4 @@
-From 316e6f5287e3eab090f01e4b064f310492abb28f Mon Sep 17 00:00:00 2001
+From b37c6846bead3b3493a64606867f1876765f9963 Mon Sep 17 00:00:00 2001
From: Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Date: Mon, 16 Mar 2009 14:05:22 -0400
Subject: [PATCH] When parsing a cookie string the ',' character is special because
@@ -51,16 +51,16 @@ index dbc7b17..b1fce11 100644
setRawHeader(it->first, value);
}
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
-index 6890a72..281e613 100644
+index 9a467fd..e57b85b 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
-@@ -918,11 +918,17 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
+@@ -920,11 +920,17 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
while (position < length) {
QNetworkCookie cookie;
+ // When there are multiple SetCookie headers they are join with a new line
+ // \n will always be the start of a new cookie
-+ int endOfSetCookie = cookieString.indexOf('\n');
++ int endOfSetCookie = cookieString.indexOf('\n', position);
+ if (endOfSetCookie == -1)
+ endOfSetCookie = length;
+
@@ -73,7 +73,7 @@ index 6890a72..281e613 100644
cookie.setName(field.first);
cookie.setValue(field.second);
-@@ -990,6 +996,8 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
+@@ -992,6 +998,8 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
}
position = nextNonWhitespace(cookieString, position);
Please sign in to comment.
Something went wrong with that request. Please try again.