diff options
author | Craig Tiller <ctiller@google.com> | 2016-05-18 16:55:35 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-05-18 16:55:35 -0700 |
commit | 9766f4f42482155c5442bd5e3c065ec68caa7a1f (patch) | |
tree | 7382c554269a5b9d03b925f8a996c2e9b6ebb3c7 /include/grpc++ | |
parent | 88ef00efbe0ec62110b405e02e4bbbec59f6435b (diff) | |
parent | 8c1d79690d01b279cb48de1b66566a4858ed665f (diff) |
Merge github.com:grpc/grpc into test_affine
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/impl/codegen/call.h | 7 | ||||
-rw-r--r-- | include/grpc++/impl/codegen/proto_utils.h | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index d081b7d9c5..d457f03fa6 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -329,8 +329,11 @@ class CallOpGenericRecvMessage { template <class R> void RecvMessage(R* message) { - deserialize_.reset( - new CallOpGenericRecvMessageHelper::DeserializeFuncType<R>(message)); + // Use an explicit base class pointer to avoid resolution error in the + // following unique_ptr::reset for some old implementations. + CallOpGenericRecvMessageHelper::DeserializeFunc* func = + new CallOpGenericRecvMessageHelper::DeserializeFuncType<R>(message); + deserialize_.reset(func); } bool got_message; diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h index d044ddc642..3bad468a74 100644 --- a/include/grpc++/impl/codegen/proto_utils.h +++ b/include/grpc++/impl/codegen/proto_utils.h @@ -49,7 +49,7 @@ namespace grpc { extern CoreCodegenInterface* g_core_codegen_interface; -namespace { +namespace internal { const int kGrpcBufferWriterMaxBufferLength = 8192; @@ -166,7 +166,7 @@ class GrpcBufferReader GRPC_FINAL grpc_byte_buffer_reader reader_; gpr_slice slice_; }; -} // namespace +} // namespace internal template <class T> class SerializationTraits<T, typename std::enable_if<std::is_base_of< @@ -176,7 +176,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< grpc_byte_buffer** bp, bool* own_buffer) { *own_buffer = true; int byte_size = msg.ByteSize(); - if (byte_size <= kGrpcBufferWriterMaxBufferLength) { + if (byte_size <= internal::kGrpcBufferWriterMaxBufferLength) { gpr_slice slice = g_core_codegen_interface->gpr_slice_malloc(byte_size); GPR_CODEGEN_ASSERT( GPR_SLICE_END_PTR(slice) == @@ -185,7 +185,8 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< g_core_codegen_interface->gpr_slice_unref(slice); return g_core_codegen_interface->ok(); } else { - GrpcBufferWriter writer(bp, kGrpcBufferWriterMaxBufferLength); + internal::GrpcBufferWriter writer( + bp, internal::kGrpcBufferWriterMaxBufferLength); return msg.SerializeToZeroCopyStream(&writer) ? g_core_codegen_interface->ok() : Status(StatusCode::INTERNAL, "Failed to serialize message"); @@ -200,7 +201,7 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of< } Status result = g_core_codegen_interface->ok(); { - GrpcBufferReader reader(buffer); + internal::GrpcBufferReader reader(buffer); ::grpc::protobuf::io::CodedInputStream decoder(&reader); if (max_message_size > 0) { decoder.SetTotalBytesLimit(max_message_size, max_message_size); |