aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-02-27 11:03:07 -0800
committerGravatar Yuchen Zeng <zyc@google.com>2017-02-27 11:03:07 -0800
commite0b1e46f0dbd73d56c82dd3fc3066bb182027402 (patch)
tree4a09dc0f48228387187ee24f19e9c7e6ea8ad019 /src/core/ext/transport
parent380a3be6ee11a3795bfbf695b055af033b1f6244 (diff)
Address review comments
Diffstat (limited to 'src/core/ext/transport')
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.c9
-rw-r--r--src/core/ext/transport/chttp2/transport/internal.h6
2 files changed, 8 insertions, 7 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index 1cb4e8d804..b6b12adedc 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -424,8 +424,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
GRPC_ARG_HTTP2_KEEPALIVE_PERMIT_WITHOUT_CALLS)) {
t->keepalive_permit_without_calls =
(uint32_t)grpc_channel_arg_get_integer(
- &channel_args->args[i],
- (grpc_integer_options){0, 0, MAX_WRITE_BUFFER_SIZE});
+ &channel_args->args[i], (grpc_integer_options){0, 0, 1});
} else {
static const struct {
const char *channel_arg_name;
@@ -477,7 +476,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
t->ping_state.pings_before_data_required =
t->ping_policy.max_pings_without_data;
- // Start client-side keepalive pings
+ /** Start client-side keepalive pings */
if (t->is_client) {
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING;
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
@@ -2137,8 +2136,8 @@ static void keepalive_watchdog_fired_locked(grpc_exec_ctx *exec_ctx, void *arg,
GRPC_ERROR_CREATE("keepalive watchdog timeout"));
}
} else {
- // The watchdog timer should have been cancelled by
- // finish_keepalive_ping_locked.
+ /** The watchdog timer should have been cancelled by
+ finish_keepalive_ping_locked. */
if (error != GRPC_ERROR_CANCELLED) {
gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)",
t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING);
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index 4a0cfd5a59..d26812ad6b 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -391,9 +391,13 @@ struct grpc_chttp2_transport {
grpc_closure destructive_reclaimer_locked;
/* keep-alive ping support */
+ /** Closure to initialize a keepalive ping */
grpc_closure init_keepalive_ping_locked;
+ /** Closure to run when the keepalive ping is sent */
grpc_closure start_keepalive_ping_locked;
+ /** Cousure to run when the keepalive ping ack is received */
grpc_closure finish_keepalive_ping_locked;
+ /** Closrue to run when the keepalive ping timeouts */
grpc_closure keepalive_watchdog_fired_locked;
/** timer to initiate ping events */
grpc_timer keepalive_ping_timer;
@@ -407,8 +411,6 @@ struct grpc_chttp2_transport {
bool keepalive_permit_without_calls;
/** keep-alive state machine state */
grpc_chttp2_keepalive_state keepalive_state;
-
- uint8_t *keepalive_ping_id;
};
typedef enum {