summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorihciah <ihciah@gmail.com>2021-07-02 01:00:42 +0800
committerJens Geyer <Jens-G@users.noreply.github.com>2022-01-26 22:56:08 +0100
commit5f16344311a57ac016190984dd1aaa44e19a6487 (patch)
tree47c45ab59ae5b84d96968fe4b1aadf56225e031f
parentfebc5121ea425d92623512367d7e365c13be31c4 (diff)
downloadthrift-5f16344311a57ac016190984dd1aaa44e19a6487.tar.gz
fix wrong thrift strict header comparing
-rw-r--r--lib/rs/src/protocol/binary.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rs/src/protocol/binary.rs b/lib/rs/src/protocol/binary.rs
index 8509c34ae..efee8c11b 100644
--- a/lib/rs/src/protocol/binary.rs
+++ b/lib/rs/src/protocol/binary.rs
@@ -84,7 +84,7 @@ where
// the thrift version header is intentionally negative
// so the first check we'll do is see if the sign bit is set
// and if so - assume it's the protocol-version header
- if first_bytes[0] >= 8 {
+ if ((first_bytes[0] & 0x80) != 0) {
// apparently we got a protocol-version header - check
// it, and if it matches, read the rest of the fields
if first_bytes[0..2] != [0x80, 0x01] {