Implement CLI status command

This commit is contained in:
Vitaliy Filippov
2022-04-09 00:25:51 +03:00
parent 0eb929f1ba
commit d71cc174e3
9 changed files with 367 additions and 11 deletions
+4
View File
@@ -342,6 +342,8 @@ void http_co_t::handle_events()
}
else if (epoll_events & (EPOLLRDHUP|EPOLLERR))
{
if (state == HTTP_CO_HEADERS_RECEIVED)
std::swap(parsed.body, response);
close_connection();
run_cb_and_clear();
break;
@@ -465,6 +467,8 @@ again:
{
// < 0 means error, 0 means EOF
epoll_events = epoll_events & ~EPOLLIN;
if (state == HTTP_CO_HEADERS_RECEIVED)
std::swap(parsed.body, response);
close_connection();
if (res < 0)
parsed = { .error = std::string("recvmsg: ")+strerror(-res) };