Skip to content
Permalink
Browse files

Do not try to send remaining data on a closed socket

Fixes #2906
  • Loading branch information...
mawww committed May 23, 2019
1 parent 2bef1f1 commit a1f0bae53a3f0f138e5d0f485699178cb4222a85
Showing with 4 additions and 1 deletion.
  1. +2 −0 src/file.cc
  2. +2 −1 src/remote.cc
@@ -148,6 +148,7 @@ StringView homedir()

bool fd_readable(int fd)
{
kak_assert(fd >= 0);
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
@@ -158,6 +159,7 @@ bool fd_readable(int fd)

bool fd_writable(int fd)
{
kak_assert(fd >= 0);
fd_set wfds;
FD_ZERO(&wfds);
FD_SET(fd, &wfds);
@@ -439,7 +439,8 @@ RemoteUI::~RemoteUI()
// Try to send the remaining data if possible, as it might contain the desired exit status
try
{
send_data(m_socket_watcher.fd(), m_send_buffer);
if (m_socket_watcher.fd() != -1)
send_data(m_socket_watcher.fd(), m_send_buffer);
}
catch (disconnected&)
{

0 comments on commit a1f0bae

Please sign in to comment.
You can’t perform that action at this time.