async-http 0.56.2 → 0.56.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efbee0417c7ab944ad2ec6b6bd2c29735924d821b2396b02e78a6826874aa644
|
4
|
+
data.tar.gz: '08abaadc604cba6bb2ade84fd1387f962bab03c915f613c69cd5a1588666b431'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/async/http/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|