Avoid deprecated method

The two-parameter overload of SetTotalBytesLimit was removed in
https://github.com/protocolbuffers/protobuf/commit/cda7954; since we are
looking to upgrade protobuf past that revision, we need to migrate to
the single-parameter overload.

This patch is necessary because we cannot move to a more recent version
of gRPC until https://github.com/grpc/grpc/pull/26869 is landed due to
the use of wyhash and its UNLICENSE.

Change-Id: I226fea814226febaf1c5e5206d3eba3d415e9bdf
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/grpc/+/564026
Reviewed-by: James Robinson <jamesr@google.com>
This commit is contained in:
Tamir Duberstein 2021-08-03 16:56:26 -04:00
parent 83fcc63166
commit 1d06f93345

View File

@ -221,7 +221,7 @@ Status GenericDeserialize(grpc_byte_buffer* buffer,
return reader.status();
}
::grpc::protobuf::io::CodedInputStream decoder(&reader);
decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);
decoder.SetTotalBytesLimit(INT_MAX);
if (!msg->ParseFromCodedStream(&decoder)) {
result = Status(StatusCode::INTERNAL, msg->InitializationErrorString());
}