async-http 0.38.3 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b1760cfed4e9eb6e79b2fe7bf4ebb571e2a085557cefaa5b7b1a18ee7b3c2eb
4
- data.tar.gz: af402e9434a84120935f2da52eae5ab5911ae92b3bf69bbf475bfe141b83c222
3
+ metadata.gz: 9d2ae06b181bb3fc7bca37de3c13361d9cf06c033f5ca0a4221cd1afb32108f7
4
+ data.tar.gz: 2e91385f85f2a2710ea7fa4490b04f01272f7cf525b24581cfe774683eb625a5
5
5
  SHA512:
6
- metadata.gz: d5bca4bba8aa73d6ea2fe8f0b4af8eeab5345a2c6d713aa228f7ba2c4dda16dfa485de1d59244f46721afda15762b332f20bdca70334c8515329fb3099cd1c87
7
- data.tar.gz: 4487836d1943c6429df3fcc7b8158923eaf19f16520dfdcac7c122a792ad9ff45534b1796e31eef22c9056322b7af4dafb68d8f3db8402d39eda8d216656cb10
6
+ metadata.gz: 0ed6969ab041fd96096c6e445d1fba0774d7de57546c98d1b241a27f46328fae44eb331bff08febb0175457c62f46447070f9eb25afe4c1de84d9786bff99379
7
+ data.tar.gz: 80b2ad6e10754ed1eb99d244f838f45fa9f8478273ce740ea922ed1abd4a0180d324fe9c4a968f152bbded8ff6f8483ab0fe8e13d4ddeab5f961070a077f3217
@@ -14,7 +14,6 @@ addons:
14
14
 
15
15
  matrix:
16
16
  include:
17
- - rvm: 2.3
18
17
  - rvm: 2.4
19
18
  - rvm: 2.5
20
19
  - rvm: 2.6
@@ -19,7 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.add_dependency("async", "~> 1.14")
20
20
  spec.add_dependency("async-io", "~> 1.18")
21
21
 
22
- spec.add_dependency("http-protocol", "~> 0.17")
22
+ spec.add_dependency("protocol-http", "~> 0.1.0")
23
+ spec.add_dependency("protocol-http1", "~> 0.1.0")
24
+ spec.add_dependency("protocol-http2", "~> 0.1.0")
23
25
 
24
26
  # spec.add_dependency("openssl")
25
27
 
@@ -18,10 +18,10 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'http/protocol/headers'
21
+ require 'protocol/http/headers'
22
22
 
23
23
  module Async
24
24
  module HTTP
25
- Headers = ::HTTP::Protocol::Headers
25
+ Headers = ::Protocol::HTTP::Headers
26
26
  end
27
27
  end
@@ -18,7 +18,7 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'http/protocol/http1/connection'
21
+ require 'protocol/http1'
22
22
 
23
23
  require_relative 'request'
24
24
  require_relative 'response'
@@ -30,7 +30,7 @@ module Async
30
30
  module HTTP
31
31
  module Protocol
32
32
  module HTTP1
33
- class Connection < ::HTTP::Protocol::HTTP1::Connection
33
+ class Connection < ::Protocol::HTTP1::Connection
34
34
  def initialize(stream, version)
35
35
  super(stream)
36
36
 
@@ -26,18 +26,18 @@ module Async
26
26
  module Protocol
27
27
  module HTTP2
28
28
  CLIENT_SETTINGS = {
29
- ::HTTP::Protocol::HTTP2::Settings::ENABLE_PUSH => 0,
30
- ::HTTP::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 256,
31
- ::HTTP::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
32
- ::HTTP::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0x7FFFFFFF,
29
+ ::Protocol::HTTP2::Settings::ENABLE_PUSH => 0,
30
+ ::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 256,
31
+ ::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
32
+ ::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0x7FFFFFFF,
33
33
  }
34
34
 
