protocol-http 0.35.0 → 0.36.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/http/body/buffered.rb +6 -0
- data/lib/protocol/http/body/readable.rb +10 -0
- data/lib/protocol/http/body/reader.rb +8 -0
- data/lib/protocol/http/body/wrapper.rb +4 -0
- data/lib/protocol/http/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: c826c247a1168e14cb7b5e0b216019b622574c801852cda2a4102f0a041d0694
|
4
|
+
data.tar.gz: 9661992d2f755a4743b8998889e84c3ff3c826769256ccfc8a48f697ddc0463b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c37d338e02b8b9dc2540be13bad83d37df2f07a6082f3ace8aadc3f7dd357c0b77bae9508bd7a7f2ff4aecf51ef99efa7a94fa09214a510f1616ca34b9f16c0
|
7
|
+
data.tar.gz: f3588dde1d19541c9e5ee9e8c3d13d7f42d7976419f7cf3d0af2e7451445619d79c7f897699e1d20fd5569afed5c7cf7ec9b15e6c5d6a05647422dff6a38b508
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -59,6 +59,8 @@ module Protocol
|
|
59
59
|
# Ensure that future reads return nil, but allow for rewinding.
|
60
60
|
def close(error = nil)
|
61
61
|
@index = @chunks.length
|
62
|
+
|
63
|
+
return nil
|
62
64
|
end
|
63
65
|
|
64
66
|
def clear
|
@@ -90,6 +92,10 @@ module Protocol
|
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
95
|
+
def discard
|
96
|
+
self.close
|
97
|
+
end
|
98
|
+
|
93
99
|
def write(chunk)
|
94
100
|
@chunks << chunk
|
95
101
|
end
|
@@ -133,6 +133,16 @@ module Protocol
|
|
133
133
|
Buffered.read(self)
|
134
134
|
end
|
135
135
|
|
136
|
+
# Discard the body as efficiently as possible.
|
137
|
+
#
|
138
|
+
# The default implementation simply reads all chunks until the body is empty.
|
139
|
+
#
|
140
|
+
# Useful for discarding the body when it is not needed, but preserving the underlying connection.
|
141
|
+
def discard
|
142
|
+
while chunk = self.read
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
136
146
|
def as_json(...)
|
137
147
|
{
|
138
148
|
class: self.class.name,
|
@@ -40,6 +40,14 @@ module Protocol
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
# Discard the body as efficiently as possible.
|
44
|
+
def discard
|
45
|
+
if body = @body
|
46
|
+
@body = nil
|
47
|
+
body.discard
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
43
51
|
# Buffer the entire request/response body.
|
44
52
|
# @returns [Reader] itself.
|
45
53
|
def buffered!
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -47,7 +47,7 @@ cert_chain:
|
|
47
47
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
48
48
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
49
49
|
-----END CERTIFICATE-----
|
50
|
-
date: 2024-09-
|
50
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
51
51
|
dependencies: []
|
52
52
|
description:
|
53
53
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|