diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-11 20:05:33 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-11 20:05:33 +0900 |
commit | 02ea3e09a4318a60c61213122d0bf3e8e9547174 (patch) | |
tree | fe98f4cf19197f3c8f82a5d16361906351b2a000 | |
parent | dc0e97de3cda4e104e48ecaaba9181b7d4906d9d (diff) | |
download | plum-02ea3e09a4318a60c61213122d0bf3e8e9547174.tar.gz |
rack/session: send WINDOW_UPDATE when receive window became too small
-rw-r--r-- | lib/plum/rack/session.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/plum/rack/session.rb b/lib/plum/rack/session.rb index d9efb9d..873378e 100644 --- a/lib/plum/rack/session.rb +++ b/lib/plum/rack/session.rb @@ -48,6 +48,7 @@ module Plum @plum.on(:data) { |stream, d| reqs[stream][:data] << d # TODO: store to file? + check_window(stream) } @plum.on(:end_stream) { |stream| @@ -55,6 +56,12 @@ module Plum } end + def check_window(stream) + ws = @plum.local_settings[:initial_window_size] + stream.window_update(ws) if stream.recv_remaining_window < (ws / 2) + @plum.window_update(ws) if @plum.recv_remaining_window < (ws / 2) + end + def send_body(stream, body) begin if body.is_a?(IO) |