net-protocol 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/net/protocol.rb +6 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dddd9155f88e3e664a77ae33aed748ce833c114871dfab60e2be632214a2e063
|
4
|
+
data.tar.gz: 45ea621c80a7cef086d1094502c47aa60c0320ab585a8dd0e9c4684de2be5608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa55cb8a2eb4d6a14815dc9367c5787aea13ce9f6127298aa41614ffdf1ac4b421a4d6e6da2ad40740c99ec6a18b7541fd9e194f2bfd3e093e1223683fa8e34d
|
7
|
+
data.tar.gz: e77247d5a85f3adcf618f47b8cf3ef9b0be28f6b988ae48de43c17796d9d6c2bff6fdb083784c636f6a122c4bfaddde722fefa28f46837bc4f8358f2a63c41f2
|
data/lib/net/protocol.rb
CHANGED
@@ -26,7 +26,7 @@ require 'io/wait'
|
|
26
26
|
module Net # :nodoc:
|
27
27
|
|
28
28
|
class Protocol #:nodoc: internal use only
|
29
|
-
VERSION = "0.2.
|
29
|
+
VERSION = "0.2.1"
|
30
30
|
|
31
31
|
private
|
32
32
|
def Protocol.protocol_param(name, val)
|
@@ -120,6 +120,7 @@ module Net # :nodoc:
|
|
120
120
|
@continue_timeout = continue_timeout
|
121
121
|
@debug_output = debug_output
|
122
122
|
@rbuf = ''.b
|
123
|
+
@rbuf_empty = true
|
123
124
|
@rbuf_offset = 0
|
124
125
|
end
|
125
126
|
|
@@ -156,7 +157,7 @@ module Net # :nodoc:
|
|
156
157
|
read_bytes = 0
|
157
158
|
begin
|
158
159
|
while read_bytes + rbuf_size < len
|
159
|
-
if s =
|
160
|
+
if s = rbuf_consume_all
|
160
161
|
read_bytes += s.bytesize
|
161
162
|
dest << s
|
162
163
|
end
|
@@ -177,7 +178,7 @@ module Net # :nodoc:
|
|
177
178
|
read_bytes = 0
|
178
179
|
begin
|
179
180
|
while true
|
180
|
-
if s =
|
181
|
+
if s = rbuf_consume_all
|
181
182
|
read_bytes += s.bytesize
|
182
183
|
dest << s
|
183
184
|
end
|
@@ -249,18 +250,8 @@ module Net # :nodoc:
|
|
249
250
|
@rbuf.bytesize - @rbuf_offset
|
250
251
|
end
|
251
252
|
|
252
|
-
|
253
|
-
|
254
|
-
# string once rbuf_fill has been called again
|
255
|
-
def rbuf_consume_all_shareable!
|
256
|
-
@rbuf_empty = true
|
257
|
-
buf = if @rbuf_offset == 0
|
258
|
-
@rbuf
|
259
|
-
else
|
260
|
-
@rbuf.byteslice(@rbuf_offset..-1)
|
261
|
-
end
|
262
|
-
@rbuf_offset = @rbuf.bytesize
|
263
|
-
buf
|
253
|
+
def rbuf_consume_all
|
254
|
+
rbuf_consume if rbuf_size > 0
|
264
255
|
end
|
265
256
|
|
266
257
|
def rbuf_consume(len = nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timeout
|