Shutdown the stream along with connection (#304)
This will in particular send close notify alerts for TLS streams.
This commit is contained in:
committed by
Sean McArthur
parent
3b57049792
commit
66a5d113d4
@@ -189,7 +189,7 @@ where
|
|||||||
State::Open => {
|
State::Open => {
|
||||||
match self.poll2() {
|
match self.poll2() {
|
||||||
// The connection has shutdown normally
|
// The connection has shutdown normally
|
||||||
Ok(Async::Ready(())) => return self.take_error(Reason::NO_ERROR),
|
Ok(Async::Ready(())) => self.state = State::Closing(Reason::NO_ERROR),
|
||||||
// The connection is not ready to make progress
|
// The connection is not ready to make progress
|
||||||
Ok(Async::NotReady) => {
|
Ok(Async::NotReady) => {
|
||||||
// Ensure all window updates have been sent.
|
// Ensure all window updates have been sent.
|
||||||
@@ -253,8 +253,8 @@ where
|
|||||||
}
|
}
|
||||||
State::Closing(reason) => {
|
State::Closing(reason) => {
|
||||||
trace!("connection closing after flush, reason={:?}", reason);
|
trace!("connection closing after flush, reason={:?}", reason);
|
||||||
// Flush the codec
|
// Flush/shutdown the codec
|
||||||
try_ready!(self.codec.flush());
|
try_ready!(self.codec.shutdown());
|
||||||
|
|
||||||
// Transition the state to error
|
// Transition the state to error
|
||||||
self.state = State::Closed(reason);
|
self.state = State::Closed(reason);
|
||||||
|
|||||||
Reference in New Issue
Block a user