Skip to content

Commit 46c577f

Browse files
author
Кирилл Безуглый
committed
fix: header encoding silently truncate-casts iproto types
1 parent 5199d85 commit 46c577f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
### Fixed
1515
- `network::client::tcp::TcpStream` does not close underlying fd anymore. Now fd will be closed only when the last copy of tcp stream is dropped.
16+
- `network::protocol::codec::Header::encode` will not truncate to `u8` an
17+
`network::protocol::codec::IProtoType` integer from an outside stream at decoding.
1618

1719
### Deprecated
1820
- `network::client::tcp::UnsafeSendSyncTcpStream` is now deprected. `network::client::tcp::TcpStream` should be used instead.

tarantool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tarantool"
33
description = "Tarantool rust bindings"
4-
version = "6.1.0"
4+
version = "6.1.1"
55
authors = [
66
"Dmitriy Koltsov <dkoltsov@picodata.io>",
77
"Georgy Moshkin <gmoshkin@picodata.io>",

tarantool/src/network/protocol/codec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ impl Header {
405405
pub fn encode(&self, stream: &mut impl Write) -> Result<(), Error> {
406406
rmp::encode::write_map_len(stream, 2)?;
407407
rmp::encode::write_pfix(stream, REQUEST_TYPE)?;
408-
rmp::encode::write_pfix(stream, self.iproto_type as u8)?;
408+
rmp::encode::write_uint(stream, self.iproto_type as _)?;
409409
rmp::encode::write_pfix(stream, SYNC)?;
410410
rmp::encode::write_uint(stream, self.sync.0)?;
411411
Ok(())

0 commit comments

Comments
 (0)