Skip to content

Commit

Permalink
fix: split to panic (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu authored Nov 22, 2022
1 parent cb511ae commit ea8d379
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pilota/src/thrift/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,7 @@ impl TInputProtocol for TBinaryProtocol<&mut BytesMut> {
#[inline]
fn read_bytes(&mut self) -> Result<Bytes, Error> {
let len = self.trans.read_i32()?;
// first, drop the previous bytes
self.trans.advance(self.trans.len());
// then, split and freeze it
// split and freeze it
Ok(self.trans.split_to(len as usize).freeze())
}

Expand Down

0 comments on commit ea8d379

Please sign in to comment.