Skip to content

Commit

Permalink
consume_local_frame -> update_local_window to consume and request…
Browse files Browse the repository at this point in the history
… window update.
  • Loading branch information
ioquatix committed Jul 1, 2019
1 parent 80abd36 commit 2840a53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/protocol/http2/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def receive_ping(frame)
end

def receive_data(frame)
consume_local_window(frame)
update_local_window(frame)

if stream = @streams[frame.stream_id]
stream.receive_data(frame)
Expand Down
1 change: 0 additions & 1 deletion lib/protocol/http2/flow_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def consume_remote_window(frame)

def update_local_window(frame)
consume_local_window(frame)

request_window_update
end

Expand Down
4 changes: 2 additions & 2 deletions lib/protocol/http2/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,15 @@ def ignore_data(frame)
# DATA frames are subject to flow control and can only be sent when a stream is in the "open" or "half-closed (remote)" state. The entire DATA frame payload is included in flow control, including the Pad Length and Padding fields if present. If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state, the recipient MUST respond with a stream error of type STREAM_CLOSED.
def receive_data(frame)
if @state == :open
consume_local_window(frame)
update_local_window(frame)

if frame.end_stream?
@state = :half_closed_remote
end

process_data(frame)
elsif @state == :half_closed_local
consume_local_window(frame)
update_local_window(frame)

process_data(frame)

Expand Down

0 comments on commit 2840a53

Please sign in to comment.