aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/transport/chttp2
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-16 14:28:22 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-16 14:28:22 -0700
commitcf1e319627dc4463629b14fbf8c40ba63e5c90db (patch)
treebcbb3d63b200a7f34619d684d41f9c76e98f4ad9 /src/core/transport/chttp2
parentcdf52bc17296335ad5024f258337576aeb856afc (diff)
Fixing stuff
Diffstat (limited to 'src/core/transport/chttp2')
-rw-r--r--src/core/transport/chttp2/internal.h10
-rw-r--r--src/core/transport/chttp2/parsing.c14
-rw-r--r--src/core/transport/chttp2/stream_lists.c21
-rw-r--r--src/core/transport/chttp2/writing.c1
4 files changed, 44 insertions, 2 deletions
diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h
index 06f114c2fb..74385e8ad9 100644
--- a/src/core/transport/chttp2/internal.h
+++ b/src/core/transport/chttp2/internal.h
@@ -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);
diff --git a/src/core/transport/chttp2/parsing.c b/src/core/transport/chttp2/parsing.c
index e45ebb7176..4c681ec9d3 100644
--- a/src/core/transport/chttp2/parsing.c
+++ b/src/core/transport/chttp2/parsing.c
@@ -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,
diff --git a/src/core/transport/chttp2/stream_lists.c b/src/core/transport/chttp2/stream_lists.c
index 987dc1c11e..dfead28e76 100644
--- a/src/core/transport/chttp2/stream_lists.c
+++ b/src/core/transport/chttp2/stream_lists.c
@@ -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) {
diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c
index 4b2ee948c7..291c088d75 100644
--- a/src/core/transport/chttp2/writing.c
+++ b/src/core/transport/chttp2/writing.c
@@ -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);
}
}