protocol-http1 0.25.0 → 0.26.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 +0 -0
- data/lib/protocol/http1/connection.rb +29 -20
- data/lib/protocol/http1/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -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: 868c9501fb3b9a49db11985bb2807cdbfe9ed6c5337c0e01fabd5f7f360874e0
|
4
|
+
data.tar.gz: 91a076094374bbdd0b42938e7d6dcaaf8cd24170d21da0043be63e4ebe719ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e0e59673d857dd2e37bcf8b9b1ef607d9490445c13bd515530aabd04dd75f93eca1055a3168384b0fe47f3197494b6be544e3e4f767d55456a4808e090e738
|
7
|
+
data.tar.gz: ea52162a1762c35cf7ea76630c51f589f52385baf5819b7a4010cec1a341e0ec153ffba1970bead118ebf7e309e63d400a2bc7e81195cd8c1d547c924c4c83d9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -91,8 +91,8 @@ module Protocol
|
|
91
91
|
# │ ▼ └───┬────┘ ▼
|
92
92
|
# │ ┌──────────┐ │ ┌──────────┐
|
93
93
|
# │ │ half │ │ │ half │
|
94
|
-
# │ │ closed │ │
|
95
|
-
# │ │ (remote) │ │
|
94
|
+
# │ │ closed │ │ send R / │ closed │
|
95
|
+
# │ │ (remote) │ │ recv R │ (local) │
|
96
96
|
# │ └────┬─────┘ │ └─────┬────┘
|
97
97
|
# │ │ │ │
|
98
98
|
# │ │ send ES / │ recv ES / │
|
@@ -104,7 +104,8 @@ module Protocol
|
|
104
104
|
# persistent └────────┘
|
105
105
|
# ```
|
106
106
|
#
|
107
|
-
# - `ES`: the body was fully received or sent (end of stream)
|
107
|
+
# - `ES`: the body was fully received or sent (end of stream).
|
108
|
+
# - `R`: the connection was closed unexpectedly (reset).
|
108
109
|
#
|
109
110
|
# State transition methods use a trailing "!".
|
110
111
|
attr_accessor :state
|
@@ -176,14 +177,15 @@ module Protocol
|
|
176
177
|
# @return [IO] the underlying non-blocking IO.
|
177
178
|
def hijack!
|
178
179
|
@persistent = false
|
179
|
-
stream = @stream
|
180
180
|
|
181
|
-
@stream
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
181
|
+
if stream = @stream
|
182
|
+
@stream = nil
|
183
|
+
stream.flush
|
184
|
+
|
185
|
+
self.closed!
|
186
|
+
|
187
|
+
return stream
|
188
|
+
end
|
187
189
|
end
|
188
190
|
|
189
191
|
def close_read
|
@@ -193,10 +195,15 @@ module Protocol
|
|
193
195
|
end
|
194
196
|
|
195
197
|
# Close the connection and underlying stream.
|
196
|
-
def close
|
198
|
+
def close(error = nil)
|
197
199
|
@persistent = false
|
198
|
-
|
199
|
-
|
200
|
+
|
201
|
+
if stream = @stream
|
202
|
+
@stream = nil
|
203
|
+
stream.close
|
204
|
+
end
|
205
|
+
|
206
|
+
self.closed!(error)
|
200
207
|
end
|
201
208
|
|
202
209
|
def open!
|
@@ -518,13 +525,15 @@ module Protocol
|
|
518
525
|
self.send_end_stream!
|
519
526
|
end
|
520
527
|
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
+
# Transition to the closed state.
|
529
|
+
#
|
530
|
+
# If no error occurred, and the connection is persistent, this will immediately transition to the idle state.
|
531
|
+
#
|
532
|
+
# @parameter error [Exxception] the error that caused the connection to close.
|
533
|
+
def closed!(error = nil)
|
534
|
+
if @persistent and !error
|
535
|
+
# If there was no error, and the connection is persistent, we can reuse it:
|
536
|
+
@state = :idle
|
528
537
|
else
|
529
538
|
@state = :closed
|
530
539
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -42,7 +42,7 @@ cert_chain:
|
|
42
42
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
43
43
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
44
44
|
-----END CERTIFICATE-----
|
45
|
-
date: 2024-09-
|
45
|
+
date: 2024-09-23 00:00:00.000000000 Z
|
46
46
|
dependencies:
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: protocol-http
|
metadata.gz.sig
CHANGED
Binary file
|