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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 391e059d6c94805257b5e058b02987ad88ce8decaafafb6e7815faeaeb8a5079
4
- data.tar.gz: 2a260bb8dba2ffb109f612400d9e05c03012f994c275f6c447a09d915cbd186e
3
+ metadata.gz: 9ccacda954db4a8169a839716b97ab515b2a7c4077979c097e0e32960a489137
4
+ data.tar.gz: bece54b3e60dc58f15d6ac0bc9fd383b3ba33e75f6ba21f7dae830b1e22a0528
5
5
  SHA512:
6
- metadata.gz: a882c3dcb76b5b601c7601a1875a8708ec301e510cb74f77e9a4060ac5ae9e199fec3c41b3bcdc7d1eb125d81aea8c8f50ba70d9e5fb7d3c832aa8ebbc97d518
7
- data.tar.gz: ce9455361a23462bec86b7a1272665e411d130dd994df79e2d1c7fc0769a11f33ae3eb6628b9a5ced3b197bfd0bb5dd06a0e252cd0475fd013ef90eaee767682
6
+ metadata.gz: e5a8f2d96544ab560a03ec304ce29f26843fcd1a511bff1aaa60d05c4f5157d954fff51fcbc37a8bb835884a27606c7501540c5cac18240e57eb6e7d834a0807
7
+ data.tar.gz: 2ea2d61d2144079119dfcf769f30a942df02f709dc1b61839d55d912bdbbbd64c7719d9895c4e38c734a3af1696b4d617e7e8b875e1d195c7e8371cfcdc7474e
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,6 @@
1
- 6�2Lu}u1NG�^le��r�ҡ��J��"u������D����j�}c1dp�\D�#�#̒�� ɪ���X�� Yw�-�����7��iE7�G�����i�
2
- ��IernխQ��+E��6�PzoѴ�b*k86��b��G���Yj<��4g4d�t�{� ~_��5�F��u�"T����lj�����d�H8�j�{�T�@�pbhC�8N��9�.���Ո+K�A�q8)�aD��GmB�s&����Ќ���]w�C�Z�S� �U�[W�B�R�a�V�2�.w�i��{�������'������z�o���6>/��'���7�:�N�"\��4nk�zP�o�u��;j����Zˇ� �`���y��W���w 
1
+ RZ[Ne���'iZ7��tV/=��ͣ�J����]
2
+ {8����3��jENp6�� \����W�����>�����AMdm��n7��X5b���B�ïb@�CJElHhcd򬎔C���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�
@@ -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::RequestFailed
118
- # This is a specific case where the entire request wasn't sent before a failure occurred. So, we can even resend non-idempotent requests.
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
- begin
42
- target = request.path
43
- authority = request.authority
44
-
45
- # If we are using a CONNECT request, we need to use the authority as the target:
46
- if request.connect?
47
- target = authority
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
 
@@ -261,7 +261,7 @@ module Async
261
261
  begin
262
262
  @stream.send_headers(headers)
263
263
  rescue
264
- raise RequestFailed
264
+ raise ::Protocol::HTTP::RefusedError
265
265
  end
266
266
 
267
267
  @stream.send_body(request.body, trailer)
@@ -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.
@@ -7,6 +7,6 @@
7
7
  module Async
8
8
  # @namespace
9
9
  module HTTP
10
- VERSION = "0.94.3"
10
+ VERSION = "0.95.0"
11
11
  end
12
12
  end
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.94.3
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.58'
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.58'
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.36'
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.36'
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.22'
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.22'
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