WebKit Bugzilla
Attachment 343553 Details for
Bug 187022
: Remove RELEASE_ASSERT added in r230875
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187022-20180625161909.patch (text/plain), 3.85 KB, created by
Brady Eidson
on 2018-06-25 16:19:10 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brady Eidson
Created:
2018-06-25 16:19:10 PDT
Size:
3.85 KB
patch
obsolete
>Subversion Revision: 233148 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cc1d3347bf85b24e17cb989b2a92f8fd57cf45cb..8542af0f57c08e97a3a487490960bf8be21464dc 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-06-25 Brady Eidson <beidson@apple.com> >+ >+ Remove RELEASE_ASSERT added in r230875. >+ <rdar://problem/40860061> and https://bugs.webkit.org/show_bug.cgi?id=187022 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ There's actually more than one way for a network session to be destroyed, and that can happen >+ asynchronously and unpredictably. >+ >+ And the request to start up a WebSocket and do its handshake is also asynchronous and unpredictable >+ >+ It's an expected race. >+ >+ If the NetworkStorageSession cannot be found then the WebSocket handshake should just fail. >+ >+ * platform/network/SocketStreamHandleImpl.cpp: >+ (WebCore::cookieDataForHandshake): If the NetworkStorageSession cannot be found, return std::nullopt. >+ (WebCore::SocketStreamHandleImpl::platformSendHandshake): If the cookieData is null, fail the handshake. >+ > 2018-06-25 Simon Fraser <simon.fraser@apple.com> > > AutoTableLayout wastes 52KB of Vector capacity on nytimes.com >diff --git a/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp b/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >index 69b418206f79dfbde80c89efae96ebbfd3de7819..759d63a4685bfdafa727005bb744c8a567ad1ac3 100644 >--- a/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >+++ b/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >@@ -77,16 +77,17 @@ static size_t removeTerminationCharacters(const uint8_t* data, size_t dataLength > return dataLength - 2; > } > >-static std::pair<Vector<uint8_t>, bool> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy) >+static std::optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy) > { > auto networkStorageSession = NetworkStorageSession::storageSession(headerFieldProxy.sessionID); >- RELEASE_ASSERT(networkStorageSession); >- >+ if (!networkStorageSession) >+ return std::nullopt; >+ > String cookieDataString; > bool secureCookiesAccessed = false; > std::tie(cookieDataString, secureCookiesAccessed) = WebCore::cookieRequestHeaderFieldValue(*networkStorageSession, headerFieldProxy); > if (cookieDataString.isEmpty()) >- return { { }, secureCookiesAccessed }; >+ return std::pair<Vector<uint8_t>, bool> { { }, secureCookiesAccessed }; > > CString cookieData = cookieDataString.utf8(); > >@@ -94,7 +95,7 @@ static std::pair<Vector<uint8_t>, bool> cookieDataForHandshake(const CookieReque > data.append(cookieData.data(), cookieData.length()); > data.appendVector(Vector<uint8_t>({ '\r', '\n', '\r', '\n' })); > >- return { data, secureCookiesAccessed }; >+ return std::pair<Vector<uint8_t>, bool> { data, secureCookiesAccessed }; > } > > void SocketStreamHandleImpl::platformSendHandshake(const uint8_t* data, size_t length, const std::optional<CookieRequestHeaderFieldProxy>& headerFieldProxy, Function<void(bool, bool)>&& completionHandler) >@@ -103,7 +104,13 @@ void SocketStreamHandleImpl::platformSendHandshake(const uint8_t* data, size_t l > bool secureCookiesAccessed = false; > > if (headerFieldProxy) { >- std::tie(cookieData, secureCookiesAccessed) = cookieDataForHandshake(headerFieldProxy.value()); >+ auto cookieDataFromNetworkSession = cookieDataForHandshake(headerFieldProxy.value()); >+ if (!cookieDataFromNetworkSession) { >+ completionHandler(false, false); >+ return; >+ } >+ >+ std::tie(cookieData, secureCookiesAccessed) = *cookieDataFromNetworkSession; > if (cookieData.size()) > length = removeTerminationCharacters(data, length); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187022
: 343553