protocol-http2 0.19.2 → 0.19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http2/connection.rb +5 -7
- data/lib/protocol/http2/framer.rb +46 -0
- data/lib/protocol/http2/stream.rb +2 -2
- data/lib/protocol/http2/version.rb +1 -1
- data/lib/protocol/http2/window.rb +5 -3
- data.tar.gz.sig +0 -0
- metadata +16 -2
- 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: b04111afb8bcb89c8866ccd13f1782ab2cd9ccf438210d5da17aecb384d2cf02
|
4
|
+
data.tar.gz: 7574a7a9595487e5ad574250e98a6662e5d2c588acffe8536b9d4f642cabfc4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec243f9398ad359deb1ca97341d6fca6c563158a40fa7e3617b39af599bb0ebce8c302ef7af3a378b944d1b8ada1689eff8f540e5c274a065fcd2c8420f531af
|
7
|
+
data.tar.gz: '08f92272a802133333232cac14b26568fdc5e95b4c0054caec717de403e0a5e22d41d3c2aa57ec08af40de11a75e4f2bb508d1b7b4c480513da81d352d58c072'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -215,20 +215,18 @@ module Protocol
|
|
215
215
|
def write_frame(frame)
|
216
216
|
synchronize do
|
217
217
|
@framer.write_frame(frame)
|
218
|
-
|
219
|
-
# I tried moving this outside the synchronize block but it caused a deadlock.
|
220
|
-
@framer.flush
|
221
218
|
end
|
219
|
+
|
220
|
+
@framer.flush
|
222
221
|
end
|
223
222
|
|
224
223
|
def write_frames
|
225
224
|
if @framer
|
226
225
|
synchronize do
|
227
226
|
yield @framer
|
228
|
-
|
229
|
-
# See note above.
|
230
|
-
@framer.flush
|
231
227
|
end
|
228
|
+
|
229
|
+
@framer.flush
|
232
230
|
else
|
233
231
|
raise EOFError, "Connection closed!"
|
234
232
|
end
|
@@ -476,7 +474,7 @@ module Protocol
|
|
476
474
|
# Return if there is no window to consume:
|
477
475
|
return unless size > 0
|
478
476
|
|
479
|
-
# Console.
|
477
|
+
# Console.info(self) do |buffer|
|
480
478
|
# @dependencies.each do |id, dependency|
|
481
479
|
# buffer.puts "- #{dependency}"
|
482
480
|
# end
|
@@ -16,6 +16,8 @@ require_relative "goaway_frame"
|
|
16
16
|
require_relative "window_update_frame"
|
17
17
|
require_relative "continuation_frame"
|
18
18
|
|
19
|
+
require "traces/provider"
|
20
|
+
|
19
21
|
module Protocol
|
20
22
|
module HTTP2
|
21
23
|
# HTTP/2 frame type mapping as defined by the spec
|
@@ -107,6 +109,50 @@ module Protocol
|
|
107
109
|
|
108
110
|
raise EOFError, "Could not read frame header!"
|
109
111
|
end
|
112
|
+
|
113
|
+
Traces::Provider(self) do
|
114
|
+
def write_connection_preface
|
115
|
+
Traces.trace("protocol.http2.framer.write_connection_preface") do
|
116
|
+
super
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def read_connection_preface
|
121
|
+
Traces.trace("protocol.http2.framer.read_connection_preface") do
|
122
|
+
super
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def write_frame(frame)
|
127
|
+
attributes = {
|
128
|
+
"frame.length" => frame.length,
|
129
|
+
"frame.type" => frame.type,
|
130
|
+
"frame.flags" => frame.flags,
|
131
|
+
"frame.stream_id" => frame.stream_id,
|
132
|
+
}
|
133
|
+
|
134
|
+
Traces.trace("protocol.http2.framer.write_frame", attributes: attributes) do
|
135
|
+
super
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def read_frame(maximum_frame_size = MAXIMUM_ALLOWED_FRAME_SIZE)
|
140
|
+
Traces.trace("protocol.http2.framer.read_frame") do |span|
|
141
|
+
super.tap do |frame|
|
142
|
+
span["frame.length"] = frame.length
|
143
|
+
span["frame.type"] = frame.type
|
144
|
+
span["frame.flags"] = frame.flags
|
145
|
+
span["frame.stream_id"] = frame.stream_id
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def flush
|
151
|
+
Traces.trace("protocol.http2.framer.flush") do
|
152
|
+
super
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
110
156
|
end
|
111
157
|
end
|
112
158
|
end
|
@@ -275,7 +275,7 @@ module Protocol
|
|
275
275
|
end
|
276
276
|
|
277
277
|
protected def ignore_headers(frame)
|
278
|
-
#
|
278
|
+
# Console.warn(self) {"Received headers in state: #{@state}!"}
|
279
279
|
end
|
280
280
|
|
281
281
|
def receive_headers(frame)
|
@@ -316,7 +316,7 @@ module Protocol
|
|
316
316
|
end
|
317
317
|
|
318
318
|
def ignore_data(frame)
|
319
|
-
#
|
319
|
+
# Console.warn(self) {"Received headers in state: #{@state}!"}
|
320
320
|
end
|
321
321
|
|
322
322
|
# DATA frames are subject to flow control and can only be sent when a stream is in the "open" or "half-closed (remote)" state. The entire DATA frame payload is included in flow control, including the Pad Length and Padding fields if present. If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state, the recipient MUST respond with a stream error of type STREAM_CLOSED.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright,
|
4
|
+
# Copyright, 2024, by Samuel Williams.
|
5
5
|
|
6
6
|
module Protocol
|
7
7
|
module HTTP2
|
@@ -72,8 +72,10 @@ module Protocol
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def inspect
|
75
|
-
"\#<#{self.class}
|
75
|
+
"\#<#{self.class} available=#{@available} used=#{@used} capacity=#{@capacity}#{limited? ? " limited" : nil}>"
|
76
76
|
end
|
77
|
+
|
78
|
+
alias to_s inspect
|
77
79
|
end
|
78
80
|
|
79
81
|
# This is a window which efficiently maintains a desired capacity.
|
@@ -108,7 +110,7 @@ module Protocol
|
|
108
110
|
end
|
109
111
|
|
110
112
|
def inspect
|
111
|
-
"\#<#{self.class}
|
113
|
+
"\#<#{self.class} available=#{@available} used=#{@used} capacity=#{@capacity} desired=#{@desired} #{limited? ? "limited" : nil}>"
|
112
114
|
end
|
113
115
|
end
|
114
116
|
end
|
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.19.
|
4
|
+
version: 0.19.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -40,7 +40,7 @@ cert_chain:
|
|
40
40
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
41
41
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
42
42
|
-----END CERTIFICATE-----
|
43
|
-
date: 2024-
|
43
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
44
44
|
dependencies:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: protocol-hpack
|
@@ -70,6 +70,20 @@ dependencies:
|
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0.18'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: traces
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
type: :runtime
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
73
87
|
description:
|
74
88
|
email:
|
75
89
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|