feat(http2): quickly cancel when receiving RST_STREAM
Update Http2 proto to cancel quick when the stream is reset, on an `RST_STREAM` frame. Closes: #1549
This commit is contained in:
committed by
Sean McArthur
parent
2a3844acc3
commit
ffdb478831
@@ -116,6 +116,13 @@ where
|
||||
None => return Err(::Error::new_canceled(None::<::Error>)),
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let Async::Ready(reason) =
|
||||
self.body_tx.poll_reset().map_err(|e| ::Error::new_h2(e))?
|
||||
{
|
||||
debug!("stream received RST_STREAM: {:?}", reason);
|
||||
return Err(::Error::new_h2(reason.into()));
|
||||
}
|
||||
}
|
||||
|
||||
match try_ready!(self.stream.poll_data().map_err(|e| self.on_err(e))) {
|
||||
@@ -148,6 +155,13 @@ where
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let Async::Ready(reason) =
|
||||
self.body_tx.poll_reset().map_err(|e| ::Error::new_h2(e))?
|
||||
{
|
||||
debug!("stream received RST_STREAM: {:?}", reason);
|
||||
return Err(::Error::new_h2(reason.into()));
|
||||
}
|
||||
|
||||
match try_ready!(self.stream.poll_trailers().map_err(|e| self.on_err(e))) {
|
||||
Some(trailers) => {
|
||||
self.body_tx
|
||||
|
||||
Reference in New Issue
Block a user