protocol-http2 0.23.0 → 0.24.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: d4df424d3c1c97120be6031179d3febd9b6bcbbaeb163b24d53b03f05ae28696
4
- data.tar.gz: baf0e59d7998a934d35eb1d33fa6205ccbae7bb6c5d352721b1d5d1ba0880131
3
+ metadata.gz: 163e984c0ac8a9a19c5dd3fd4f09c7b4be35622413a562ff80f14dece63f86e3
4
+ data.tar.gz: 5329a5966f521513c7bc275a426c42264aa2fcc5078b39dbb0c84945cf18240b
5
5
  SHA512:
6
- metadata.gz: 4c7f24cd932068ecdcdf604bd9a9e3757c0fe40167844dfd351340f088507b6975a18288991c34342c15ad4217bf111a6e4dfa620c68c1bb7c83c149f0a5d21d
7
- data.tar.gz: 404eff6b4e7a395cdcd44fd366564dbd67edc292857685d6294144b66892eda4dbdc60518cd0e2f58e034d001b45c0aeeffb389fccf49ad54464b97332bcc398
6
+ metadata.gz: 301bdf39a174d8db27486c568abf7c01926ed0c290502e3580500a461e6e6e5ac296630b4dce3c56207f314ee5bab29d7ff18eead4ad54d5ea2326043a70f118
7
+ data.tar.gz: 58f22287bd88d4c2844d1742ecbc2bf57f8640ec6b35400ade3aa565101715c1282ed59d354b8a3c5c77103e83f87ce3764865ea5ff335721f63a14bcf527c48
checksums.yaml.gz.sig CHANGED
Binary file
@@ -19,10 +19,10 @@ This gem provides a low-level implementation of the HTTP/2 protocol. It is desig
19
19
  Here is a basic HTTP/2 client:
20
20
 
21
21
  ``` ruby
22
- require 'async'
23
- require 'async/io/stream'
24
- require 'async/http/endpoint'
25
- require 'protocol/http2/client'
22
+ require "async"
23
+ require "async/io/stream"
24
+ require "async/http/endpoint"
25
+ require "protocol/http2/client"
26
26
 
27
27
  Async do
28
28
  endpoint = Async::HTTP::Endpoint.parse("https://www.google.com/search?q=kittens")
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2025, by Samuel Williams.
4
+ # Copyright, 2019-2026, by Samuel Williams.
5
5
  # Copyright, 2023, by Marco Concetto Rudilosso.
6
6
 
7
7
  require_relative "framer"
@@ -109,6 +109,12 @@ module Protocol
109
109
  # Close the underlying framer and all streams.
110
110
  def close(error = nil)
111
111
  # The underlying socket may already be closed by this point.
112
+
113
+ # If there are active streams when the connection closes, it's an error for those streams, even if the connection itself closed cleanly:
114
+ if @streams.any? and error.nil?
115
+ error = EOFError.new("Connection closed with #{@streams.size} active stream(s)!")
116
+ end
117
+
112
118
  @streams.each_value{|stream| stream.close(error)}
113
119
  @streams.clear
114
120
 
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module HTTP2
10
- VERSION = "0.23.0"
10
+ VERSION = "0.24.0"
11
11
  end
12
12
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2025, by Samuel Williams.
3
+ Copyright, 2019-2026, by Samuel Williams.
4
4
  Copyright, 2019, by Yuta Iwama.
5
5
  Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2023, by Marco Concetto Rudilosso.
data/readme.md CHANGED
@@ -14,14 +14,54 @@ Please see the [project documentation](https://socketry.github.io/protocol-http2
14
14
 
15
15
  Please see the [project releases](https://socketry.github.io/protocol-http2/releases/index) for all releases.
16
16
 
17
+ ### v0.24.0
18
+
19
+ - When closing a connection with active streams, if an error is not provided, it will default to `EOFError` so that streams propagate the closure correctly.
20
+
17
21
  ### v0.23.0
18
22
 
19
23
  - Introduce a limit to the number of CONTINUATION frames that can be read to prevent resource exhaustion. The default limit is 8 continuation frames, which means a total of 9 frames (1 initial + 8 continuation). This limit can be adjusted by passing a different value to the `limit` parameter in the `Continued.read` method. Setting the limit to 0 will only read the initial frame without any continuation frames. In order to change the default, you can redefine the `LIMIT` constant in the `Protocol::HTTP2::Continued` module, OR you can pass a different frame class to the framer.
20
24
 
25
+ ### v0.22.1
26
+
27
+ - Improved tracing performance by only tracing framer operations when in an active trace context.
28
+ - Updated `protocol-http` dependency version in gemspec.
29
+ - Code modernization and documentation improvements.
30
+
21
31
  ### v0.22.0
22
32
 
23
33
  - [Added Priority Update Frame and Stream Priority](https://socketry.github.io/protocol-http2/releases/index#added-priority-update-frame-and-stream-priority)
24
34
 
35
+ ### v0.21.0
36
+
37
+ - **Breaking**: Removed support for priority frame and stream dependencies. The `Protocol::HTTP2::Stream` class no longer tracks dependencies, and `Stream#send_headers` no longer takes `priority` as the first argument. This change simplifies the internal implementation significantly as HTTP/2 priority frames have been deprecated in the protocol specification.
38
+
39
+ ### v0.20.0
40
+
41
+ - Improved performance of dependency management by avoiding linear search operations.
42
+ - Removed `traces` as a required dependency - it's now optional and only used when explicitly needed.
43
+ - Added better documentation for `maximum_concurrent_streams` setting.
44
+ - Restored 100% test coverage and exposed trace provider for optional tracing support.
45
+
46
+ ### v0.19.4
47
+
48
+ - Reduced the number of window update frames sent to improve network efficiency.
49
+
50
+ ### v0.19.3
51
+
52
+ - Improved window update frame handling and performance optimizations.
53
+ - Better implementation of `Window#inspect` for debugging.
54
+
55
+ ### v0.19.2
56
+
57
+ - Added traces to framer for better debugging and monitoring capabilities.
58
+ - Minor fixes to logging output.
59
+
60
+ ### v0.19.1
61
+
62
+ - Performance improvements for synchronized output handling.
63
+ - Extracted `window.rb` into separate module for better organization.
64
+
25
65
  ## See Also
