Fix client failover in case of etcd shutdown or crash

This commit is contained in:
Vitaliy Filippov
2021-12-01 00:33:02 +03:00
parent cac6a1d8d1
commit 5859f913fc
4 changed files with 78 additions and 13 deletions
+10 -2
View File
@@ -451,7 +451,11 @@ bool http_co_t::handle_read()
}
if (want_streaming && parsed.body.size() > 0)
{
callback(&parsed);
if (!ended)
{
// Don't deliver additional events after close()
callback(&parsed);
}
parsed.body = "";
}
}
@@ -459,7 +463,11 @@ bool http_co_t::handle_read()
{
while (ws_parse_frame(response, parsed.ws_msg_type, parsed.body))
{
callback(&parsed);
if (!ended)
{
// Don't deliver additional events after close()
callback(&parsed);
}
parsed.body = "";
}
}