protocols/request-response: Close response stream even if response cannot be sent (#1987)

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
Thomas Eizinger
2021-03-10 03:50:57 +11:00
committed by GitHub
parent f304fe762b
commit ed6f972162
3 changed files with 71 additions and 12 deletions

View File

@@ -106,6 +106,7 @@ where
let write = self.codec.write_response(&protocol, &mut io, response);
write.await?;
} else {
io.close().await?;
return Ok(false)
}
}