ruby-changes:49525
From: normal <ko1@a...>
Date: Sat, 6 Jan 2018 18:23:48 +0900 (JST)
Subject: [ruby-changes:49525] normal:r61640 (trunk): Revert "net/protocol: use binary string buffers"
normal 2018-01-06 18:23:43 +0900 (Sat, 06 Jan 2018) New Revision: 61640 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61640 Log: Revert "net/protocol: use binary string buffers" Oops, not ready, yet (will work on this tomorrow :x). This reverts commit r61638 Modified files: trunk/lib/net/protocol.rb Index: lib/net/protocol.rb =================================================================== --- lib/net/protocol.rb (revision 61639) +++ lib/net/protocol.rb (revision 61640) @@ -84,7 +84,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L84 @read_timeout = read_timeout @continue_timeout = continue_timeout @debug_output = debug_output - @rbuf = ''.b + @rbuf = ''.dup end attr_reader :io @@ -114,7 +114,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L114 public - def read(len, dest = ''.b, ignore_eof = false) + def read(len, dest = ''.dup, ignore_eof = false) LOG "reading #{len} bytes..." read_bytes = 0 begin @@ -134,7 +134,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L134 dest end - def read_all(dest = ''.b) + def read_all(dest = ''.dup) LOG 'reading all...' read_bytes = 0 begin @@ -193,7 +193,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L193 def rbuf_consume(len) if len == @rbuf.size s = @rbuf - @rbuf = ''.b + @rbuf = ''.dup else s = @rbuf.slice!(0, len) end @@ -340,7 +340,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/net/protocol.rb#L340 end def using_each_crlf_line - @wbuf = ''.b + @wbuf = ''.dup yield if not @wbuf.empty? # unterminated last line write0 dot_stuff(@wbuf.chomp) + "\r\n" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/