diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 24e67c9ee1f..52bedd4d38e 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -81,12 +81,12 @@ class ClientContext { void AddMetadata(const grpc::string &meta_key, const grpc::string &meta_value); - std::multimap GetServerInitialMetadata() { + const std::multimap& GetServerInitialMetadata() { GPR_ASSERT(initial_metadata_received_); return recv_initial_metadata_; } - std::multimap GetServerTrailingMetadata() { + const std::multimap& GetServerTrailingMetadata() { // TODO(yangg) check finished return trailing_metadata_; } diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 06744f8f4fd..520278f9492 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -76,7 +76,7 @@ class ServerContext final { void AddInitialMetadata(const grpc::string& key, const grpc::string& value); void AddTrailingMetadata(const grpc::string& key, const grpc::string& value); - std::multimap client_metadata() { + const std::multimap& client_metadata() { return client_metadata_; }