Read initial remote message in Urgent EventMode

Fixes #2497
This commit is contained in:
Maxime Coste 2018-11-26 12:47:44 +11:00
parent 31d3cef093
commit 6c54c4740d

View File

@ -699,13 +699,12 @@ public:
Accepter(int socket) Accepter(int socket)
: m_socket_watcher(socket, FdEvents::Read, : m_socket_watcher(socket, FdEvents::Read,
[this](FDWatcher&, FdEvents, EventMode mode) { [this](FDWatcher&, FdEvents, EventMode mode) {
if (mode == EventMode::Normal) handle_available_input(mode);
handle_available_input();
}) })
{} {}
private: private:
void handle_available_input() void handle_available_input(EventMode mode)
{ {
const int sock = m_socket_watcher.fd(); const int sock = m_socket_watcher.fd();
try try
@ -713,7 +712,7 @@ private:
while (not m_reader.ready() and fd_readable(sock)) while (not m_reader.ready() and fd_readable(sock))
m_reader.read_available(sock); m_reader.read_available(sock);
if (not m_reader.ready()) if (mode != EventMode::Normal or not m_reader.ready())
return; return;
switch (m_reader.type()) switch (m_reader.type())