fixed class and method index

This commit is contained in:
nora 2022-02-13 17:35:47 +01:00
parent 217a419ef1
commit 2903ba108e
8 changed files with 1208 additions and 1226 deletions

View file

@ -1,6 +1,7 @@
use crate::error::{ConException, ProtocolError, Result, TransError};
use anyhow::Context;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tracing::debug;
const REQUIRED_FRAME_END: u8 = 0xCE;
@ -33,6 +34,8 @@ pub async fn write_frame<W>(mut w: W, frame: &Frame) -> Result<()>
where
W: AsyncWriteExt + Unpin,
{
debug!(?frame, "sending frame");
w.write_u8(frame.kind as u8).await?;
w.write_u16(frame.channel).await?;
w.write_u32(u32::try_from(frame.payload.len()).context("frame size too big")?)