Changeset 215102 in webkit


Ignore:
Timestamp:
Apr 7, 2017 11:15:22 AM (7 years ago)
Author:
achristensen@apple.com
Message:

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.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r215099 r215102  
     12017-04-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
     4        https://bugs.webkit.org/show_bug.cgi?id=170463
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This only reproduces when using WebSockets to communicate with an external server.
     9        When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
     10        CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
     11        across the real internet.
     12
     13        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
     14        (WebCore::SocketStreamHandleImpl::platformSendInternal):
     15        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
     16        (WebCore::SocketStreamHandleImpl::platformSendInternal):
     17        Returning std::nullopt means there was an error, which is not true when the socket stream
     18        is in a state where it cannot be written to because it is actively communicating.
     19        Returning 0 means 0 new bytes were sent, so we will try again later.
     20
    1212017-04-07  Eric Carlson  <eric.carlson@apple.com>
    222
  • trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp

    r214413 r215102  
    657657{
    658658    if (!m_writeStream)
    659         return std::nullopt;
     659        return 0;
    660660
    661661    if (!CFWriteStreamCanAcceptBytes(m_writeStream.get()))
    662         return std::nullopt;
     662        return 0;
    663663
    664664    CFIndex result = CFWriteStreamWrite(m_writeStream.get(), reinterpret_cast<const UInt8*>(data), length);
  • trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp

    r214114 r215102  
    195195    LOG(Network, "SocketStreamHandle %p platformSend", this);
    196196    if (!m_outputStream || !data)
    197         return std::nullopt;
     197        return 0;
    198198
    199199    GUniqueOutPtr<GError> error;
Note: See TracChangeset for help on using the changeset viewer.