aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-01-23 14:54:31 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-01-23 14:54:31 -0800
commita53c193aa5dd9916c0d60693ab1e77b3501265ed (patch)
tree68be63155952d1844b621454b1b4b6435a6a5cdd /src/cpp/client
parent7fa7d6817ef99cdf75690b55962c44b40f09a700 (diff)
parent889b0a45352928e2a815c34d5f849be9641284b0 (diff)
Merge github.com:grpc/grpc into faster_slices
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,