35
35
  SERVER_SETTINGS = {
36
- ::HTTP::Protocol::HTTP2::Settings::ENABLE_PUSH => 1,
36
+ ::Protocol::HTTP2::Settings::ENABLE_PUSH => 1,
37
37
  # We choose a lower maximum concurrent streams to avoid overloading a single connection/thread.
38
- ::HTTP::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 32,
39
- ::HTTP::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
40
- ::HTTP::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0x7FFFFFFF,
38
+ ::Protocol::HTTP2::Settings::MAXIMUM_CONCURRENT_STREAMS => 32,
39
+ ::Protocol::HTTP2::Settings::MAXIMUM_FRAME_SIZE => 0x100000,
40
+ ::Protocol::HTTP2::Settings::INITIAL_WINDOW_SIZE => 0x7FFFFFFF,
41
41
  }
42
42
 
43
43
  def self.client(stream, settings = CLIENT_SETTINGS)
@@ -60,7 +60,7 @@ module Async
60
60
 
61
61
  module WithPush
62
62
  CLIENT_SETTINGS = HTTP2::CLIENT_SETTINGS.merge(
63
- ::HTTP::Protocol::HTTP2::Settings::ENABLE_PUSH => 1,
63
+ ::Protocol::HTTP2::Settings::ENABLE_PUSH => 1,
64
64
  )
65
65
 
66
66
  def self.client(stream, settings = CLIENT_SETTINGS)
@@ -21,19 +21,19 @@
21
21
  require_relative 'connection'
22
22
  require_relative 'response'
23
23
 
24
- require 'http/protocol/http2/client'
24
+ require 'protocol/http2/client'
25
25
 
26
26
  module Async
27
27
  module HTTP
28
28
  module Protocol
29
29
  module HTTP2
30
- class Client < ::HTTP::Protocol::HTTP2::Client
30
+ class Client < ::Protocol::HTTP2::Client
31
31
  include Connection
32
32
 
33
33
  def initialize(stream)
34
34
  @stream = stream
35
35
 
36
- framer = ::HTTP::Protocol::HTTP2::Framer.new(@stream)
36
+ framer = ::Protocol::HTTP2::Framer.new(@stream)
37
37
 
38
38
  super(framer)
39
39
  end
@@ -128,7 +128,7 @@ module Async
128
128
 
129
129
  def send_response(response)
130
130
  if response.nil?
131
- @stream.send_headers(nil, NO_RESPONSE, ::HTTP::Protocol::HTTP2::END_STREAM)
131
+ @stream.send_headers(nil, NO_RESPONSE, ::Protocol::HTTP2::END_STREAM)
132
132
  elsif response.body?
133
133
  pseudo_headers = [
134
134
  [STATUS, response.status],
@@ -150,7 +150,7 @@ module Async
150
150
  [STATUS, response.status],
151
151
  ], response.headers)
152
152
 
153
- @stream.send_headers(nil, headers, ::HTTP::Protocol::HTTP2::END_STREAM)
153
+ @stream.send_headers(nil, headers, ::Protocol::HTTP2::END_STREAM)
154
154
  end
155
155
  end
156
156
  end
@@ -148,7 +148,7 @@ module Async
148
148
  )
149
149
 
150
150
  if request.body.nil?
151
- @stream.send_headers(nil, headers, ::HTTP::Protocol::HTTP2::END_STREAM)
151
+ @stream.send_headers(nil, headers, ::Protocol::HTTP2::END_STREAM)
152
152
  else
153
153
  begin
154
154
  @stream.send_headers(nil, headers)
@@ -22,19 +22,19 @@ require_relative 'connection'
22
22
  require_relative 'request'
23
23
  require_relative 'promise'
24
24
 
25
- require 'http/protocol/http2/server'
25
+ require 'protocol/http2/server'
26
26
 
27
27
  module Async
28
28
  module HTTP
29
29
  module Protocol
30
30
  module HTTP2
31
- class Server < ::HTTP::Protocol::HTTP2::Server
31
+ class Server < ::Protocol::HTTP2::Server
32
32
  include Connection
33
33
 
34
34
  def initialize(stream)
35
35
  @stream = stream
36
36
 
