Bug 215519

Summary: Use closeReason provided in didCloseWithCode delegate for the NSURLSessionWebSocket code path
Product: WebKit Reporter: jmehta
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Using the closeReason in the delegate
none
Updating patch to add assertions and ChangeLog none

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.