async-http 0.40.2 → 0.40.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d52ccd5014c47f8a71d2bc51494661234d5a51c6e48129dc30fcb00bed20fbfb
4
- data.tar.gz: 7c25b371c99a7a02b5481c0552aa392e4218de84cfa6911fab4d0afb9f7e008a
3
+ metadata.gz: 9467ea667ebfd156ef91b71cfa8da9598d73839cc378545672aa4db3338f80f9
4
+ data.tar.gz: 03e93ca6e98b1e22f58cde6542e44eba52f6193d779492dfba1be835c2f31d02
5
5
  SHA512:
6
- metadata.gz: 4d36812a4ee226de8d41c91b65a61faafbe174a121b6bc5b3524196844c8f360e3b880d7e802be8c54388346e069f69b035b109495f9820126a2d1d1136c28a3
7
- data.tar.gz: 3c2993a11b3dc7bf01c2daf9f9810afe0698808e62044600af451c531281bb885d6c8e60c758334a1a2cd36481a2cacb2fa8ccac0305dc8d3abb96f593741cb7
6
+ metadata.gz: 9890cd89c5e1148863714c1f517f3ad7edd62cefb6a7f513580a32649a055b67929b7e7c26b8440b00667b42854a9ccb4e8275df17bacbed6b9e73721e2f61e7
7
+ data.tar.gz: 7cc0038e3cd139cda370e485d29719b611224a156928de22de597293108b399057809b43c813d7b171cadc2ea926cb0e0760d6cd267bcf67d1bc5e9ac1290060
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.add_dependency("async-io", "~> 1.18")
21
21
 
22
22
  spec.add_dependency("protocol-http", "~> 0.3.0")
23
- spec.add_dependency("protocol-http1", "~> 0.4.0")
23
+ spec.add_dependency("protocol-http1", "~> 0.5.0")
24
24
  spec.add_dependency("protocol-http2", "~> 0.2.0")
25
25
 
26
26
  # spec.add_dependency("openssl")
@@ -40,8 +40,8 @@ module Async
40
40
 
41
41
  attr :version
42
42
 
43
- def read_line
44
- @stream.read_until(CRLF) or raise EOFError, "Could not read line"
43
+ def read_line?
44
+ @stream.read_until(CRLF)
45
45
  end
46
46
 
47
47
  # @return [Async::Wrapper] the underlying non-blocking IO.
@@ -25,9 +25,14 @@ module Async
25
25
  module Protocol
26
26
  module HTTP1
27
27
  class Request < Protocol::Request
28
- def initialize(protocol)
29
- super(nil, *protocol.read_request)
30
-
28
+ def self.read(protocol)
29
+ if parts = protocol.read_request
30
+ self.new(protocol, *parts)
31
+ end
32
+ end
33
+
34
+ def initialize(protocol, *parts)
35
+ super(nil, *parts)
31
36
  @protocol = protocol
32
37
  end
33
38
 
@@ -32,9 +32,10 @@ module Async
32
32
 
33
33
  def next_request
34
34
  # The default is true.
35
- return nil unless @persistent
35
+ return unless @persistent
36
36
 
37
- request = Request.new(self)
37
+ # Read an incoming request:
38
+ return unless request = Request.read(self)
38
39
 
39
40
  unless persistent?(request.version, request.headers)
40
41
  @persistent = false
@@ -60,9 +60,6 @@ module Async
60
60
  # If this returns nil, we assume that the connection has been hijacked.
61
61
  self.call(request)
62
62
  end
63
- rescue EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::EPROTOTYPE
64
- # Sometimes client will disconnect without completing a result or reading the entire buffer. That means we are done.
65
- # Errno::EPROTOTYPE is a bug with Darwin. It happens because the socket is lazily created (in Darwin).
66
63
  end
67
64
 
68
65
  def run
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.40.2"
23
+ VERSION = "0.40.3"
24
24
  end
25
25
  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.40.2
4
+ version: 0.40.3
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-12 00:00:00.000000000 Z
11
+ date: 2019-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.4.0
61
+ version: 0.5.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.4.0
68
+ version: 0.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: protocol-http2
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
252
  - !ruby/object:Gem::Version
253
253
  version: '0'
254
254
  requirements: []
255
- rubygems_version: 3.0.2
255
+ rubygems_version: 3.0.3
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: A HTTP client and server library.