diff --git a/getVersion.sh b/getVersion.sh index 1d102d2..35a5b98 100755 --- a/getVersion.sh +++ b/getVersion.sh @@ -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 diff --git a/revision.txt b/revision.txt index 2bd5a0a..4099407 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -22 +23 diff --git a/src/BinaryRpc.cpp b/src/BinaryRpc.cpp index 83e8ecf..7cf1c56 100644 --- a/src/BinaryRpc.cpp +++ b/src/BinaryRpc.cpp @@ -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); diff --git a/src/RpcDecoder.cpp b/src/RpcDecoder.cpp index 66db57a..2b9584d 100644 --- a/src/RpcDecoder.cpp +++ b/src/RpcDecoder.cpp @@ -41,7 +41,7 @@ RpcDecoder::RpcDecoder() std::shared_ptr RpcDecoder::decodeHeader(std::vector& packet) { std::shared_ptr header = std::make_shared(); - 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); @@ -60,7 +60,7 @@ std::shared_ptr RpcDecoder::decodeHeader(std::vector& packet) std::shared_ptr RpcDecoder::decodeHeader(std::vector& packet) { std::shared_ptr header = std::make_shared(); - 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); @@ -80,7 +80,7 @@ std::shared_ptr>> 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); @@ -97,7 +97,7 @@ std::shared_ptr>> 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);