Bug 56717 - [Qt] Clean up redirection logic in QNetworkReplyHandler
Summary: [Qt] Clean up redirection logic in QNetworkReplyHandler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2011-03-19 15:47 PDT by Andreas Kling
Modified: 2011-03-20 03:26 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (10.67 KB, patch)
2011-03-19 15:51 PDT, Andreas Kling
kenneth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2011-03-19 15:47:33 PDT
SSIA
Comment 1 Andreas Kling 2011-03-19 15:51:29 PDT
Created attachment 86273 [details]
Proposed patch
Comment 2 WebKit Review Bot 2011-03-19 15:53:01 PDT
Attachment 86273 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:420:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Kenneth Rohde Christiansen 2011-03-19 15:57:11 PDT
Comment on attachment 86273 [details]
Proposed patch

Looks good, though it can be a bit hard to follow from looking at the patch.
Comment 4 Kenneth Rohde Christiansen 2011-03-19 15:59:33 PDT
Comment on attachment 86273 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=86273&action=review

>> Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:420
>> +    if (m_redirectionTries == 0) { // 10 or more redirections to the same url is considered infinite recursion
> 
> Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]

When 10 is defined as a static variable at the top, maybe it is bad to mention 10 here?

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:421
> +        ResourceError error(newUrl.host(), 400 /*bad request*/,

Don't we have defines for 400 etc somewhere?
Comment 5 Andreas Kling 2011-03-20 03:26:21 PDT
Committed r81565: <http://trac.webkit.org/changeset/81565>