diff options
author | 2015-06-18 13:38:38 -0700 | |
---|---|---|
committer | 2015-06-18 13:38:38 -0700 | |
commit | 8b2f1d7a21d8feef9f16e40eca72dbba881617fd (patch) | |
tree | 0e1511fd8fe7080d886f7ca11b3399d5cf03cd8f /src | |
parent | 3255b3caf73e94a0b7c77ea7e8f143a0144e4037 (diff) |
Bug fixes, spam cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/core/transport/chttp2/frame_settings.c | 4 | ||||
-rw-r--r-- | src/core/transport/chttp2/internal.h | 2 | ||||
-rw-r--r-- | src/core/transport/chttp2/parsing.c | 3 | ||||
-rw-r--r-- | src/core/transport/chttp2/stream_map.c | 2 | ||||
-rw-r--r-- | src/core/transport/chttp2/writing.c | 8 | ||||
-rw-r--r-- | src/core/transport/chttp2_transport.c | 23 |
6 files changed, 15 insertions, 27 deletions
diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c index 119c25b12c..d42bc000ae 100644 --- a/src/core/transport/chttp2/frame_settings.c +++ b/src/core/transport/chttp2/frame_settings.c @@ -154,6 +154,7 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( if (cur == end) { parser->state = GRPC_CHTTP2_SPS_ID0; if (is_last) { + transport_parsing->settings_updated = 1; memcpy(parser->target_settings, parser->incoming_settings, GRPC_CHTTP2_NUM_SETTINGS * sizeof(gpr_uint32)); gpr_slice_buffer_add(&transport_parsing->qbuf, @@ -231,7 +232,8 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( } parser->incoming_settings[parser->id] = parser->value; if (grpc_http_trace) { - gpr_log(GPR_DEBUG, "CHTTP2: got setting %d = %d", parser->id, + gpr_log(GPR_DEBUG, "CHTTP2:%s: got setting %d = %d", + transport_parsing->is_client ? "CLI" : "SVR", parser->id, parser->value); } } else { diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h index 2b4dc5e6b8..7f50e711d6 100644 --- a/src/core/transport/chttp2/internal.h +++ b/src/core/transport/chttp2/internal.h @@ -334,6 +334,8 @@ struct grpc_chttp2_transport { /** closure to execute writing */ grpc_iomgr_closure writing_action; + /** closure to start reading from the endpoint */ + grpc_iomgr_closure reading_action; /** address to place a newly accepted stream - set and unset by grpc_chttp2_parsing_accept_stream; used by init_stream to diff --git a/src/core/transport/chttp2/parsing.c b/src/core/transport/chttp2/parsing.c index 7276f8cafa..f675c038d0 100644 --- a/src/core/transport/chttp2/parsing.c +++ b/src/core/transport/chttp2/parsing.c @@ -194,7 +194,6 @@ void grpc_chttp2_publish_reads( stream_global->outgoing_window += stream_parsing->outgoing_window_update; stream_parsing->outgoing_window_update = 0; is_zero = stream_global->outgoing_window <= 0; - gpr_log(GPR_DEBUG, "was=%d is=%d", was_zero, is_zero); if (was_zero && !is_zero) { grpc_chttp2_list_add_writable_stream(transport_global, stream_global); } @@ -765,8 +764,6 @@ static int init_settings_frame_parser( } if (transport_parsing->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) { transport_parsing->settings_ack_received = 1; - } else { - transport_parsing->settings_updated = 1; } transport_parsing->parser = grpc_chttp2_settings_parser_parse; transport_parsing->parser_data = &transport_parsing->simple.settings; diff --git a/src/core/transport/chttp2/stream_map.c b/src/core/transport/chttp2/stream_map.c index baec29e18d..e137d6d6b8 100644 --- a/src/core/transport/chttp2/stream_map.c +++ b/src/core/transport/chttp2/stream_map.c @@ -111,7 +111,7 @@ void grpc_chttp2_stream_map_move_into(grpc_chttp2_stream_map *src, if (dst->count + src->count > dst->capacity) { dst->capacity = GPR_MAX(dst->capacity * 3 / 2, dst->count + src->count); dst->keys = gpr_realloc(dst->keys, dst->capacity * sizeof(gpr_uint32)); - dst->values = gpr_realloc(dst->values, dst->capacity * sizeof(gpr_uint32)); + dst->values = gpr_realloc(dst->values, dst->capacity * sizeof(void *)); } /* the first element of src must be greater than the last of dst */ GPR_ASSERT(src->keys[0] > dst->keys[dst->count - 1]); diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index 5fbec8fdad..a8e87c3fe3 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -84,11 +84,6 @@ int grpc_chttp2_unlocking_check_writes( transport_global->outgoing_window -= window_delta; stream_global->outgoing_window -= window_delta; - gpr_log(GPR_DEBUG, "%s ws:%d nops:%d rc:%d", - transport_global->is_client ? "CLI" : "SVR", - stream_global->write_state, stream_global->outgoing_sopb->nops, - stream_global->read_closed); - if (stream_global->write_state == WRITE_STATE_QUEUED_CLOSE && stream_global->outgoing_sopb->nops == 0) { if (!transport_global->is_client && !stream_global->read_closed) { @@ -178,9 +173,6 @@ static void finalize_outbuf(grpc_chttp2_transport_writing *transport_writing) { while ( grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) { - gpr_log(GPR_DEBUG, "%s write %d: sc=%d", - transport_writing->is_client ? "CLI" : "SVR", stream_writing->id, - stream_writing->send_closed); grpc_chttp2_encode(stream_writing->sopb.ops, stream_writing->sopb.nops, stream_writing->send_closed != DONT_SEND_CLOSED, stream_writing->id, &transport_writing->hpack_compressor, diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 2d3d720f2a..47cb8f6cec 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -86,6 +86,7 @@ static void unlock_check_read_write_state(grpc_chttp2_transport *t); /* forward declarations of various callbacks that we'll build closures around */ static void writing_action(void *t, int iomgr_success_ignored); +static void reading_action(void *t, int iomgr_success_ignored); static void notify_closed(void *t, int iomgr_success_ignored); /** Set a transport level setting, and push it to our peer */ @@ -237,6 +238,7 @@ static void init_transport(grpc_chttp2_transport *t, gpr_slice_buffer_init(&t->writing.outbuf); grpc_chttp2_hpack_compressor_init(&t->writing.hpack_compressor, mdctx); grpc_iomgr_closure_init(&t->writing_action, writing_action, t); + grpc_iomgr_closure_init(&t->reading_action, reading_action, t); gpr_slice_buffer_init(&t->parsing.qbuf); grpc_chttp2_goaway_parser_init(&t->parsing.goaway_parser); @@ -560,7 +562,6 @@ void grpc_chttp2_add_incoming_goaway( grpc_chttp2_transport_global *transport_global, gpr_uint32 goaway_error, gpr_slice goaway_text) { char *msg = gpr_hexdump((char*)GPR_SLICE_START_PTR(goaway_text), GPR_SLICE_LENGTH(goaway_text), GPR_HEXDUMP_PLAINTEXT); - gpr_log(GPR_DEBUG, "add goaway: st=%d err=%d text=%s", transport_global->goaway_state, goaway_error, msg); gpr_free(msg); if (transport_global->goaway_state == GRPC_CHTTP2_ERROR_STATE_NONE) { transport_global->goaway_state = GRPC_CHTTP2_ERROR_STATE_SEEN; @@ -574,7 +575,6 @@ void grpc_chttp2_add_incoming_goaway( static void maybe_start_some_streams( grpc_chttp2_transport_global *transport_global) { grpc_chttp2_stream_global *stream_global; - gpr_log(GPR_DEBUG, "nextid=%d count=%d", transport_global->next_stream_id, transport_global->concurrent_stream_count); /* start streams where we have free grpc_chttp2_stream ids and free * concurrency */ while (transport_global->next_stream_id <= MAX_CLIENT_STREAM_ID && @@ -784,28 +784,18 @@ static void unlock_check_read_write_state(grpc_chttp2_transport *t) { if (stream_global->write_state == WRITE_STATE_SENT_CLOSE && stream_global->read_closed && stream_global->in_stream_map) { if (t->parsing_active) { - gpr_log(GPR_DEBUG, "%s %d: queue wait for close", - transport_global->is_client ? "CLI" : "SVR", stream_global->id); grpc_chttp2_list_add_closed_waiting_for_parsing(transport_global, stream_global); } else { - gpr_log(GPR_DEBUG, "%s %d: late removal from map", - transport_global->is_client ? "CLI" : "SVR", stream_global->id); remove_stream(t, stream_global->id); } } if (!stream_global->publish_sopb) { - gpr_log(GPR_DEBUG, "%s %d: skip rw update: no publish target", - transport_global->is_client ? "CLI" : "SVR", stream_global->id); continue; } state = compute_state( stream_global->write_state == WRITE_STATE_SENT_CLOSE, stream_global->read_closed && !stream_global->in_stream_map); - gpr_log(GPR_DEBUG, "%s %d: state=%d->%d; nops=%d", - transport_global->is_client ? "CLI" : "SVR", stream_global->id, - stream_global->published_state, state, - stream_global->incoming_sopb.nops); if (stream_global->incoming_sopb.nops == 0 && state == stream_global->published_state) { continue; @@ -1021,7 +1011,7 @@ static void recv_data(void *tp, gpr_slice *slices, size_t nslices, t->parsing_active = 0; } if (i == nslices) { - grpc_endpoint_notify_on_read(t->ep, recv_data, t); + grpc_chttp2_schedule_closure(&t->global, &t->reading_action, 1); } unlock(t); for (; i < nslices; i++) gpr_slice_unref(slices[i]); @@ -1029,6 +1019,11 @@ static void recv_data(void *tp, gpr_slice *slices, size_t nslices, } } +static void reading_action(void *pt, int iomgr_success_ignored) { + grpc_chttp2_transport *t = pt; + grpc_endpoint_notify_on_read(t->ep, recv_data, t); +} + /* * CALLBACK LOOP */ @@ -1144,7 +1139,7 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *reason, } else { identifier = gpr_strdup(context_scope); } - gpr_log(GPR_DEBUG, + gpr_log(GPR_INFO, "FLOWCTL: %s %-10s %8s %-23s %8lld %c %8lld = %8lld %-10s [%s:%d]", is_client ? "client" : "server", identifier, context_thread, var, current_value, delta < 0 ? '-' : '+', delta < 0 ? -delta : delta, |