From 1d3ef192629936cae57e7d442716e11079d9f98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Wed, 23 May 2018 15:22:00 +0300 Subject: [PATCH] Bug 1452245 - The parent side isn't closed if the child dies unexpectedly, r=valentin --- netwerk/protocol/websocket/WebSocketChannelParent.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netwerk/protocol/websocket/WebSocketChannelParent.cpp b/netwerk/protocol/websocket/WebSocketChannelParent.cpp index 557b025ce43b..68722e2b030d 100644 --- a/netwerk/protocol/websocket/WebSocketChannelParent.cpp +++ b/netwerk/protocol/websocket/WebSocketChannelParent.cpp @@ -283,6 +283,14 @@ void WebSocketChannelParent::ActorDestroy(ActorDestroyReason why) { LOG(("WebSocketChannelParent::ActorDestroy() %p\n", this)); + + // Make sure we close the channel if the content process dies without going + // through a clean shutdown. + if (mChannel) { + Unused << mChannel->Close(nsIWebSocketChannel::CLOSE_GOING_AWAY, + NS_LITERAL_CSTRING("Child was killed")); + } + mIPCOpen = false; }