Title: [266585] releases/WebKitGTK/webkit-2.30/Source/WebKit
Revision
266585
Author
[email protected]
Date
2020-09-04 04:15:44 -0700 (Fri, 04 Sep 2020)

Log Message

Merge r265856 - WebSocketChannel::didClose should correctly compute whether a closing handshake was received
https://bugs.webkit.org/show_bug.cgi?id=215644

Reviewed by Darin Adler.

Covered by LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html with NSURLSession code path enabled.

* WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::didClose):
As noted by Jiten Mehta, absence of closing handshake from the server is notified by WebSocketChannel::CloseEventCodeAbnormalClosure.
Update check accordingly.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.30/Source/WebKit/ChangeLog (266584 => 266585)


--- releases/WebKitGTK/webkit-2.30/Source/WebKit/ChangeLog	2020-09-04 11:14:48 UTC (rev 266584)
+++ releases/WebKitGTK/webkit-2.30/Source/WebKit/ChangeLog	2020-09-04 11:15:44 UTC (rev 266585)
@@ -1,3 +1,17 @@
+2020-08-19  Youenn Fablet  <[email protected]>
+
+        WebSocketChannel::didClose should correctly compute whether a closing handshake was received
+        https://bugs.webkit.org/show_bug.cgi?id=215644
+
+        Reviewed by Darin Adler.
+
+        Covered by LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html with NSURLSession code path enabled.
+
+        * WebProcess/Network/WebSocketChannel.cpp:
+        (WebKit::WebSocketChannel::didClose):
+        As noted by Jiten Mehta, absence of closing handshake from the server is notified by WebSocketChannel::CloseEventCodeAbnormalClosure.
+        Update check accordingly.
+
 2020-08-15  Adrian Perez de Castro  <[email protected]>
 
         Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.29.90 release

Modified: releases/WebKitGTK/webkit-2.30/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp (266584 => 266585)


--- releases/WebKitGTK/webkit-2.30/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp	2020-09-04 11:14:48 UTC (rev 266584)
+++ releases/WebKitGTK/webkit-2.30/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp	2020-09-04 11:15:44 UTC (rev 266585)
@@ -322,10 +322,11 @@
 
     m_inspector.didCloseWebSocket(m_document.get());
 
-    if (code == WebCore::WebSocketChannel::CloseEventCodeNormalClosure)
+    bool receivedClosingHandshake = code != WebCore::WebSocketChannel::CloseEventCodeAbnormalClosure;
+    if (receivedClosingHandshake)
         m_client->didStartClosingHandshake();
 
-    m_client->didClose(m_bufferedAmount, (m_isClosing || code == WebCore::WebSocketChannel::CloseEventCodeNormalClosure) ? WebCore::WebSocketChannelClient::ClosingHandshakeComplete : WebCore::WebSocketChannelClient::ClosingHandshakeIncomplete, code, reason);
+    m_client->didClose(m_bufferedAmount, (m_isClosing || receivedClosingHandshake) ? WebCore::WebSocketChannelClient::ClosingHandshakeComplete : WebCore::WebSocketChannelClient::ClosingHandshakeIncomplete, code, reason);
 }
 
 void WebSocketChannel::didReceiveMessageError(String&& errorMessage)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to