aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-02-08 15:18:13 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-02-08 15:18:13 -0800
commit0693b72b7fdf7927ad120319ce53b4cf78cc11c9 (patch)
tree9af4eeefbf4e7c98ccd5264eb7280a26f637e18c /src/core/ext/transport
parent5122487fad891fdf5560122285c1690a06df73d2 (diff)
parentbf19c3332161b26f3942ed7b3a711bdc4dd923bc (diff)
Merge branch 'master' into gpr_review
Diffstat (limited to 'src/core/ext/transport')
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.cc8
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc8
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.cc1
-rw-r--r--src/core/ext/transport/chttp2/transport/writing.cc1
4 files changed, 10 insertions, 8 deletions
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
index 6a1b70964d..ef1d3fb53b 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
@@ -52,13 +52,13 @@ static grpc_channel* client_channel_factory_create_channel(
return nullptr;
}
// Add channel arg containing the server URI.
- grpc_arg arg = grpc_channel_arg_string_create(
- (char*)GRPC_ARG_SERVER_URI,
- grpc_resolver_factory_add_default_prefix_if_needed(target));
+ grpc_core::UniquePtr<char> canonical_target =
+ grpc_core::ResolverRegistry::AddDefaultPrefixIfNeeded(target);
+ grpc_arg arg = grpc_channel_arg_string_create((char*)GRPC_ARG_SERVER_URI,
+ canonical_target.get());
const char* to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
- gpr_free(arg.value.string);
grpc_channel* channel =
grpc_channel_create(target, new_args, GRPC_CLIENT_CHANNEL, nullptr);
grpc_channel_args_destroy(new_args);
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index 27c5b96a4c..d39c362cd3 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -161,13 +161,13 @@ static grpc_channel* client_channel_factory_create_channel(
return nullptr;
}
// Add channel arg containing the server URI.
- grpc_arg arg = grpc_channel_arg_string_create(
- (char*)GRPC_ARG_SERVER_URI,
- grpc_resolver_factory_add_default_prefix_if_needed(target));
+ grpc_core::UniquePtr<char> canonical_target =
+ grpc_core::ResolverRegistry::AddDefaultPrefixIfNeeded(target);
+ grpc_arg arg = grpc_channel_arg_string_create((char*)GRPC_ARG_SERVER_URI,
+ canonical_target.get());
const char* to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
- gpr_free(arg.value.string);
grpc_channel* channel =
grpc_channel_create(target, new_args, GRPC_CLIENT_CHANNEL, nullptr);
grpc_channel_args_destroy(new_args);
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index bc1762daad..7c35fafe36 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -1667,6 +1667,7 @@ static void retry_initiate_ping_locked(void* tp, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING);
}
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked");
}
void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc
index 95358ab525..1d6c9b0582 100644
--- a/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/src/core/ext/transport/chttp2/transport/writing.cc
@@ -88,6 +88,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
}
if (!t->ping_state.is_delayed_ping_timer_set) {
t->ping_state.is_delayed_ping_timer_set = true;
+ GRPC_CHTTP2_REF_TRANSPORT(t, "retry_initiate_ping_locked");
grpc_timer_init(&t->ping_state.delayed_ping_timer, next_allowed_ping,
&t->retry_initiate_ping_locked);
}