protocol-http 0.28.0 → 0.28.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http/body/reader.rb +3 -3
- data/lib/protocol/http/body/stream.rb +18 -5
- data/lib/protocol/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bf15de4010337ee2c56c39bf6955ccfc7e6ae623426e31bface95cf15c8ef26
|
4
|
+
data.tar.gz: f8d4d30147c5402ca5003195b5b2d6e1688b47bf1a56ee23131b420952efac68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 236c830db8716243e3c9d7eec818c4b6a6b83ab399efe131b3475a4a1aac9e57dbe7ad809d7e0b5f4715c40371c8b2adbd7ebb6c16571ef5397fc209f08244d8
|
7
|
+
data.tar.gz: 35574f913cbaaee7f8ce06f8855843dd517f9d29ed898852c53c2ef12003fa0c62308ecd4e4dc3d04a7d34b4171ce64bb87b8d09779cfa69533f0da1c74b1be8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -41,13 +41,13 @@ module Protocol
|
|
41
41
|
end
|
42
42
|
|
43
43
|
# Buffer the entire request/response body.
|
44
|
-
# @returns [
|
44
|
+
# @returns [Reader] itself.
|
45
45
|
def buffered!
|
46
46
|
if @body
|
47
47
|
@body = @body.finish
|
48
|
-
|
49
|
-
return @body
|
50
48
|
end
|
49
|
+
|
50
|
+
return self
|
51
51
|
end
|
52
52
|
|
53
53
|
# Write the body of the response to the given file path.
|
@@ -89,12 +89,25 @@ module Protocol
|
|
89
89
|
# Will avoid reading from the underlying stream if there is buffered data available.
|
90
90
|
#
|
91
91
|
# @parameter length [Integer] The maximum number of bytes to read.
|
92
|
-
def read_partial(length = nil)
|
92
|
+
def read_partial(length = nil, buffer = nil)
|
93
93
|
if @buffer
|
94
|
-
|
94
|
+
if buffer
|
95
|
+
buffer.replace(@buffer)
|
96
|
+
else
|
97
|
+
buffer = @buffer
|
98
|
+
end
|
95
99
|
@buffer = nil
|
96
100
|
else
|
97
|
-
|
101
|
+
if chunk = read_next
|
102
|
+
if buffer
|
103
|
+
buffer.replace(chunk)
|
104
|
+
else
|
105
|
+
buffer = chunk
|
106
|
+
end
|
107
|
+
else
|
108
|
+
buffer&.clear
|
109
|
+
buffer = nil
|
110
|
+
end
|
98
111
|
end
|
99
112
|
|
100
113
|
if buffer and length
|
@@ -111,8 +124,8 @@ module Protocol
|
|
111
124
|
end
|
112
125
|
|
113
126
|
# Similar to {read_partial} but raises an `EOFError` if the stream is at EOF.
|
114
|
-
def readpartial(length)
|
115
|
-
read_partial(length) or raise EOFError, "End of file reached!"
|
127
|
+
def readpartial(length, buffer = nil)
|
128
|
+
read_partial(length, buffer) or raise EOFError, "End of file reached!"
|
116
129
|
end
|
117
130
|
|
118
131
|
# Read data from the stream without blocking if possible.
|
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.28.
|
4
|
+
version: 0.28.2
|
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-
|
50
|
+
date: 2024-08-21 00:00:00.000000000 Z
|
51
51
|
dependencies: []
|
52
52
|
description:
|
53
53
|
email:
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
��Z
|
1
|
+
DgV�-��: ��P�#yn��k��WPw����(�8݁��ֵB�=��� >[����wv���s6��E���c$��}G��e�N\�� ����^�D�:�Jm�4+\0���<�ק7�1@�wUO���^�ӧ~�.(w�؈����=�l_,��a�Z�����J�s�"�Q:&��2u�[[�F�}���u�����'�����`�ލ���,�@{��;���e����7�l�
|