37
- framer = ::HTTP::Protocol::HTTP2::Framer.new(stream)
37
+ framer = ::Protocol::HTTP2::Framer.new(stream)
38
38
 
39
39
  super(framer)
40
40
 
@@ -63,7 +63,7 @@ module Async
63
63
  response = begin
64
64
  response = yield(request)
65
65
  rescue
66
- request.stream.send_reset_stream(::HTTP::Protocol::HTTP2::INTERNAL_ERROR)
66
+ request.stream.send_reset_stream(::Protocol::HTTP2::INTERNAL_ERROR)
67
67
 
68
68
  Async.logger.error(request) {$!}
69
69
  else
@@ -18,13 +18,13 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'http/protocol/http2/stream'
21
+ require 'protocol/http2/stream'
22
22
 
23
23
  module Async
24
24
  module HTTP
25
25
  module Protocol
26
26
  module HTTP2
27
- class Stream < ::HTTP::Protocol::HTTP2::Stream
27
+ class Stream < ::Protocol::HTTP2::Stream
28
28
  def initialize(delegate, *args)
29
29
  super(*args)
30
30
 
@@ -80,7 +80,7 @@ module Async
80
80
 
81
81
  # @body.read above might take a while and a stream reset might be received in the mean time.
82
82
  unless closed?
83
- send_data(nil, ::HTTP::Protocol::HTTP2::END_STREAM)
83
+ send_data(nil, ::Protocol::HTTP2::END_STREAM)
84
84
  end
85
85
 
86
86
  return false
@@ -18,10 +18,10 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'http/protocol/reference'
21
+ require 'protocol/http/reference'
22
22
 
23
23
  module Async
24
24
  module HTTP
25
- Reference = ::HTTP::Protocol::Reference
25
+ Reference = ::Protocol::HTTP::Reference
26
26
  end
27
27
  end
@@ -87,7 +87,7 @@ module Async
87
87
  @first_chunk_time ||= Clock.now
88
88
 
89
89
  if chunk
90
- @sent += chunk.length
90
+ @sent += chunk.bytesize
91
91
  end
92
92
 
93
93
  return chunk
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.38.3"
23
+ VERSION = "0.39.0"
24
24
  end
25
25
  end
@@ -22,17 +22,17 @@ task :google do
22
22
  peer = endpoint.connect
23
23
  stream = Async::IO::Stream.new(peer)
24
24
 
25
- framer = ::HTTP::Protocol::HTTP2::Framer.new(stream)
26
- client = ::HTTP::Protocol::HTTP2::Client.new(framer)
25
+ framer = ::Protocol::HTTP2::Framer.new(stream)
26
+ client = ::Protocol::HTTP2::Client.new(framer)
27
27
 
28
28
  client.send_connection_preface
29
29
 
30
- stream = ::HTTP::Protocol::HTTP2::Stream.new(client)
30
+ stream = ::Protocol::HTTP2::Stream.new(client)
31
31
 
32
32
  client.read_frame
33
33
  client.read_frame
34
34
 
35
- stream.send_headers(nil, [[':method', 'GET'], [':authority', 'www.google.com'], [':path', '/']], ::HTTP::Protocol::HTTP2::END_STREAM)
35
+ stream.send_headers(nil, [[':method', 'GET'], [':authority', 'www.google.com'], [':path', '/']], ::Protocol::HTTP2::END_STREAM)
36
36
 
37
37
  binding.pry
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.3
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-05 00:00:00.000000000 Z
11
+ date: 2019-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -39,19 +39,47 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.18'
41
41
  - !ruby/object:Gem::Dependency
42
- name: http-protocol
42
+ name: protocol-http
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.17'
47
+ version: 0.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.17'
54
+ version: 0.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: protocol-http1
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: protocol-http2
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.1.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.1.0
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: async-rspec
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -221,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
249
  - !ruby/object:Gem::Version
222
250
  version: '0'
223
251
  requirements: []
224
- rubygems_version: 3.0.2
252
+ rubygems_version: 3.0.3
225
253
  signing_key:
226
254
  specification_version: 4
227
255
  summary: A HTTP client and server library.