Skip to content

Commit

Permalink
Merge 0b8985a into a9cde3c
Browse files Browse the repository at this point in the history
  • Loading branch information
sankarcheppali committed Nov 11, 2020
2 parents a9cde3c + 0b8985a commit 9145c3f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/http/2/connection.rb
Expand Up @@ -539,7 +539,7 @@ def connection_settings(frame)
# Process pending settings we have sent.
[@pending_settings.shift, :local]
else
connection_error(check) if validate_settings(@remote_role, frame[:payload])
connection_error if validate_settings(@remote_role, frame[:payload])
[frame[:payload], :remote]
end

Expand Down Expand Up @@ -593,7 +593,8 @@ def connection_settings(frame)
# nothing to do

when :settings_max_frame_size
# nothing to do
# update framer max_frame_size
@framer.max_frame_size = v

# else # ignore unknown settings
end
Expand Down
16 changes: 16 additions & 0 deletions spec/connection_spec.rb
Expand Up @@ -49,6 +49,22 @@

expect(@conn.remote_settings[:settings_header_table_size]).to eq 256
end

it 'should reflect settings_max_frame_size recevied from peer' do
settings = settings_frame
settings[:payload] = [[:settings_max_frame_size, 16_385]]

@conn << f.generate(settings)

frame = {
length: 16_385,
type: :data,
flags: [:end_stream],
stream: 1,
payload: 'a' * 16_385,
}
expect { @conn.send(frame) }.not_to raise_error(CompressionError)
end

it 'should send SETTINGS ACK when SETTINGS is received' do
settings = settings_frame
Expand Down

0 comments on commit 9145c3f

Please sign in to comment.