async-http 0.56.2 → 0.56.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: 550188f639092d3fc62fe8bc1e2120d01a6b316897ea9f43f9a2a4983735969a
4
- data.tar.gz: e31110770c986aa3eb756332998b446c1a4d18faeac9cf86886f3c40841f4e24
3
+ metadata.gz: efbee0417c7ab944ad2ec6b6bd2c29735924d821b2396b02e78a6826874aa644
4
+ data.tar.gz: '08abaadc604cba6bb2ade84fd1387f962bab03c915f613c69cd5a1588666b431'
5
5
  SHA512:
6
- metadata.gz: c944bbbe72788fb06cb49bd68aaf3e17be61df0ad90d330d32e7ac2e3cf6967e190a9923ab3ceb03313fbfea661e5ae963c6ce58f2f02b24b660bc8d6ffd1213
7
- data.tar.gz: c71a81cf8c1011a0bb988bf3a809efb354741fb372db561b2331bc973eb4a6e80608d6b689e0d288147a03d965accc2e36aba63edac121cec746149d6acdccbd
6
+ metadata.gz: 60cf32dd530b64e7919047f662ba3a94a81a05328a404c5e51e9d45f0f8a379f59462b7d04e52aa2a8e83d42df44605866aec128b87a8528d233ec1ecc8d44fc
7
+ data.tar.gz: 3c62522dbe7bb6915cf2d6613d356515911ebb63e5036c643073632b0571f62be2d254177fbf6565eb0044c31d3c21b5195cc98d6a43b5cf687851cdd531eebd
@@ -29,6 +29,9 @@ module Async
29
29
  class Client < Connection
30
30
  # Used by the client to send requests to the remote server.
31
31
  def call(request, task: Task.current)
32
+ # We need to keep track of connections which are not in the initial "ready" state.
33
+ @ready = false
34
+
32
35
  Console.logger.debug(self) {"#{request.method} #{request.path} #{request.headers.inspect}"}
33
36
 
34
37
  trailer = request.headers.trailer!
@@ -72,7 +75,10 @@ module Async
72
75
  write_body(@version, body, false, trailer)
73
76
  end
74
77
 
75
- return Response.read(self, request)
78
+ response = Response.read(self, request)
79
+ @ready = true
80
+
81
+ return response
76
82
  rescue
77
83
  # This will ensure that #reusable? returns false.
78
84
  @stream.close
@@ -33,6 +33,7 @@ module Async
33
33
  def initialize(stream, version)
34
34
  super(stream)
35
35
 
36
+ @ready = true
36
37
  @version = version
37
38
  end
38
39
 
@@ -48,8 +49,6 @@ module Async
48
49
 
49
50
  def read_line?
50
51
  @stream.read_until(CRLF)
51
- rescue Errno::ECONNRESET
52
- return nil
53
52
  end
54
53
 
55
54
  def read_line
@@ -68,11 +67,11 @@ module Async
68
67
 
69
68
  # Can we use this connection to make requests?
70
69
  def viable?
71
- @stream&.connected?
70
+ @ready && @stream&.connected?
72
71
  end
73
72
 
74
73
  def reusable?
75
- @persistent && @stream && !@stream.closed?
74
+ @ready && @persistent && @stream && !@stream.closed?
76
75
  end
77
76
  end
78
77
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Async
24
24
  module HTTP
25
- VERSION = "0.56.2"
25
+ VERSION = "0.56.3"
26
26
  end
27
27
  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.56.2
4
+ version: 0.56.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: 2021-05-08 00:00:00.000000000 Z
11
+ date: 2021-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.2.3
247
+ rubygems_version: 3.3.0.dev
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: A HTTP client and server library.