aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-18 13:18:53 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-18 13:18:53 -0800
commit7326901767e0f12e27df8da7524d57ea53eb1fc2 (patch)
treed04114fa92977a4e6e0c4808233229e2910d2b83 /include/grpc++
parent62a9641f825290617bb9c30d0a58e7d4f59c52d6 (diff)
parentd0d007e6d1139625e05ebd5859289c08a8668033 (diff)
Merge pull request #579 from yang-g/c++api
change metadata getters to return const&
Diffstat (limited to 'include/grpc++')
-rw-r--r--include/grpc++/client_context.h4
-rw-r--r--include/grpc++/server_context.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h
index 24e67c9ee1..52bedd4d38 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<grpc::string, grpc::string> GetServerInitialMetadata() {
+ const std::multimap<grpc::string, grpc::string>& GetServerInitialMetadata() {
GPR_ASSERT(initial_metadata_received_);
return recv_initial_metadata_;
}
- std::multimap<grpc::string, grpc::string> GetServerTrailingMetadata() {
+ const std::multimap<grpc::string, grpc::string>& GetServerTrailingMetadata() {
// TODO(yangg) check finished
return trailing_metadata_;
}
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h
index 06744f8f4f..520278f949 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<grpc::string, grpc::string> client_metadata() {
+ const std::multimap<grpc::string, grpc::string>& client_metadata() {
return client_metadata_;
}