[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

ap at apple.com ap at apple.com
Thu Apr 8 00:30:36 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 2aeed9bec251d68725ca768d12f979648418d502
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 10 03:30:35 2009 +0000

            Reviewed by Oliver Hunt.
    
            https://bugs.webkit.org/show_bug.cgi?id=32355
            Assertion failure when opening a WebSocket connection
    
            I couldn't make a reliable test for this. Once the test from bug 32299 is landed, it
            will provide partial coverage, as I was frequently seeing the assertion failure with it.
    
            * platform/network/SocketStreamHandleBase.cpp: (WebCore::SocketStreamHandleBase::send):
            It's not an error if zero if returned from platformSend() - it just means that nothing could
            be pushed down to the network layer, and all data was queued for later.
            * platform/network/cf/SocketStreamHandleCFNet.cpp:
            (WebCore::SocketStreamHandle::readStreamCallback): This will no longer happen with SocketStream,
            but a client can potentially destroy the handle from any callback, so we need to check that
            this didn't happen.
            (WebCore::SocketStreamHandle::writeStreamCallback): Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51934 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 76231e5..c128053 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-12-09  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32355
+        Assertion failure when opening a WebSocket connection
+
+        I couldn't make a reliable test for this. Once the test from bug 32299 is landed, it
+        will provide partial coverage, as I was frequently seeing the assertion failure with it.
+
+        * platform/network/SocketStreamHandleBase.cpp: (WebCore::SocketStreamHandleBase::send):
+        It's not an error if zero is returned from platformSend() - it just means that nothing could
+        be pushed down to the network layer, and all data was queued for later.
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::readStreamCallback): This will no longer happen with SocketStream,
+        but a client can potentially destroy the handle from any callback, so we need to check that
+        this didn't happen.
+        (WebCore::SocketStreamHandle::writeStreamCallback): Ditto.
+
 2009-12-09  Sam Weinig  <sam at webkit.org>
 
         Roll out 51919 and 51920. They were incorrect and unnecessary right now.
diff --git a/WebCore/platform/network/SocketStreamHandleBase.cpp b/WebCore/platform/network/SocketStreamHandleBase.cpp
index 9451cb9..8472713 100644
--- a/WebCore/platform/network/SocketStreamHandleBase.cpp
+++ b/WebCore/platform/network/SocketStreamHandleBase.cpp
@@ -65,7 +65,7 @@ bool SocketStreamHandleBase::send(const char* data, int length)
     int bytesWritten = 0;
     if (m_state == Open)
         bytesWritten = platformSend(data, length);
-    if (bytesWritten <= 0)
+    if (bytesWritten < 0)
         return false;
     if (m_buffer.size() + length - bytesWritten > bufferSize) {
         // FIXME: report error to indicate that buffer has no more space.
diff --git a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
index ac4f88c..e7e64da 100644
--- a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
@@ -500,7 +500,11 @@ void SocketStreamHandle::readStreamCallback(CFStreamEventType type)
         if (m_connectingSubstate == WaitingForConnect) {
             m_connectingSubstate = Connected;
             m_state = Open;
+
+            RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
             m_client->didOpen(this);
+            if (m_state == Closed)
+                break;
             // Fall through.
         } else if (m_state == Closed)
             break;
@@ -555,6 +559,8 @@ void SocketStreamHandle::writeStreamCallback(CFStreamEventType type)
         if (m_connectingSubstate == WaitingForConnect) {
             m_connectingSubstate = Connected;
             m_state = Open;
+
+            RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
             m_client->didOpen(this);
             break;
         }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list