micro-http: explicit HUP/ERR handling in server

The server in `micro_http` was not explicitly handling the `EPOLLHUP`,
`EPOLLRDHUP` and `EPOLLERR` epoll events. Added new checks that close
a connection that is signaled with these events.

Signed-off-by: George Pisaltu <gpl@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
George Pisaltu
2020-11-26 13:07:58 +02:00
committed by Adrian Catangiu
parent ed44e2af6f
commit e73f412536
2 changed files with 76 additions and 6 deletions

View File

@@ -428,7 +428,8 @@ impl<T: Read + Write> HttpConnection<T> {
Ok(())
}
fn clear_write_buffer(&mut self) {
/// Discards all pending writes from the connection.
pub fn clear_write_buffer(&mut self) {
self.response_queue.clear();
self.response_buffer.take();
}