Fixed bug in line protocol.
This commit is contained in:
parent
7d3e923de8
commit
6118516951
2 changed files with 1 additions and 4 deletions
|
@ -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)),
|
||||||
|
|
|
@ -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)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue