aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-26 13:51:24 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-26 13:51:24 -0800
commitc2e85bf9f619357c2272756417fa21911881c375 (patch)
tree19499736fc3954c5f6db3d9eaf2540d93007ef2f /src/cpp/client
parentf8ea95786fc0c266c93881e4df4be9871196ac66 (diff)
parent4edd56751f8309f55922518f2598c35f3c007b1e (diff)
Merge branch 'maxmsgsz' into bm_msgsz
Diffstat (limited to 'src/cpp/client')
-rw-r--r--src/cpp/client/channel_cc.cc18
-rw-r--r--src/cpp/client/secure_credentials.cc9
-rw-r--r--src/cpp/client/secure_credentials.h2
3 files changed, 8 insertions, 21 deletions
diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc
index c985183ae7..357d8317ad 100644
--- a/src/cpp/client/channel_cc.cc
+++ b/src/cpp/client/channel_cc.cc
@@ -107,20 +107,10 @@ Call Channel::CreateCall(const RpcMethod& method, ClientContext* context,
} else if (!host_.empty()) {
host_str = host_.c_str();
}
- grpc_slice method_slice = SliceFromCopiedString(method.name());
- grpc_slice host_slice;
- if (host_str != nullptr) {
- host_slice = SliceFromCopiedString(host_str);
- }
- c_call = grpc_channel_create_call(
- c_channel_, context->propagate_from_call_,
- context->propagation_options_.c_bitmask(), cq->cq(), method_slice,
- host_str == nullptr ? nullptr : &host_slice, context->raw_deadline(),
- nullptr);
- grpc_slice_unref(method_slice);
- if (host_str != nullptr) {
- grpc_slice_unref(host_slice);
- }
+ c_call = grpc_channel_create_call(c_channel_, context->propagate_from_call_,
+ context->propagation_options_.c_bitmask(),
+ cq->cq(), method.name(), host_str,
+ context->raw_deadline(), nullptr);
}
grpc_census_call_set_context(c_call, context->census_context());
context->set_call(c_call, shared_from_this());
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index 25f6bab7f2..269c523bba 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -206,18 +206,15 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
std::vector<grpc_metadata> md;
for (auto it = metadata.begin(); it != metadata.end(); ++it) {
grpc_metadata md_entry;
- md_entry.key = SliceFromCopiedString(it->first);
- md_entry.value = SliceFromCopiedString(it->second);
+ md_entry.key = it->first.c_str();
+ md_entry.value = it->second.data();
+ md_entry.value_length = it->second.size();
md_entry.flags = 0;
md.push_back(md_entry);
}
cb(user_data, md.empty() ? nullptr : &md[0], md.size(),
static_cast<grpc_status_code>(status.error_code()),
status.error_message().c_str());
- for (auto it = md.begin(); it != md.end(); ++it) {
- grpc_slice_unref(it->key);
- grpc_slice_unref(it->value);
- }
}
MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h
index 713654ad5b..281db17e98 100644
--- a/src/cpp/client/secure_credentials.h
+++ b/src/cpp/client/secure_credentials.h
@@ -70,7 +70,7 @@ class SecureCallCredentials final : public CallCredentials {
grpc_call_credentials* const c_creds_;
};
-class MetadataCredentialsPluginWrapper final : private GrpcLibraryCodegen {
+class MetadataCredentialsPluginWrapper final {
public:
static void Destroy(void* wrapper);
static void GetMetadata(void* wrapper, grpc_auth_metadata_context context,