Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Duplicate
-
0.9.1
-
None
Description
In TCompactProtocol, bool-value and FieldBegin(TFiled)will be encoded in one byte(00010001/00010010, express TRUE and FALSE) .
In python client lib,the code for decoding is as follows :
$result = $this->readUByte($field_type);
if (($field_type & 0x0f) == TType::STOP)
$delta = $field_type >> 4;
if ($delta == 0)
else
{ $field_id = $this->lastFid + $delta; } $this->lastFid = $field_id;
// Error , this method always returns a constant value(TType::BOOL).
$field_type = $this->getTType($field_type & 0x0f);
if ($field_type == TCompactProtocol::COMPACT_TRUE)
elseif ($field_type == TCompactProtocol::COMPACT_FALSE)
{ $this->state = TCompactProtocol::STATE_BOOL_READ; $this->boolValue = false; }else
{ $this->state = TCompactProtocol::STATE_VALUE_READ; }return $result;
Attachments
Issue Links
- duplicates
-
THRIFT-3348 PHP TCompactProtocol bool&int64 readvalue bug
-
- Closed
-