protocol-http2 0.28.0 → 0.29.2

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: b123bcf0056d6c21b757beb154bd0e20b099175880fa563f55cb5793c91c0013
4
- data.tar.gz: 42721396177fccec6c4ec2201e927b6de774d7ef604dabf9652c68c84ea6b8b1
3
+ metadata.gz: b2fc79a606e21b27bd978ed1fbec9be16dcec2c6cc4cd439afb75b3c427b941e
4
+ data.tar.gz: 86814f5f27b1c584856495db654a4652d21fbd7fe85f76fd9be864c2ca0026f0
5
5
  SHA512:
6
- metadata.gz: 22c8475249a63cc3b4276ac867b6034379f15f10795204d81b1e79de46cb2e1d431a9766537eca67766ca3e88703fc82f8ff38774486d04ee0d4999e8a0e801d
7
- data.tar.gz: fb451afbc0ef6c216601c18221ed0bfd107fa4262597bf7d3a8188293ae2f475e5f312641a91abbdacb79617837667b769efe1c5cc198f08234506d48cdcf74d
6
+ metadata.gz: 79c50e19d145032be114d6e2b0c3771324a751b2d3da05b25620d3f73aaf596ea3ab36651bfe1108290231b54840f73d17679f46516481dd5160bff2818b9a6c
7
+ data.tar.gz: 98229ff38e947ff4b3986cc0610ab77ecc450fb113ea86b3c84431da22265e481f12e27d092f38fc5dabe76180fb74cd05d3b529caa1b9780cefbead42ff3c2b
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2019-2026, by Samuel Williams.
5
5
  # Copyright, 2023, by Marco Concetto Rudilosso.
6
6
  # Copyright, 2026, by Denis Talakevich.
7
+ # Copyright, 2026, by Martin Ek.
7
8
 
8
9
  require_relative "framer"
9
10
  require_relative "flow_controlled"
@@ -510,6 +511,15 @@ module Protocol
510
511
 
511
512
  if stream = @streams[stream_id]
512
513
  stream.receive_headers(frame)
514
+ elsif local_stream_id?(stream_id) and closed_stream_id?(stream_id)
515
+ # This can occur if we reset a stream while the remote peer was sending headers for it,
516
+ # e.g. a response which was already in flight when the request was cancelled.
517
+ # The header block must still be decoded in order to keep the HPACK decoder state
518
+ # synchronized with the remote peer's encoder, but the decoded headers are discarded
519
+ # (RFC 9113 §5.1).
520
+ decode_headers(frame.unpack)
521
+
522
+ return nil
513
523
  else
514
524
  if stream_id <= @remote_stream_id
515
525
  raise ProtocolError, "Invalid stream id: #{stream_id} <= #{@remote_stream_id}!"
@@ -2,6 +2,7 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2019-2025, by Samuel Williams.
5
+ # Copyright, 2026, by Martin Ek.
5
6
 
6
7
  require_relative "frame"
7
8
 
@@ -90,7 +91,7 @@ module Protocol
90
91
 
91
92
  remainder = data.byteslice(maximum_size, data.bytesize-maximum_size)
92
93
 
93
- @continuation = ContinuationFrame.new
94
+ @continuation = ContinuationFrame.new(@stream_id)
94
95
  @continuation.pack(remainder, maximum_size: maximum_size)
95
96
  else
96
97
  set_flags(END_HEADERS)
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module HTTP2
10
- VERSION = "0.28.0"
10
+ VERSION = "0.29.2"
11
11
  end
12
12
  end
data/license.md CHANGED
@@ -6,6 +6,7 @@ Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2023, by Marco Concetto Rudilosso.
7
7
  Copyright, 2024, by Adam Petro.
8
8
  Copyright, 2026, by Denis Talakevich.
9
+ Copyright, 2026, by Martin Ek.
9
10
 
10
11
  Permission is hereby granted, free of charge, to any person obtaining a copy
11
12
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -14,6 +14,15 @@ 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.29.1
18
+
19
+ - Sign releases with the Socketry release certificate.
20
+
21
+ ### v0.29.0
22
+
23
+ - Decode and discard `HEADERS` received for a locally-initiated stream which was already reset, e.g. a response in flight when the request was cancelled, rather than failing the connection with `ProtocolError`. This keeps the HPACK decoder state synchronized with the remote peer (RFC 9113 §5.1).
24
+ - `CONTINUATION` frames generated when packing a large header block now carry the stream ID of the frame they continue.
25
+
17
26
  ### v0.28.0
