Fixing stuff

pull/2149/head
Craig Tiller 10 years ago
parent cdf52bc172
commit cf1e319627
  1. 10
      src/core/transport/chttp2/internal.h
  2. 14
      src/core/transport/chttp2/parsing.c
  3. 21
      src/core/transport/chttp2/stream_lists.c
  4. 1
      src/core/transport/chttp2/writing.c
  5. 4
      src/core/transport/chttp2_transport.c

@ -63,6 +63,7 @@ typedef enum {
GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE,
GRPC_CHTTP2_LIST_PARSING_SEEN,
GRPC_CHTTP2_LIST_CANCELLED_WAITING_FOR_PARSING,
GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED,
/** streams that are waiting to start because there are too many concurrent
streams on the connection */
GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY,
@ -533,6 +534,15 @@ int grpc_chttp2_list_pop_writable_stream(
grpc_chttp2_stream_global **stream_global,
grpc_chttp2_stream_writing **stream_writing);
void grpc_chttp2_list_add_incoming_window_updated(
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_stream_global *stream_global);
int grpc_chttp2_list_pop_incoming_window_updated(
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_transport_parsing *transport_parsing,
grpc_chttp2_stream_global **stream_global,
grpc_chttp2_stream_parsing **stream_parsing);
void grpc_chttp2_list_add_writing_stream(
grpc_chttp2_transport_writing *transport_writing,
grpc_chttp2_stream_writing *stream_writing);

@ -60,8 +60,18 @@ static int init_skip_frame_parser(
static int parse_frame_slice(grpc_chttp2_transport_parsing *transport_parsing,
gpr_slice slice, int is_last);
void grpc_chttp2_prepare_to_read(grpc_chttp2_transport_global *global,
grpc_chttp2_transport_parsing *parsing) {}
void grpc_chttp2_prepare_to_read(grpc_chttp2_transport_global *transport_global,
grpc_chttp2_transport_parsing *transport_parsing) {
grpc_chttp2_stream_global *stream_global;
grpc_chttp2_stream_parsing *stream_parsing;
/* update the parsing view of incoming window */
transport_parsing->incoming_window = transport_global->incoming_window;
while (grpc_chttp2_list_pop_incoming_window_updated(
transport_global, transport_parsing, &stream_global, &stream_parsing)) {
stream_parsing->incoming_window = transport_parsing->incoming_window;
}
}
void grpc_chttp2_publish_reads(
grpc_chttp2_transport_global *transport_global,

@ -267,6 +267,27 @@ int grpc_chttp2_list_pop_cancelled_waiting_for_parsing(
return r;
}
void grpc_chttp2_list_add_incoming_window_updated(
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_stream_global *stream_global) {
stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
STREAM_FROM_GLOBAL(stream_global),
GRPC_CHTTP2_LIST_INCOMING_WINDOW_STATE_CHANGED);
}
int grpc_chttp2_list_pop_incoming_window_updated(
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_transport_parsing *transport_parsing,
grpc_chttp2_stream_global **stream_global,
grpc_chttp2_stream_parsing **stream_parsing) {
grpc_chttp2_stream *stream;
int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
GRPC_CHTTP2_LIST_INCOMING_WINDOW_STATE_CHANGED);
*stream_global = &stream->global;
*stream_parsing = &stream->parsing;
return r;
}
void grpc_chttp2_list_add_read_write_state_changed(
grpc_chttp2_transport_global *transport_global,
grpc_chttp2_stream_global *stream_global) {

@ -116,6 +116,7 @@ int grpc_chttp2_unlocking_check_writes(
&transport_writing->outbuf,
grpc_chttp2_window_update_create(stream_global->id, window_delta));
stream_global->incoming_window += window_delta;
grpc_chttp2_list_add_incoming_window_updated(transport_global, stream_global);
}
}

@ -361,6 +361,7 @@ static int init_stream(grpc_transport *gt, grpc_stream *gs,
t->global
.settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
*t->accepting_stream = s;
grpc_chttp2_list_add_incoming_window_updated(&t->global, &s->global);
grpc_chttp2_stream_map_add(&t->new_stream_map, s->global.id, s);
}
@ -397,7 +398,7 @@ grpc_chttp2_stream_parsing *grpc_chttp2_parsing_lookup_stream(
grpc_chttp2_transport *t = TRANSPORT_FROM_PARSING(transport_parsing);
grpc_chttp2_stream *s =
grpc_chttp2_stream_map_find(&t->parsing_stream_map, id);
return &s->parsing;
return s ? &s->parsing : NULL;
}
grpc_chttp2_stream_parsing *grpc_chttp2_parsing_accept_stream(
@ -558,6 +559,7 @@ static void maybe_start_some_streams(
&TRANSPORT_FROM_GLOBAL(transport_global)->new_stream_map,
stream_global->id, STREAM_FROM_GLOBAL(stream_global));
transport_global->concurrent_stream_count++;
grpc_chttp2_list_add_incoming_window_updated(transport_global, stream_global);
grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
}
/* cancel out streams that will never be started */

Loading…
Cancel
Save