http-2 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/http/2/buffer.rb +6 -4
- data/lib/http/2/client.rb +5 -1
- data/lib/http/2/compressor.rb +42 -34
- data/lib/http/2/connection.rb +72 -86
- data/lib/http/2/emitter.rb +4 -1
- data/lib/http/2/error.rb +2 -0
- data/lib/http/2/flow_buffer.rb +8 -3
- data/lib/http/2/framer.rb +83 -94
- data/lib/http/2/huffman.rb +19 -17
- data/lib/http/2/server.rb +9 -7
- data/lib/http/2/stream.rb +48 -48
- data/lib/http/2/version.rb +3 -1
- data/lib/http/2.rb +2 -0
- metadata +7 -60
- data/.autotest +0 -20
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -20
- data/.gitmodules +0 -3
- data/.rspec +0 -5
- data/.rubocop.yml +0 -93
- data/.rubocop_todo.yml +0 -131
- data/.travis.yml +0 -17
- data/Gemfile +0 -16
- data/Guardfile +0 -18
- data/Guardfile.h2spec +0 -12
- data/Rakefile +0 -49
- data/example/Gemfile +0 -3
- data/example/README.md +0 -44
- data/example/client.rb +0 -122
- data/example/helper.rb +0 -19
- data/example/keys/server.crt +0 -20
- data/example/keys/server.key +0 -27
- data/example/server.rb +0 -139
- data/example/upgrade_client.rb +0 -153
- data/example/upgrade_server.rb +0 -203
- data/http-2.gemspec +0 -22
- data/lib/tasks/generate_huffman_table.rb +0 -166
- data/spec/buffer_spec.rb +0 -28
- data/spec/client_spec.rb +0 -188
- data/spec/compressor_spec.rb +0 -666
- data/spec/connection_spec.rb +0 -681
- data/spec/emitter_spec.rb +0 -54
- data/spec/framer_spec.rb +0 -487
- data/spec/h2spec/h2spec.darwin +0 -0
- data/spec/h2spec/output/non_secure.txt +0 -317
- data/spec/helper.rb +0 -147
- data/spec/hpack_test_spec.rb +0 -84
- data/spec/huffman_spec.rb +0 -68
- data/spec/server_spec.rb +0 -52
- data/spec/stream_spec.rb +0 -878
- data/spec/support/deep_dup.rb +0 -55
- data/spec/support/duplicable.rb +0 -98
data/spec/server_spec.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
RSpec.describe HTTP2::Server do
|
4
|
-
include FrameHelpers
|
5
|
-
before(:each) do
|
6
|
-
@srv = Server.new
|
7
|
-
end
|
8
|
-
|
9
|
-
let(:f) { Framer.new }
|
10
|
-
|
11
|
-
context 'initialization and settings' do
|
12
|
-
it 'should return even stream IDs' do
|
13
|
-
expect(@srv.new_stream.id).to be_even
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should emit SETTINGS on new connection' do
|
17
|
-
frames = []
|
18
|
-
@srv.on(:frame) { |recv| frames << recv }
|
19
|
-
@srv << CONNECTION_PREFACE_MAGIC
|
20
|
-
|
21
|
-
expect(f.parse(frames[0])[:type]).to eq :settings
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should initialize client with custom connection settings' do
|
25
|
-
frames = []
|
26
|
-
|
27
|
-
@srv = Server.new(settings_max_concurrent_streams: 200,
|
28
|
-
settings_initial_window_size: 2**10)
|
29
|
-
@srv.on(:frame) { |recv| frames << recv }
|
30
|
-
@srv << CONNECTION_PREFACE_MAGIC
|
31
|
-
|
32
|
-
frame = f.parse(frames[0])
|
33
|
-
expect(frame[:type]).to eq :settings
|
34
|
-
expect(frame[:payload]).to include([:settings_max_concurrent_streams, 200])
|
35
|
-
expect(frame[:payload]).to include([:settings_initial_window_size, 2**10])
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should allow server push' do
|
40
|
-
client = Client.new
|
41
|
-
client.on(:frame) { |bytes| @srv << bytes }
|
42
|
-
|
43
|
-
@srv.on(:stream) do |stream|
|
44
|
-
expect do
|
45
|
-
stream.promise({ ':method' => 'GET' }) {}
|
46
|
-
end.to_not raise_error
|
47
|
-
end
|
48
|
-
|
49
|
-
client.new_stream
|
50
|
-
client.send headers_frame
|
51
|
-
end
|
52
|
-
end
|