diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-23 14:20:50 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-23 14:20:50 -0700 |
commit | 6b4fc31f08b9a61a90262379072cffea0bc39795 (patch) | |
tree | 7b10e0d7d6324d5eebfe8b112d7e9315486feab0 /src | |
parent | bcd1ff2fc3b87a9830eb785fb8cadc50a55cc2d5 (diff) | |
parent | 01ac44bf080deb1781f40aac1e74e034ce8adb25 (diff) |
Merge pull request #2180 from yang-g/constness
Add missing headers to build.json
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/proto/proto_utils.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 268e4f6d1f..7b2a65e99b 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -154,13 +154,16 @@ namespace grpc { Status SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) { GrpcBufferWriter writer(bp); - return msg.SerializeToZeroCopyStream(&writer) ? Status::OK : Status(INVALID_ARGUMENT, "Failed to serialize message"); + return msg.SerializeToZeroCopyStream(&writer) + ? Status::OK + : Status(StatusCode::INVALID_ARGUMENT, + "Failed to serialize message"); } Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg, int max_message_size) { if (!buffer) { - return Status(INVALID_ARGUMENT, "No payload"); + return Status(StatusCode::INVALID_ARGUMENT, "No payload"); } GrpcBufferReader reader(buffer); ::grpc::protobuf::io::CodedInputStream decoder(&reader); @@ -168,10 +171,11 @@ Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg, decoder.SetTotalBytesLimit(max_message_size, max_message_size); } if (!msg->ParseFromCodedStream(&decoder)) { - return Status(INVALID_ARGUMENT, msg->InitializationErrorString()); + return Status(StatusCode::INVALID_ARGUMENT, + msg->InitializationErrorString()); } if (!decoder.ConsumedEntireMessage()) { - return Status(INVALID_ARGUMENT, "Did not read entire message"); + return Status(StatusCode::INVALID_ARGUMENT, "Did not read entire message"); } return Status::OK; } |