aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-10-01 08:01:58 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-10-01 08:01:58 -0700
commitb7a597771f4db347748b5e5f89d02ed067c5a614 (patch)
tree10cf9b21fd8d2904bc6d191db0016ee38ffececf /src/cpp
parent71a0f9d3b02ea51b17581e7b655bb48e85f6e553 (diff)
parent2b2a1ad6ca97da100fd469085f0ffef847e87e65 (diff)
Merge github.com:grpc/grpc into clangf
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/client/secure_credentials.cc15
-rw-r--r--src/cpp/server/secure_server_credentials.cc24
2 files changed, 21 insertions, 18 deletions
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index 1693cf740b..8299ebeb8a 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -154,10 +154,10 @@ void MetadataCredentialsPluginWrapper::Destroy(void* wrapper) {
void MetadataCredentialsPluginWrapper::GetMetadata(
void* wrapper, const char* service_url,
grpc_credentials_plugin_metadata_cb cb, void* user_data) {
- GPR_ASSERT(wrapper != nullptr);
+ GPR_ASSERT(wrapper);
MetadataCredentialsPluginWrapper* w =
reinterpret_cast<MetadataCredentialsPluginWrapper*>(wrapper);
- if (w->plugin_ == nullptr) {
+ if (!w->plugin_) {
cb(user_data, NULL, 0, GRPC_STATUS_OK, NULL);
return;
}
@@ -177,11 +177,12 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
Status status = plugin_->GetMetadata(service_url, &metadata);
std::vector<grpc_metadata> md;
for (auto it = metadata.begin(); it != metadata.end(); ++it) {
- md.push_back({it->first.c_str(),
- it->second.data(),
- it->second.size(),
- 0,
- {{nullptr, nullptr, nullptr, nullptr}}});
+ grpc_metadata md_entry;
+ 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()),
diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc
index af20d04047..d472667a7e 100644
--- a/src/cpp/server/secure_server_credentials.cc
+++ b/src/cpp/server/secure_server_credentials.cc
@@ -51,7 +51,7 @@ void AuthMetadataProcessorAyncWrapper::Process(
void* wrapper, grpc_auth_context* context, const grpc_metadata* md,
size_t num_md, grpc_process_auth_metadata_done_cb cb, void* user_data) {
auto* w = reinterpret_cast<AuthMetadataProcessorAyncWrapper*>(wrapper);
- if (w->processor_ == nullptr) {
+ if (!w->processor_) {
// Early exit.
cb(user_data, nullptr, 0, nullptr, 0, GRPC_STATUS_OK, nullptr);
return;
@@ -84,20 +84,22 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
std::vector<grpc_metadata> consumed_md;
for (auto it = consumed_metadata.begin(); it != consumed_metadata.end();
++it) {
- consumed_md.push_back({it->first.c_str(),
- it->second.data(),
- it->second.size(),
- 0,
- {{nullptr, nullptr, nullptr, nullptr}}});
+ grpc_metadata md_entry;
+ md_entry.key = it->first.c_str();
+ md_entry.value = it->second.data();
+ md_entry.value_length = it->second.size();
+ md_entry.flags = 0;
+ consumed_md.push_back(md_entry);
}
std::vector<grpc_metadata> response_md;
for (auto it = response_metadata.begin(); it != response_metadata.end();
++it) {
- response_md.push_back({it->first.c_str(),
- it->second.data(),
- it->second.size(),
- 0,
- {{nullptr, nullptr, nullptr, nullptr}}});
+ grpc_metadata md_entry;
+ md_entry.key = it->first.c_str();
+ md_entry.value = it->second.data();
+ md_entry.value_length = it->second.size();
+ md_entry.flags = 0;
+ response_md.push_back(md_entry);
}
auto consumed_md_data = consumed_md.empty() ? nullptr : &consumed_md[0];
auto response_md_data = response_md.empty() ? nullptr : &response_md[0];