protocol-http 0.28.1 → 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: a890dc1781e2ea174d0f534394aa9f22fe4324b8bdffca39960e3e6d74f555aa
4
- data.tar.gz: 44d2ff083bce62bd4f33c3310734b09565abda466c976cb84b92c984c25b9642
3
+ metadata.gz: 3bf15de4010337ee2c56c39bf6955ccfc7e6ae623426e31bface95cf15c8ef26
4
+ data.tar.gz: f8d4d30147c5402ca5003195b5b2d6e1688b47bf1a56ee23131b420952efac68
5
5
  SHA512:
6
- metadata.gz: 00cfd9adcdd9cf55455bc0e87a1729b721d7db85b858d83f3695e160c8541c76b719ed0d2d2f9b04eb458cc1d4b829a8e9f075cf4eab39275081b29152d28b3c
7
- data.tar.gz: b01e10053404dfa78f2d20ed6fa9fd320623efc2b3fe255ad30864153207d00ba58b0b829898c7f7b900a7506ec7ad0126b1aefc4da22a9811ed23401f6e6e73
6
+ metadata.gz: 236c830db8716243e3c9d7eec818c4b6a6b83ab399efe131b3475a4a1aac9e57dbe7ad809d7e0b5f4715c40371c8b2adbd7ebb6c16571ef5397fc209f08244d8
7
+ data.tar.gz: 35574f913cbaaee7f8ce06f8855843dd517f9d29ed898852c53c2ef12003fa0c62308ecd4e4dc3d04a7d34b4171ce64bb87b8d09779cfa69533f0da1c74b1be8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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.1"
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.1
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
- �+�tZ\f�~v��'g0G���_�`\@�t�f*p�(Mt-a�Ϥ�KdE�&��Ժ�C��<ݔ�<��X1��-�B� ������m��<�L]��6[4JJ���8�����z&��:��!�Kt�uZ���ڧf�1RV��A� e�i��{N ɀ��fT����>�ډAg ���^W[��ОؓbLj��(w�&����mA����_|�%_nV��-��߀CrG�γ���:�˧��d�Ȣr���Yk�F}re��=�� ܻ�GR�h�#�a&|]l����M��l�������q���.�^���MP����o�c(*�O3C騴q����I��c�<����+Z@�{H#�ϲ�DF�_��K'�LҖ�0
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�����Js"Q:&��2u[[�F}���u�����'�����`�ލ���,�@{��׷;���e����7�l