Title: [216487] releases/WebKitGTK/webkit-2.14/Source/WebCore
Revision
216487
Author
carlo...@webkit.org
Date
2017-05-09 02:40:07 -0700 (Tue, 09 May 2017)

Log Message

Merge r215102 - REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
https://bugs.webkit.org/show_bug.cgi?id=170463

Reviewed by Michael Catanzaro.

This only reproduces when using WebSockets to communicate with an external server.
When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
across the real internet.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
Returning std::nullopt means there was an error, which is not true when the socket stream
is in a state where it cannot be written to because it is actively communicating.
Returning 0 means 0 new bytes were sent, so we will try again later.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (216486 => 216487)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-05-09 09:00:29 UTC (rev 216486)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-05-09 09:40:07 UTC (rev 216487)
@@ -1,3 +1,23 @@
+2017-04-07  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
+        https://bugs.webkit.org/show_bug.cgi?id=170463
+
+        Reviewed by Michael Catanzaro.
+
+        This only reproduces when using WebSockets to communicate with an external server.
+        When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
+        CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
+        across the real internet.
+
+        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+        (WebCore::SocketStreamHandleImpl::platformSendInternal):
+        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
+        (WebCore::SocketStreamHandleImpl::platformSendInternal):
+        Returning std::nullopt means there was an error, which is not true when the socket stream
+        is in a state where it cannot be written to because it is actively communicating.
+        Returning 0 means 0 new bytes were sent, so we will try again later.
+
 2017-03-22  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] Honor GTK+ font settings

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp (216486 => 216487)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp	2017-05-09 09:00:29 UTC (rev 216486)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp	2017-05-09 09:40:07 UTC (rev 216487)
@@ -656,7 +656,7 @@
 Optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
 {
     if (!CFWriteStreamCanAcceptBytes(m_writeStream.get()))
-        return Nullopt;
+        return 0;
 
     CFIndex result = CFWriteStreamWrite(m_writeStream.get(), reinterpret_cast<const UInt8*>(data), length);
     if (result == -1)

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp (216486 => 216487)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp	2017-05-09 09:00:29 UTC (rev 216486)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp	2017-05-09 09:40:07 UTC (rev 216487)
@@ -175,7 +175,7 @@
 {
     LOG(Network, "SocketStreamHandle %p platformSend", this);
     if (!m_outputStream || !data)
-        return Nullopt;
+        return 0;
 
     GUniqueOutPtr<GError> error;
     gssize written = g_pollable_output_stream_write_nonblocking(m_outputStream.get(), data, length, m_cancellable.get(), &error.outPtr());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to