Fixed bug in line protocol.

This commit is contained in:
Aaron Weiss 2017-06-21 16:50:54 -04:00
parent 7d3e923de8
commit 6118516951
No known key found for this signature in database
GPG key ID: 0237035D9BF03AE2
2 changed files with 1 additions and 4 deletions

View file

@ -33,9 +33,6 @@ impl Decoder for LineCodec {
// Remove the next frame from the buffer. // Remove the next frame from the buffer.
let line = src.split_to(n + 1); let line = src.split_to(n + 1);
// Remove the new-line from the buffer.
src.split_to(1);
// Decode the line using the codec's encoding. // Decode the line using the codec's encoding.
match self.encoding.decode(line.as_ref(), DecoderTrap::Replace) { match self.encoding.decode(line.as_ref(), DecoderTrap::Replace) {
Ok(data) => Ok(Some(data)), Ok(data) => Ok(Some(data)),

View file

@ -39,7 +39,7 @@ impl Message {
Ok(Message { Ok(Message {
tags: tags, tags: tags,
prefix: prefix.map(|s| s.to_owned()), prefix: prefix.map(|s| s.to_owned()),
command: try!(Command::new(command, args, suffix)), command: Command::new(command, args, suffix)?,
}) })
} }