Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed May 29, 2018
2 parents 226fee1 + 5854e8f commit 3708ea3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion getVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SCRIPTDIR="$( cd "$(dirname $0)" && pwd )"

REVISION_FILE=$SCRIPTDIR/revision.txt
REVISION=$(cat $REVISION_FILE)
echo 0.1.6-$REVISION
echo 0.1.7-$REVISION
2 changes: 1 addition & 1 deletion revision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
23
2 changes: 1 addition & 1 deletion src/BinaryRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int32_t BinaryRpc::process(char* buffer, int32_t bufferLength)
throw BinaryRpcException("Packet does not start with \"Bin\".");
}
_type = (_data[3] & 1) ? Type::response : Type::request;
if(_data[3] & 0x40)
if(_data[3] == 0x40 || _data[3] == 0x41)
{
_hasHeader = true;
memcpyBigEndian((char*)&_headerSize, _data.data() + 4, 4);
Expand Down
8 changes: 4 additions & 4 deletions src/RpcDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RpcDecoder::RpcDecoder()
std::shared_ptr<RpcHeader> RpcDecoder::decodeHeader(std::vector<char>& packet)
{
std::shared_ptr<RpcHeader> header = std::make_shared<RpcHeader>();
if(!(packet.size() < 12 || (packet.at(3) & 0x40))) return header;
if(!(packet.size() < 12 || packet.at(3) == 0x40 || packet.at(3) == 0x41)) return header;
uint32_t position = 4;
uint32_t headerSize = 0;
headerSize = _decoder->decodeInteger(packet, position);
Expand All @@ -60,7 +60,7 @@ std::shared_ptr<RpcHeader> RpcDecoder::decodeHeader(std::vector<char>& packet)
std::shared_ptr<RpcHeader> RpcDecoder::decodeHeader(std::vector<uint8_t>& packet)
{
std::shared_ptr<RpcHeader> header = std::make_shared<RpcHeader>();
if(!(packet.size() < 12 || (packet.at(3) & 0x40))) return header;
if(!(packet.size() < 12 || packet.at(3) == 0x40 || packet.at(3) == 0x41)) return header;
uint32_t position = 4;
uint32_t headerSize = 0;
headerSize = _decoder->decodeInteger(packet, position);
Expand All @@ -80,7 +80,7 @@ std::shared_ptr<std::vector<std::shared_ptr<Variable>>> RpcDecoder::decodeReques
{
uint32_t position = 4;
uint32_t headerSize = 0;
if(packet.at(3) & 0x40) headerSize = _decoder->decodeInteger(packet, position) + 4;
if(packet.at(3) == 0x40 || packet.at(3) == 0x41) headerSize = _decoder->decodeInteger(packet, position) + 4;
position = 8 + headerSize;
methodName = _decoder->decodeString(packet, position);
uint32_t parameterCount = _decoder->decodeInteger(packet, position);
Expand All @@ -97,7 +97,7 @@ std::shared_ptr<std::vector<std::shared_ptr<Variable>>> RpcDecoder::decodeReques
{
uint32_t position = 4;
uint32_t headerSize = 0;
if(packet.at(3) & 0x40) headerSize = _decoder->decodeInteger(packet, position) + 4;
if(packet.at(3) == 0x40 || packet.at(3) == 0x41) headerSize = _decoder->decodeInteger(packet, position) + 4;
position = 8 + headerSize;
methodName = _decoder->decodeString(packet, position);
uint32_t parameterCount = _decoder->decodeInteger(packet, position);
Expand Down

0 comments on commit 3708ea3

Please sign in to comment.