aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-02-17 10:21:31 -0800
committerGravatar Yang Gao <yangg@google.com>2015-02-17 10:21:31 -0800
commitf2c0ca4c6296dddfc46d84c8d2b422eff3531551 (patch)
tree0bf5b3661683efbdfb7fbe329ca4b147616be4c0 /include
parent573523f1278a8c797c10ebb2a8b571d6891a22cc (diff)
Add setter to override authority header on ClientContext
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/client_context.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h
index 2813e13abe..4594cbaeb6 100644
--- a/include/grpc++/client_context.h
+++ b/include/grpc++/client_context.h
@@ -94,6 +94,10 @@ class ClientContext {
void set_absolute_deadline(const system_clock::time_point &deadline);
system_clock::time_point absolute_deadline();
+ void set_authority(const grpc::string& authority) {
+ authority_ = authority;
+ }
+
void TryCancel();
private:
@@ -137,10 +141,15 @@ class ClientContext {
gpr_timespec RawDeadline() { return absolute_deadline_; }
+ grpc::string authority() {
+ return authority_;
+ }
+
bool initial_metadata_received_ = false;
grpc_call *call_;
grpc_completion_queue *cq_;
gpr_timespec absolute_deadline_;
+ grpc::string authority_;
std::multimap<grpc::string, grpc::string> send_initial_metadata_;
std::multimap<grpc::string, grpc::string> recv_initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_;