Skip to content

Commit

Permalink
Discard CRLF on connection based transports
Browse files Browse the repository at this point in the history
  • Loading branch information
kbalt committed Sep 13, 2023
1 parent 930fd6f commit afa6125
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/sip-core/src/transport/streaming/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ impl Decoder for StreamingDecoder {
type Error = Error;

fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
// TODO check for CRLF and discard
if &src[..] == b"\r\n" {
src.clear();
return Ok(None);
}

if src.len() > 4096 {
// do not allow a message head larger than that
Expand Down

0 comments on commit afa6125

Please sign in to comment.