aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/codegen/server_context.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-04-11 20:11:18 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-04-11 20:11:18 -0700
commit3ab2fe009495ce9b13b35e5cb35cf47991a85647 (patch)
treee051416beb3bdbf9d75328d901c350cdc9213758 /include/grpc++/impl/codegen/server_context.h
parentd626acbb02c93fd15b12d8ef8833a65d0c3781e6 (diff)
Rollup of changes from the latest import
Diffstat (limited to 'include/grpc++/impl/codegen/server_context.h')
-rw-r--r--include/grpc++/impl/codegen/server_context.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index 7fa0235ca9..a1e1ed176f 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -38,6 +38,7 @@
#include <memory>
#include <grpc++/impl/codegen/config.h>
+#include <grpc++/impl/codegen/create_auth_context.h>
#include <grpc++/impl/codegen/security/auth_context.h>
#include <grpc++/impl/codegen/string_ref.h>
#include <grpc++/impl/codegen/time.h>
@@ -135,7 +136,12 @@ class ServerContext {
}
void set_compression_algorithm(grpc_compression_algorithm algorithm);
- std::shared_ptr<const AuthContext> auth_context() const;
+ std::shared_ptr<const AuthContext> auth_context() const {
+ if (auth_context_.get() == nullptr) {
+ auth_context_ = CreateAuthContext(call_);
+ }
+ return auth_context_;
+ }
// Return the peer uri in a string.
// WARNING: this value is never authenticated or subject to any security
@@ -193,7 +199,7 @@ class ServerContext {
ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
size_t metadata_count);
- void set_call(grpc_call* call);
+ void set_call(grpc_call* call) { call_ = call; }
uint32_t initial_metadata_flags() const { return 0; }