[webkit-reviews] review granted: [Bug 206984] REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges : [Attachment 389228] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 30 05:49:57 PST 2020


youenn fablet <youennf at gmail.com> has granted David Quesada
<david_quesada at apple.com>'s request for review:
Bug 206984: REGRESSION(r252185): NetworkSessionCocoa cancels downloads that
receive authentication challenges
https://bugs.webkit.org/show_bug.cgi?id=206984

Attachment 389228: Patch

https://bugs.webkit.org/attachment.cgi?id=389228&action=review




--- Comment #2 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 389228
  --> https://bugs.webkit.org/attachment.cgi?id=389228
Patch

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

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:618
> +	   auto download =
_session->networkProcess().downloadManager().download(_sessionWrapper->download
Map.get(task.taskIdentifier));

There does not seem to be any guarantee that downloadMap will contain
task.taskIdentifier.
If not, this would return 0 which could corrupt the DownloadManager map.
Can we add a check there, like done in URLSession:downloadTask:?

Also, I am wondering whether is it possible to create a test for it.
API tests can spin dedicated servers (look for ServiceWorkerTCPServer), not
sure layout tests can pause/resume downloads though we could add test runner
APIs.


More information about the webkit-reviews mailing list