Commit 53e99f56 authored by Neverlord's avatar Neverlord

fixed handling of wr events during MM shutdown

parent 209a5006
...@@ -286,6 +286,7 @@ class middleman_impl : public middleman { ...@@ -286,6 +286,7 @@ class middleman_impl : public middleman {
protected: protected:
void initialize() override { void initialize() override {
CPPA_LOG_TRACE("");
# ifdef CPPA_WINDOWS # ifdef CPPA_WINDOWS
WSADATA WinsockData; WSADATA WinsockData;
if (WSAStartup(MAKEWORD(2, 2), &WinsockData) != 0) { if (WSAStartup(MAKEWORD(2, 2), &WinsockData) != 0) {
...@@ -314,6 +315,7 @@ class middleman_impl : public middleman { ...@@ -314,6 +315,7 @@ class middleman_impl : public middleman {
} }
void destroy() override { void destroy() override {
CPPA_LOG_TRACE("");
run_later([this] { run_later([this] {
CPPA_LOGM_TRACE("destroy$helper", ""); CPPA_LOGM_TRACE("destroy$helper", "");
this->m_done = true; this->m_done = true;
...@@ -475,6 +477,7 @@ void middleman_loop(middleman_impl* impl) { ...@@ -475,6 +477,7 @@ void middleman_loop(middleman_impl* impl) {
while (handler->num_sockets() > 0) { while (handler->num_sockets() > 0) {
handler->poll([&](event_bitmask mask, continuable* io) { handler->poll([&](event_bitmask mask, continuable* io) {
switch (mask) { switch (mask) {
case event::both:
case event::write: case event::write:
switch (io->continue_writing()) { switch (io->continue_writing()) {
case write_failure: case write_failure:
...@@ -493,12 +496,12 @@ void middleman_loop(middleman_impl* impl) { ...@@ -493,12 +496,12 @@ void middleman_loop(middleman_impl* impl) {
handler->erase_later(io, event::both); handler->erase_later(io, event::both);
break; break;
default: default:
CPPA_LOGF_ERROR("expected event::write only " CPPA_LOGF_WARNING("event::read event during shutdown");
"during shutdown phase");
handler->erase_later(io, event::read); handler->erase_later(io, event::read);
break; break;
} }
}); });
handler->update();
} }
CPPA_LOGF_DEBUG("middleman loop done"); CPPA_LOGF_DEBUG("middleman loop done");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment