Skip to content

Commit 57b00a9

Browse files
author
normal
committed
Revert "net/protocol: use binary string buffers"
Oops, not ready, yet (will work on this tomorrow :x). This reverts commit r61638 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4995c01 commit 57b00a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/net/protocol.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
8484
@read_timeout = read_timeout
8585
@continue_timeout = continue_timeout
8686
@debug_output = debug_output
87-
@rbuf = ''.b
87+
@rbuf = ''.dup
8888
end
8989

9090
attr_reader :io
@@ -114,7 +114,7 @@ def close
114114

115115
public
116116

117-
def read(len, dest = ''.b, ignore_eof = false)
117+
def read(len, dest = ''.dup, ignore_eof = false)
118118
LOG "reading #{len} bytes..."
119119
read_bytes = 0
120120
begin
@@ -134,7 +134,7 @@ def read(len, dest = ''.b, ignore_eof = false)
134134
dest
135135
end
136136

137-
def read_all(dest = ''.b)
137+
def read_all(dest = ''.dup)
138138
LOG 'reading all...'
139139
read_bytes = 0
140140
begin
@@ -193,7 +193,7 @@ def rbuf_fill
193193
def rbuf_consume(len)
194194
if len == @rbuf.size
195195
s = @rbuf
196-
@rbuf = ''.b
196+
@rbuf = ''.dup
197197
else
198198
s = @rbuf.slice!(0, len)
199199
end
@@ -340,7 +340,7 @@ def dot_stuff(s)
340340
end
341341

342342
def using_each_crlf_line
343-
@wbuf = ''.b
343+
@wbuf = ''.dup
344344
yield
345345
if not @wbuf.empty? # unterminated last line
346346
write0 dot_stuff(@wbuf.chomp) + "\r\n"

0 commit comments

Comments
 (0)