MCPcopy Create free account
hub / github.com/apache/thrift / readMessageBegin

Method readMessageBegin

lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:954–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952}
953
954uint32_t TJSONProtocol::readMessageBegin(std::string& name,
955 TMessageType& messageType,
956 int32_t& seqid) {
957 uint32_t result = readJSONArrayStart();
958 int64_t tmpVal = 0;
959 result += readJSONInteger(tmpVal);
960 if (tmpVal != kThriftVersion1) {
961 throw TProtocolException(TProtocolException::BAD_VERSION, "Message contained bad version.");
962 }
963 result += readJSONString(name);
964 result += readJSONInteger(tmpVal);
965 messageType = (TMessageType)tmpVal;
966 result += readJSONInteger(tmpVal);
967 if (tmpVal > (std::numeric_limits<int32_t>::max)() ||
968 tmpVal < (std::numeric_limits<int32_t>::min)())
969 throw TProtocolException(TProtocolException::INVALID_DATA, "sequence id is not int32_t");
970 seqid = static_cast<int32_t>(tmpVal);
971 return result;
972}
973
974uint32_t TJSONProtocol::readMessageEnd() {
975 return readJSONArrayEnd();

Callers 1

deserializeJSONFunction · 0.95

Calls 1

TProtocolExceptionClass · 0.70

Tested by 1

deserializeJSONFunction · 0.76