aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-07-14 14:25:37 -0700
committerGravatar yang-g <yangg@google.com>2015-07-14 14:25:37 -0700
commit94d6225ae7fa587f787fcbfdbd3ab8a365d1bb04 (patch)
tree9c0be81fb69e84290dfe58d48aea88f165726612 /include/grpc++
parent1cbeeb508b033c84f73ec79756bb4f7c0227a0d0 (diff)
Create server side auth context lazily
Diffstat (limited to 'include/grpc++')
-rw-r--r--include/grpc++/server_context.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h
index a4ee986df1..2123d03291 100644
--- a/include/grpc++/server_context.h
+++ b/include/grpc++/server_context.h
@@ -99,9 +99,7 @@ class ServerContext {
return client_metadata_;
}
- std::shared_ptr<const AuthContext> auth_context() const {
- return auth_context_;
- }
+ std::shared_ptr<const AuthContext> auth_context() const;
private:
friend class ::grpc::Server;
@@ -147,7 +145,7 @@ class ServerContext {
grpc_call* call_;
CompletionQueue* cq_;
bool sent_initial_metadata_;
- std::shared_ptr<const AuthContext> auth_context_;
+ mutable std::shared_ptr<const AuthContext> auth_context_;
std::multimap<grpc::string, grpc::string> client_metadata_;
std::multimap<grpc::string, grpc::string> initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_;