thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lihua Yu"<peter...@163.com>
Subject TCompactProtocol(C++) doesn't work together with TBufferedTranport
Date Thu, 24 Jun 2010 05:29:42 GMT
How to Repeat:
any client: TCompactProtocol/TSocket
any server: SimpleServer/TCompactProtocol/TBufferedTranport
client call server, and server will block.


Possbile Cause:
TCompactProtocol::readVarint32() is  based on TCompactProtocol::readVarint64().
the code of readVarint64() is as follows:
  int shift = 0;
  uint8_t buf[10];  // 64 bits / (7 bits/byte) = 10 bytes.
  uint32_t buf_size = sizeof(buf);
  const uint8_t* borrowed = trans_->borrow(buf, &buf_size);
if the underlying tranport is TBufferedTransport, and the avaiable data is less than 10 bytes,
 i.e. 7 bytes
TCompactProtocol::readVarint64 blocks.



2010-06-24



Lihua Yu


Mime
View raw message