aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/server/server_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpp/server/server_context.cc')
-rw-r--r--src/cpp/server/server_context.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc
index a66ec4ac84..a7aaa25572 100644
--- a/src/cpp/server/server_context.cc
+++ b/src/cpp/server/server_context.cc
@@ -144,9 +144,10 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
sent_initial_metadata_(false),
compression_level_set_(false) {
for (size_t i = 0; i < metadata_count; i++) {
- client_metadata_.insert(std::pair<grpc::string_ref, grpc::string_ref>(
- metadata[i].key,
- grpc::string_ref(metadata[i].value, metadata[i].value_length)));
+ client_metadata_.map()->insert(
+ std::pair<grpc::string_ref, grpc::string_ref>(
+ StringRefFromSlice(&metadata[i].key),
+ StringRefFromSlice(&metadata[i].value)));
}
}