first test passes uwu

This commit is contained in:
nora 2022-02-22 13:15:59 +01:00
parent 6f5fef2f23
commit 9a819bc3f4
7 changed files with 30 additions and 24 deletions

View file

@ -257,8 +257,15 @@ impl Connection {
debug!(?method, "Received method");
match method {
Method::ConnectionClose { .. } => {
// todo: handle closing
Method::ConnectionClose {
reply_code,
reply_text,
class_id,
method_id,
} => {
info!(%reply_code, %reply_text, %class_id, %method_id, "Closing connection");
self.send_method(0, Method::ConnectionCloseOk {}).await?;
return Err(ProtocolError::GracefulClose.into());
}
Method::ChannelOpen { .. } => self.channel_open(frame.channel).await?,
Method::ChannelClose { .. } => self.channel_close(frame.channel, method).await?,

View file

@ -209,9 +209,6 @@ pub mod parse {
let (input, _) = tag(31_u16.to_be_bytes())(input)?;
let (input, channel_max) =
domain_short(input).map_err(fail_err("field channel-max in method tune-ok"))?;
if channel_max == 0 {
fail!("number was 0 for field channel_max")
}
let (input, frame_max) =
domain_long(input).map_err(fail_err("field frame-max in method tune-ok"))?;
let (input, heartbeat) =