summaryrefslogtreecommitdiff
path: root/src/remote.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-09-07 19:37:58 +0800
committerMaxime Coste <mawww@kakoune.org>2017-09-07 19:37:58 +0800
commitbd66aff808350e8d51246f184e121c0224d166a3 (patch)
tree8dd0d859ffe4c7f85a29ab0222100994c769ae19 /src/remote.cc
parent8e3e5b10c1e05cc174a8c1ddf44dc7bc3fd095e4 (diff)
Tolerate unwritable socket when trying to send the disconnection message
Fixes #1552
Diffstat (limited to 'src/remote.cc')
-rw-r--r--src/remote.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/remote.cc b/src/remote.cc
index c26aabb7..2bf6f03b 100644
--- a/src/remote.cc
+++ b/src/remote.cc
@@ -419,7 +419,13 @@ RemoteUI::RemoteUI(int socket, DisplayCoord dimensions)
RemoteUI::~RemoteUI()
{
// Try to send the remaining data if possible, as it might contain the desired exit status
- send_data(m_socket_watcher.fd(), m_send_buffer);
+ try
+ {
+ send_data(m_socket_watcher.fd(), m_send_buffer);
+ }
+ catch (disconnected&)
+ {
+ }
write_to_debug_buffer(format("remote client disconnected: {}", m_socket_watcher.fd()));
m_socket_watcher.close_fd();