implement h2::server::Stream::send_reset(Reason) and Body::is_empty() (#22)
This commit is contained in:
committed by
Carl Lerche
parent
e8f757457b
commit
f839443ece
@@ -242,6 +242,19 @@ impl State {
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicates that the local side will not send more data to the local.
|
||||
pub fn send_reset(&mut self, reason: Reason) -> Result<(), ConnectionError> {
|
||||
match self.inner {
|
||||
Idle => Err(ProtocolError.into()),
|
||||
Closed(..) => Ok(()),
|
||||
_ => {
|
||||
trace!("send_reset: => Closed");
|
||||
self.inner = Closed(Some(Cause::Proto(reason)));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if a stream with the current state counts against the
|
||||
/// concurrency limit.
|
||||
pub fn is_counted(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user