$this->writeString($name) +
$this->writeI32($seqid);
} else {
- return
+ return
$this->writeString($name) +
$this->writeByte($type) +
$this->writeI32($seqid);
public function readMessageBegin(&$name, &$type, &$seqid) {
$result = $this->readI32($sz);
if ($sz < 0) {
- $version = $sz & self::VERSION_MASK;
- if ($version != self::VERSION_1) {
+ $version = (int) ($sz & self::VERSION_MASK);
+ if ($version != (int) self::VERSION_1) {
throw new TProtocolException('Bad version identifier: '.$sz, TProtocolException::BAD_VERSION);
}
$type = $sz & 0x000000ff;
} else {
// Handle pre-versioned input
$name = $this->trans_->readAll($sz);
- $result +=
+ $result +=
$sz +
$this->readByte($type) +
$this->readI32($seqid);
$hi = $arr[1];
$lo = $arr[2];
$isNeg = $hi < 0;
-
+
// Check for a negative
if ($isNeg) {
$hi = ~$hi & (int)0xffffffff;
// Force 32bit words in excess of 2G to pe positive - we deal wigh sign
// explicitly below
-
+
if ($hi & (int)0x80000000) {
$hi &= (int)0x7fffffff;
$hi += 0x80000000;
}
-
+
if ($lo & (int)0x80000000) {
$lo &= (int)0x7fffffff;
$lo += 0x80000000;
}
-
+
$value = $hi * 4294967296 + $lo;
if ($isNeg) {
$value = $arr[1]*4294967296 + $arr[2];
}
}
-
+
return 8;
}
public function __construct($strictRead=false, $strictWrite=false) {
$this->strictRead_ = $strictRead;
$this->strictWrite_ = $strictWrite;
- }
+ }
public function getProtocol($trans) {
return new TBinaryProtocol($trans, $this->strictRead, $this->strictWrite);
// TBufferedTransport (which does)
if (!method_exists($trans, 'putBack')) {
$trans = new TBufferedTransport($trans);
- }
+ }
parent::__construct($trans, $strictRead, $strictWrite);
}
}