async-http 0.94.3 → 0.95.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 +4 -4
- checksums.yaml.gz.sig +6 -2
- data/lib/async/http/client.rb +2 -2
- data/lib/async/http/protocol/http1/client.rb +9 -14
- data/lib/async/http/protocol/http2/response.rb +1 -1
- data/lib/async/http/protocol/request.rb +0 -4
- data/lib/async/http/version.rb +1 -1
- data/readme.md +7 -4
- data/releases.md +7 -0
- data.tar.gz.sig +0 -0
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ccacda954db4a8169a839716b97ab515b2a7c4077979c097e0e32960a489137
|
|
4
|
+
data.tar.gz: bece54b3e60dc58f15d6ac0bc9fd383b3ba33e75f6ba21f7dae830b1e22a0528
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5a8f2d96544ab560a03ec304ce29f26843fcd1a511bff1aaa60d05c4f5157d954fff51fcbc37a8bb835884a27606c7501540c5cac18240e57eb6e7d834a0807
|
|
7
|
+
data.tar.gz: 2ea2d61d2144079119dfcf769f30a942df02f709dc1b61839d55d912bdbbbd64c7719d9895c4e38c734a3af1696b4d617e7e8b875e1d195c7e8371cfcdc7474e
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
��
|
|
1
|
+
RZ[N�e���'i�Z7��t�V/=��ͣ�J����]
|
|
2
|
+
{8����3��jENp6��\����W�����>�����AMdm��n�7��X5b���B�ïb@�C�J�El�HhcdC���1��U]����NhMWe�P�hR*��
|
|
3
|
+
z��[6ڄ���\wc��wG��bo��z�I���Sx
|
|
4
|
+
���!_���ei|�k-<r`$�����}j�9�ƅ�p�X|�R_[�$�!����{����v�5��"Cf��z
|
|
5
|
+
�pW��M:6h�ft��@��#��v�i+eY�0�xQ0㻵O7�p�gN�~� �5�[K�͠���ѕ
|
|
6
|
+
>��6��"�sg�R���QGN����H�٧+�������Y`8���uJK�
|
data/lib/async/http/client.rb
CHANGED
|
@@ -114,8 +114,8 @@ module Async
|
|
|
114
114
|
# This signals that the ensure block below should not try to release the connection, because it's bound into the response which will be returned:
|
|
115
115
|
connection = nil
|
|
116
116
|
return response
|
|
117
|
-
rescue Protocol::
|
|
118
|
-
# This is a specific case where the
|
|
117
|
+
rescue ::Protocol::HTTP::RefusedError
|
|
118
|
+
# This is a specific case where the request was not processed by the server. So, we can resend even non-idempotent requests.
|
|
119
119
|
if connection
|
|
120
120
|
@pool.release(connection)
|
|
121
121
|
connection = nil
|
|
@@ -38,22 +38,17 @@ module Async
|
|
|
38
38
|
headers = request.headers.header
|
|
39
39
|
|
|
40
40
|
# We carefully interpret https://tools.ietf.org/html/rfc7230#section-6.3.1 to implement this correctly.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
authority = nil
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
write_request(authority, request.method, target, @version, headers)
|
|
52
|
-
rescue
|
|
53
|
-
# If we fail to fully write the request and body, we can retry this request.
|
|
54
|
-
raise RequestFailed
|
|
41
|
+
target = request.path
|
|
42
|
+
authority = request.authority
|
|
43
|
+
|
|
44
|
+
# If we are using a CONNECT request, we need to use the authority as the target:
|
|
45
|
+
if request.connect?
|
|
46
|
+
target = authority
|
|
47
|
+
authority = nil
|
|
55
48
|
end
|
|
56
49
|
|
|
50
|
+
write_request(authority, request.method, target, @version, headers)
|
|
51
|
+
|
|
57
52
|
if request.body?
|
|
58
53
|
body = request.body
|
|
59
54
|
|
|
@@ -11,10 +11,6 @@ require_relative "../body/writable"
|
|
|
11
11
|
module Async
|
|
12
12
|
module HTTP
|
|
13
13
|
module Protocol
|
|
14
|
-
# Failed to send the request. The request body has NOT been consumed (i.e. #read) and you should retry the request.
|
|
15
|
-
class RequestFailed < StandardError
|
|
16
|
-
end
|
|
17
|
-
|
|
18
14
|
# An incoming HTTP request generated by server protocol implementations.
|
|
19
15
|
class Request < ::Protocol::HTTP::Request
|
|
20
16
|
# @returns [Connection | Nil] The underlying protocol connection.
|
data/lib/async/http/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -16,6 +16,13 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
|
|
|
16
16
|
|
|
17
17
|
Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
|
|
18
18
|
|
|
19
|
+
### v0.95.0
|
|
20
|
+
|
|
21
|
+
- Use `Protocol::HTTP::RefusedError` for safe retry of requests not processed by the server, including non-idempotent methods like PUT.
|
|
22
|
+
- Remove `Async::HTTP::Protocol::RequestFailed` in favour of `Protocol::HTTP::RefusedError`.
|
|
23
|
+
- HTTP/1: Delegate request write failure handling to `protocol-http1`.
|
|
24
|
+
- HTTP/2: Handle GOAWAY and REFUSED\_STREAM via `protocol-http2`, enabling automatic retry of unprocessed requests.
|
|
25
|
+
|
|
19
26
|
### v0.94.3
|
|
20
27
|
|
|
21
28
|
- Fix response body leak in HTTP/2 server when stream is reset before `send_response` completes (e.g. client-side gRPC cancellation). The response body's `close` was never called, leaking any resources tied to body lifecycle (such as `rack.response_finished` callbacks and utilization metrics).
|
|
@@ -52,10 +59,6 @@ Please see the [project releases](https://socketry.github.io/async-http/releases
|
|
|
52
59
|
|
|
53
60
|
- [Unify HTTP/1 and HTTP/2 `CONNECT` semantics](https://socketry.github.io/async-http/releases/index#unify-http/1-and-http/2-connect-semantics)
|
|
54
61
|
|
|
55
|
-
### v0.86.0
|
|
56
|
-
|
|
57
|
-
- Add support for HTTP/2 `NO_RFC7540_PRIORITIES`. See <https://www.rfc-editor.org/rfc/rfc9218.html> for more details.
|
|
58
|
-
|
|
59
62
|
## See Also
|
|
60
63
|
|
|
61
64
|
- [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.95.0
|
|
4
|
+
|
|
5
|
+
- Use `Protocol::HTTP::RefusedError` for safe retry of requests not processed by the server, including non-idempotent methods like PUT.
|
|
6
|
+
- Remove `Async::HTTP::Protocol::RequestFailed` in favour of `Protocol::HTTP::RefusedError`.
|
|
7
|
+
- HTTP/1: Delegate request write failure handling to `protocol-http1`.
|
|
8
|
+
- HTTP/2: Handle GOAWAY and REFUSED\_STREAM via `protocol-http2`, enabling automatic retry of unprocessed requests.
|
|
9
|
+
|
|
3
10
|
## v0.94.3
|
|
4
11
|
|
|
5
12
|
- Fix response body leak in HTTP/2 server when stream is reset before `send_response` completes (e.g. client-side gRPC cancellation). The response body's `close` was never called, leaking any resources tied to body lifecycle (such as `rack.response_finished` callbacks and utilization metrics).
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: async-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.95.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -138,42 +138,42 @@ dependencies:
|
|
|
138
138
|
requirements:
|
|
139
139
|
- - "~>"
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: '0.
|
|
141
|
+
version: '0.62'
|
|
142
142
|
type: :runtime
|
|
143
143
|
prerelease: false
|
|
144
144
|
version_requirements: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements:
|
|
146
146
|
- - "~>"
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: '0.
|
|
148
|
+
version: '0.62'
|
|
149
149
|
- !ruby/object:Gem::Dependency
|
|
150
150
|
name: protocol-http1
|
|
151
151
|
requirement: !ruby/object:Gem::Requirement
|
|
152
152
|
requirements:
|
|
153
153
|
- - "~>"
|
|
154
154
|
- !ruby/object:Gem::Version
|
|
155
|
-
version: '0.
|
|
155
|
+
version: '0.39'
|
|
156
156
|
type: :runtime
|
|
157
157
|
prerelease: false
|
|
158
158
|
version_requirements: !ruby/object:Gem::Requirement
|
|
159
159
|
requirements:
|
|
160
160
|
- - "~>"
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
|
-
version: '0.
|
|
162
|
+
version: '0.39'
|
|
163
163
|
- !ruby/object:Gem::Dependency
|
|
164
164
|
name: protocol-http2
|
|
165
165
|
requirement: !ruby/object:Gem::Requirement
|
|
166
166
|
requirements:
|
|
167
167
|
- - "~>"
|
|
168
168
|
- !ruby/object:Gem::Version
|
|
169
|
-
version: '0.
|
|
169
|
+
version: '0.26'
|
|
170
170
|
type: :runtime
|
|
171
171
|
prerelease: false
|
|
172
172
|
version_requirements: !ruby/object:Gem::Requirement
|
|
173
173
|
requirements:
|
|
174
174
|
- - "~>"
|
|
175
175
|
- !ruby/object:Gem::Version
|
|
176
|
-
version: '0.
|
|
176
|
+
version: '0.26'
|
|
177
177
|
- !ruby/object:Gem::Dependency
|
|
178
178
|
name: protocol-url
|
|
179
179
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
|
Binary file
|