Title: [204911] trunk/Source/WebKit2
Revision
204911
Author
[email protected]
Date
2016-08-24 11:53:33 -0700 (Wed, 24 Aug 2016)

Log Message

In some cases, an IPC::Connection won't know when the other end has gone away
https://bugs.webkit.org/show_bug.cgi?id=161153
rdar://problem/27896368

Reviewed by Dan Bernstein.

When being asked to invalidate a connection that isn't yet connected, make sure to release
our send and receive rights so that the other end will get a failure when trying to connect.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (204910 => 204911)


--- trunk/Source/WebKit2/ChangeLog	2016-08-24 18:44:21 UTC (rev 204910)
+++ trunk/Source/WebKit2/ChangeLog	2016-08-24 18:53:33 UTC (rev 204911)
@@ -1,3 +1,17 @@
+2016-08-24  Anders Carlsson  <[email protected]>
+
+        In some cases, an IPC::Connection won't know when the other end has gone away
+        https://bugs.webkit.org/show_bug.cgi?id=161153
+        rdar://problem/27896368
+
+        Reviewed by Dan Bernstein.
+
+        When being asked to invalidate a connection that isn't yet connected, make sure to release
+        our send and receive rights so that the other end will get a failure when trying to connect.
+
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::Connection::platformInvalidate):
+
 2016-08-24  Dan Bernstein  <[email protected]>
 
         Add a convenience function for creating a WKFrameHandleRef from a WKFrameRef without going through WKFrameInfoRef

Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (204910 => 204911)


--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-08-24 18:44:21 UTC (rev 204910)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm	2016-08-24 18:53:33 UTC (rev 204911)
@@ -111,8 +111,19 @@
     
 void Connection::platformInvalidate()
 {
-    if (!m_isConnected)
+    if (!m_isConnected) {
+        if (m_sendPort) {
+            mach_port_deallocate(mach_task_self(), m_sendPort);
+            m_sendPort = MACH_PORT_NULL;
+        }
+
+        if (m_receivePort) {
+            mach_port_mod_refs(mach_task_self(), m_receivePort, MACH_PORT_RIGHT_RECEIVE, -1);
+            m_receivePort = MACH_PORT_NULL;
+        }
+
         return;
+    }
 
     m_isConnected = false;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to