Skip to content

Commit

Permalink
Cleanup all members in SessionWrapper::recreateSessionWithUpdatedProx…
Browse files Browse the repository at this point in the history
…yConfigurations

https://bugs.webkit.org/show_bug.cgi?id=259407
rdar://112679066

Reviewed by Chris Dumez.

266129@main reset some members of the SessionWrapper, but not all of them.
To prevent stale map entries, clear all the members at the same time.

* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::SessionWrapper::recreateSessionWithUpdatedProxyConfigurations):

Canonical link: https://commits.webkit.org/266224@main
  • Loading branch information
achristensen07 committed Jul 22, 2023
1 parent 875c04f commit 6282960
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1345,9 +1345,16 @@ - (void)URLSession:(NSURLSession *)session webSocketTask:(NSURLSessionWebSocketT
networkSession.applyProxyConfigurationToSessionConfiguration(configuration);
#endif

[session invalidateAndCancel];
[delegate sessionInvalidated];
delegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:networkSession wrapper:*this withCredentials:withCredentials]);
session = [NSURLSession sessionWithConfiguration:configuration delegate:delegate.get() delegateQueue:[NSOperationQueue mainQueue]];

dataTaskMap.clear();
downloadMap.clear();
#if HAVE(NSURLSESSION_WEBSOCKET)
webSocketDataTaskMap.clear();
#endif
}

void SessionWrapper::initialize(NSURLSessionConfiguration *configuration, NetworkSessionCocoa& networkSession, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
Expand Down

0 comments on commit 6282960

Please sign in to comment.