protocol-http 0.28.0 → 0.28.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4233cfc38541f0e482f7d006612dc04ae21b78da6f0950053dc664e8c195f111
4
- data.tar.gz: '09849b7b28caf42edcc730e93047c87e8e1bdd7f53022d7a4295b89936b299f4'
3
+ metadata.gz: 3bf15de4010337ee2c56c39bf6955ccfc7e6ae623426e31bface95cf15c8ef26
4
+ data.tar.gz: f8d4d30147c5402ca5003195b5b2d6e1688b47bf1a56ee23131b420952efac68
5
5
  SHA512:
6
- metadata.gz: 6f034458655ec357fa9713126017e799e4750fdf36ce92114b70cb6eb24191c5390495c1b8b70b1114abdde557ca1a8b55074178ed926979030eb526b6ea3b2f
7
- data.tar.gz: 0d5d6d55398952e449d211ee589bf6ae59dbee661a1c08b702f4a6f445c3907c9838f0270aacc11851c2d393eb9edd58b69334577dc08c407f8b2948ba176aeb
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 [Readable] the buffered body.
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
- buffer = @buffer
94
+ if buffer
95
+ buffer.replace(@buffer)
96
+ else
97
+ buffer = @buffer
98
+ end
95
99
  @buffer = nil
96
100
  else
97
- buffer = read_next
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.
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.28.0"
8
+ VERSION = "0.28.2"
9
9
  end
10
10
  end
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.0
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-07-19 00:00:00.000000000 Z
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.F�T
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