RESOLVED FIXED 215519
Use closeReason provided in didCloseWithCode delegate for the NSURLSessionWebSocket code path
https://bugs.webkit.org/show_bug.cgi?id=215519
Summary Use closeReason provided in didCloseWithCode delegate for the NSURLSessionWeb...
jmehta
Reported 2020-08-14 11:50:19 PDT
Use closeReason provided in didCloseWithCode delegate. Currently we're looking at the task's closeReason (which is not wrong), but making sure that we use the close code and reason provided in the delegate callback to ensure there is no weird bug that we hit in the future
Attachments
Using the closeReason in the delegate (1023 bytes, patch)
2020-08-14 11:51 PDT, jmehta
no flags
Updating patch to add assertions and ChangeLog (2.19 KB, patch)
2020-08-20 17:43 PDT, jmehta
no flags
jmehta
Comment 1 2020-08-14 11:51:09 PDT
Created attachment 406612 [details] Using the closeReason in the delegate
Alex Christensen
Comment 2 2020-08-14 12:38:20 PDT
Comment on attachment 406612 [details] Using the closeReason in the delegate View in context: https://bugs.webkit.org/attachment.cgi?id=406612&action=review > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1021 > + auto closeReason = adoptNS([[NSString alloc] initWithData:reason encoding:NSUTF8StringEncoding]); ASSERT([reason isEqualToData:task.closeReason]); That'll catch these future bugs you mentioned.
jmehta
Comment 3 2020-08-14 13:02:03 PDT
(In reply to Alex Christensen from comment #2) > Comment on attachment 406612 [details] > Using the closeReason in the delegate > > View in context: > https://bugs.webkit.org/attachment.cgi?id=406612&action=review > > > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1021 > > + auto closeReason = adoptNS([[NSString alloc] initWithData:reason encoding:NSUTF8StringEncoding]); > > ASSERT([reason isEqualToData:task.closeReason]); > That'll catch these future bugs you mentioned. That sounds good
jmehta
Comment 4 2020-08-20 17:43:20 PDT
Created attachment 406984 [details] Updating patch to add assertions and ChangeLog
Radar WebKit Bug Importer
Comment 5 2020-08-21 11:51:14 PDT
EWS
Comment 6 2020-08-21 12:16:36 PDT
Committed r266011: <https://trac.webkit.org/changeset/266011> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406984 [details].
Note You need to log in before you can comment on or make changes to this bug.