18
27
 
19
28
  - Treat `RST_STREAM(NO_ERROR)` as an orderly stream closure rather than constructing a `StreamError`.
@@ -47,16 +56,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http2/rele
47
56
 
48
57
  - 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.
49
58
 
50
- ### v0.22.1
51
-
52
- - Improved tracing performance by only tracing framer operations when in an active trace context.
53
- - Updated `protocol-http` dependency version in gemspec.
54
- - Code modernization and documentation improvements.
55
-
56
- ### v0.22.0
57
-
58
- - [Added Priority Update Frame and Stream Priority](https://socketry.github.io/protocol-http2/releases/index#added-priority-update-frame-and-stream-priority)
59
-
60
59
  ## See Also
61
60
 
62
61
  - [Async::HTTP](https://github.com/socketry/async-http) - A high-level HTTP client and server implementation.
@@ -81,12 +80,14 @@ $ bundle exec sus
81
80
 
82
81
  ### Making Releases
83
82
 
84
- To make a new release:
83
+ To prepare a release branch and open a pull request from an up-to-date `main`:
85
84
 
86
85
  ``` bash
87
- $ bundle exec bake gem:release:patch # or minor or major
86
+ $ bundle exec bake gem:github:release:patch # or minor or major
88
87
  ```
89
88
 
89
+ See [bake-gem-github](https://github.com/socketry/bake-gem-github) for setup, remote releases, and recovery.
90
+
90
91
  ### Developer Certificate of Origin
91
92
 
92
93
  In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
data/releases.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Releases
2
2
 
3
+ ## v0.29.1
4
+
5
+ - Sign releases with the Socketry release certificate.
6
+
7
+ ## v0.29.0
8
+
9
+ - Decode and discard `HEADERS` received for a locally-initiated stream which was already reset, e.g. a response in flight when the request was cancelled, rather than failing the connection with `ProtocolError`. This keeps the HPACK decoder state synchronized with the remote peer (RFC 9113 §5.1).
10
+ - `CONTINUATION` frames generated when packing a large header block now carry the stream ID of the frame they continue.
11
+
3
12
  ## v0.28.0
4
13
 
5
14
  - Treat `RST_STREAM(NO_ERROR)` as an orderly stream closure rather than constructing a `StreamError`.
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.28.0
4
+ version: 0.29.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -11,36 +11,7 @@ authors:
11
11
  - Marco Concetto Rudilosso
12
12
  - Olle Jonsson
13
13
  bindir: bin
14
- cert_chain:
15
- - |
16
- -----BEGIN CERTIFICATE-----
17
- MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
18
- ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
19
- CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
20
- MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
21
- MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
22
- bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
23
- igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
24
- 9qZdoq9xt7H+RPbw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6DKIT3MtGE2+CP
40
- eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
41
- Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
- voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
- -----END CERTIFICATE-----
14
+ cert_chain: []
44
15
  date: 1980-01-02 00:00:00.000000000 Z
45
16
  dependencies:
46
17
  - !ruby/object:Gem::Dependency
@@ -126,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
97
  - !ruby/object:Gem::Version
127
98
  version: '0'
128
99
  requirements: []
129
- rubygems_version: 4.0.10
100
+ rubygems_version: 4.0.21
130
101
  specification_version: 4
131
102
  summary: A low level implementation of the HTTP/2 protocol.
132
103
  test_files: []
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- �G$٣@��5�'�7����It/�ua*�(I@1����+O�G+t)� 5�6v7�G�Z�k���������Cƽ�<ĸ��N�}q&�T2-Z�Ɲ�ě�)M�f�T�LlŲ�X�M��.Ү�A�M�#Ke��3�ʈ�@x�K�0���0�{FF.�R�T�����Ss�Ue���o� �F���{�=k|���e�/h��e�1UI�=� �G���a��J��7�t����-�Xnc ��"�����u�8�ic %FA~,��I�.�"au�̝�q�J����p
2
- ��7���-\�kw%�8o�N �K�Z���=)DnӧlcHW [_�� W|a��a