From 6c54c4740d2144e897cad5b033ab160b3ab2ddff Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 26 Nov 2018 12:47:44 +1100 Subject: [PATCH] Read initial remote message in Urgent EventMode Fixes #2497 --- src/remote.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/remote.cc b/src/remote.cc index 8022174f..fd76e94c 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -699,13 +699,12 @@ public: Accepter(int socket) : m_socket_watcher(socket, FdEvents::Read, [this](FDWatcher&, FdEvents, EventMode mode) { - if (mode == EventMode::Normal) - handle_available_input(); + handle_available_input(mode); }) {} private: - void handle_available_input() + void handle_available_input(EventMode mode) { const int sock = m_socket_watcher.fd(); try @@ -713,7 +712,7 @@ private: while (not m_reader.ready() and fd_readable(sock)) m_reader.read_available(sock); - if (not m_reader.ready()) + if (mode != EventMode::Normal or not m_reader.ready()) return; switch (m_reader.type())