H3: let client close connection gracefully

This commit is contained in:
stammw
2019-09-09 23:10:20 +02:00
committed by Dirkjan Ochtman
parent accb344fe0
commit 36dfee6ea7
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -95,6 +95,10 @@ impl Connection {
conn: self.0.clone(),
}
}
pub fn close(self, error_code: u32, reason: &[u8]) {
self.0.quic.close(error_code.into(), reason);
}
}
pub struct Connecting {
+1 -1
View File
@@ -33,7 +33,7 @@ impl Future for ConnectionDriver {
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
match self.incoming.poll()? {
Async::Ready(None) => return Err(Error::peer("incoming requests closed")),
Async::Ready(None) => return Ok(Async::Ready(())),
Async::Ready(Some(NewStream::Uni(_recv))) => {
info!(self.log, "incoming uni stream ignored");
}