26
66
 
27
67
  - [Async::HTTP](https://github.com/socketry/async-http) - A high-level HTTP client and server implementation.
data/releases.md CHANGED
@@ -1,9 +1,19 @@
1
1
  # Releases
2
2
 
3
+ ## v0.24.0
4
+
5
+ - When closing a connection with active streams, if an error is not provided, it will default to `EOFError` so that streams propagate the closure correctly.
6
+
3
7
  ## v0.23.0
4
8
 
5
9
  - Introduce a limit to the number of CONTINUATION frames that can be read to prevent resource exhaustion. The default limit is 8 continuation frames, which means a total of 9 frames (1 initial + 8 continuation). This limit can be adjusted by passing a different value to the `limit` parameter in the `Continued.read` method. Setting the limit to 0 will only read the initial frame without any continuation frames. In order to change the default, you can redefine the `LIMIT` constant in the `Protocol::HTTP2::Continued` module, OR you can pass a different frame class to the framer.
6
10
 
11
+ ## v0.22.1
12
+
13
+ - Improved tracing performance by only tracing framer operations when in an active trace context.
14
+ - Updated `protocol-http` dependency version in gemspec.
15
+ - Code modernization and documentation improvements.
16
+
7
17
  ## v0.22.0
8
18
 
9
19
  ### Added Priority Update Frame and Stream Priority
@@ -11,3 +21,174 @@
11
21
  HTTP/2 has deprecated the priority frame and stream dependency tracking. This feature has been effectively removed from the protocol. As a consequence, the internal implementation is greatly simplified. The `Protocol::HTTP2::Stream` class no longer tracks dependencies, and this includes `Stream#send_headers` which no longer takes `priority` as the first argument.
12
22
 
13
23
  Optional per-request priority can be set using the `priority` header instead, and this value can be manipulated using the priority update frame.
24
+
25
+ ## v0.21.0
26
+
27
+ - **Breaking**: Removed support for priority frame and stream dependencies. The `Protocol::HTTP2::Stream` class no longer tracks dependencies, and `Stream#send_headers` no longer takes `priority` as the first argument. This change simplifies the internal implementation significantly as HTTP/2 priority frames have been deprecated in the protocol specification.
28
+
29
+ ## v0.20.0
30
+
31
+ - Improved performance of dependency management by avoiding linear search operations.
32
+ - Removed `traces` as a required dependency - it's now optional and only used when explicitly needed.
33
+ - Added better documentation for `maximum_concurrent_streams` setting.
34
+ - Restored 100% test coverage and exposed trace provider for optional tracing support.
35
+
36
+ ## v0.19.4
37
+
38
+ - Reduced the number of window update frames sent to improve network efficiency.
39
+
40
+ ## v0.19.3
41
+
42
+ - Improved window update frame handling and performance optimizations.
43
+ - Better implementation of `Window#inspect` for debugging.
44
+
45
+ ## v0.19.2
46
+
47
+ - Added traces to framer for better debugging and monitoring capabilities.
48
+ - Minor fixes to logging output.
49
+
50
+ ## v0.19.1
51
+
52
+ - Performance improvements for synchronized output handling.
53
+ - Extracted `window.rb` into separate module for better organization.
54
+
55
+ ## v0.19.0
56
+
57
+ - Removed unused `opened` hook that was never utilized.
58
+ - Improved ASCII art diagram in documentation.
59
+ - Modernized gem structure and dependencies.
60
+ - Moved test fixtures into proper namespace organization.
61
+
62
+ ## v0.18.0
63
+
64
+ - Fixed `maximum_connection_streams` reference to use `@remote_settings`.
65
+ - Modernized gem structure and dependencies.
66
+ - Improved flush synchronization - `#flush` is already synchronized.
67
+
68
+ ## v0.17.0
69
+
70
+ - Exposed synchronize flush functionality for better concurrency control.
71
+ - Improved single line responsibility in code structure.
72
+ - Enhanced error handling - fail in `Connection#write_frames` if `@framer` is `nil`.
73
+ - Fixed broken test cases.
74
+
75
+ ## v0.16.0
76
+
77
+ - Removed unused `bake-github-pages` gem dependency.
78
+ - Modernized gem structure and build process.
79
+ - Updated development dependencies and workflows.
80
+
81
+ ## v0.15.0
82
+
83
+ - Achieved 100% test coverage with comprehensive test improvements.
84
+ - Fixed multiple minor bugs discovered through enhanced testing.
85
+ - Modernized gem structure and development workflow.
86
+ - Improved maximum concurrent stream handling - now defined only by local settings.
87
+ - Added missing require statements in version tests.
88
+
89
+ ## v0.14.0
90
+
91
+ - Added fuzzing support for the framer to improve robustness.
92
+ - Improved connection closed state determination.
93
+ - Enhanced error handling by ignoring expected errors.
94
+ - Optimized AFL (American Fuzzy Lop) latency handling.
95
+
96
+ ## v0.13.0
97
+
98
+ - Added methods for handling state transitions.
99
+ - Removed `pry` and `rake` dependencies for cleaner gem structure.
100
+ - Improved debugging and development workflow.
101
+
102
+ ## v0.12.0
103
+
104
+ - Updated supported Ruby versions.
105
+ - Significantly improved flow control handling, allowing connection local window to have desired high water mark.
106
+ - Enhanced window management for better performance.
107
+
108
+ ## v0.11.0
109
+
110
+ - Separated stream and priority logic to improve memory efficiency.
111
+ - Added Ruby 2.7 support to continuous integration.
112
+ - Improved code organization and performance.
113
+
114
+ ## v0.10.0
115
+
116
+ - Improved child stream handling - don't consider child in future stream priority computations.
117
+ - Enhanced state transitions to cache number of currently active streams.
118
+ - Performance optimizations for stream management.
119
+
120
+ ## v0.9.0
121
+
122
+ - Split window handling for sub-classes to improve modularity.
123
+ - Fixed Travis CI badge in documentation.
124
+ - Enhanced window management architecture.
125
+
126
+ ## v0.8.0
127
+
128
+ - Added support for synchronizing output to prevent headers from being encoded out of order.
129
+ - Improved header handling reliability and consistency.
130
+
131
+ ## v0.7.0
132
+
133
+ - Introduced explicit `StreamError` for stream reset codes.
134
+ - Added `HeaderError` for tracking header-specific problems (e.g., invalid pseudo-headers).
135
+ - Removed `send_failure` method as it was not useful.
136
+ - Improved `header_table_size` handling.
137
+ - Enhanced stream priority handling and parent/child relationships.
138
+ - Better flow control and priority management.
139
+ - Improved debugging output and error validation.
140
+ - Enhanced handling of `end_stream` and connection management.
141
+ - Added stream buffer implementation with window update integration.
142
+ - Implemented basic stream priority handling.
143
+ - Improved goaway frame handling.
144
+
145
+ ## v0.6.0
146
+
147
+ - Better handling of GOAWAY frames.
148
+ - Improved connection termination procedures.
149
+
150
+ ## v0.5.0
151
+
152
+ - Improved handling of stream creation and push promises.
153
+ - Enhanced stream lifecycle management.
154
+
155
+ ## v0.4.0
156
+
157
+ - Improved validation of stream ID and error handling.
158
+ - Enhanced flow control implementation.
159
+ - Better RFC compliance with HTTP/2 specification.
160
+ - Fixed priority frame validation - fail if priority depends on own stream.
161
+ - Improved ping frame length checking.
162
+ - Enhanced logging messages and error reporting.
163
+
164
+ ## v0.3.0
165
+
166
+ - Added support for `ENABLE_CONNECT_PROTOCOL` setting.
167
+ - Better handling of underlying IO being closed.
168
+ - Improved connection management and error handling.
169
+ - Enhanced coverage reporting.
170
+
171
+ ## v0.2.1
172
+
173
+ - Fixed header length and EOF handling.
174
+ - Improved error boundary conditions.
175
+
176
+ ## v0.2.0
177
+
178
+ - Significantly improved error handling throughout the library.
179
+ - Better exception management and error reporting.
180
+
181
+ ## v0.1.1
182
+
183
+ - Fixed HPACK usage and integration.
184
+ - Corrected header compression/decompression handling.
185
+
186
+ ## v0.1.0
187
+
188
+ - Initial migration of HTTP/2 protocol implementation from `http-protocol`.
189
+ - Basic HTTP/2 frame parsing and generation.
190
+ - Integration with `protocol-hpack` for header compression.
191
+ - Stream management and flow control foundation.
192
+ - Connection lifecycle management.
193
+ - Support for all standard HTTP/2 frame types.
194
+ - Basic client and server implementations.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.6.9
126
+ rubygems_version: 4.0.3
127
127
  specification_version: 4
128
128
  summary: A low level implementation of the HTTP/2 protocol.
129
129
  test_files: []
metadata.gz.sig CHANGED
Binary file