Bug 147496 - Coalesce concurrent authentication challenges for the same ProtectionSpace
Summary: Coalesce concurrent authentication challenges for the same ProtectionSpace
Status: RESOLVED DUPLICATE of bug 128006
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-31 11:42 PDT by Chris Dumez
Modified: 2015-08-08 20:21 PDT (History)
5 users (show)

See Also:


Attachments
Patch (12.00 KB, patch)
2015-07-31 13:20 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-07-31 11:42:37 PDT
Coalesce concurrent authentication challenges for the same ProtectionSpace. Ideally, this would be done in the network layer but short term, this will make sure the user no longer gets repeating authentication dialogs for the same protection space.
Comment 1 Chris Dumez 2015-07-31 11:42:54 PDT
rdar://problem/21863706
Comment 2 Chris Dumez 2015-07-31 13:20:00 PDT
Created attachment 257952 [details]
Patch
Comment 3 Chris Dumez 2015-07-31 15:02:53 PDT

*** This bug has been marked as a duplicate of bug 128006 ***
Comment 4 Darin Adler 2015-08-08 14:06:19 PDT
Comment on attachment 257952 [details]
Patch

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

> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
> +    auto end =  m_challenges.end();
> +    for (auto it = m_challenges.begin(); it != end; ++it) {
> +        if (it->key != challengeID && ProtectionSpace::compare(authenticationChallenge.protectionSpace(), it->value.protectionSpace()))
> +            return true;
> +    }

Why does this use an explicit iterator instead of a modern for loop?

> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
> +    auto end = m_challenges.end();
> +    for (auto it = m_challenges.begin(); it != end; ++it) {
> +        if (it->key == challengeID || ProtectionSpace::compare(challenge.protectionSpace(), it->value.protectionSpace()))
> +            challengesToCoalesce.append(it->key);
> +    }

Same question here.
Comment 5 Chris Dumez 2015-08-08 19:24:11 PDT
Comment on attachment 257952 [details]
Patch

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

>> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
>> +    }
> 
> Why does this use an explicit iterator instead of a modern for loop?

Just an oversight, I'll fix this.

>> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
>> +    }
> 
> Same question here.

and this.
Comment 6 Chris Dumez 2015-08-08 20:21:00 PDT
(In reply to comment #5)
> Comment on attachment 257952 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=257952&action=review
> 
> >> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:82
> >> +    }
> > 
> > Why does this use an explicit iterator instead of a modern for loop?
> 
> Just an oversight, I'll fix this.
> 
> >> Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp:97
> >> +    }
> > 
> > Same question here.
> 
> and this.

Updated patch to https://bugs.webkit.org/show_bug.cgi?id=128006 as this bug is a duplicate.