[macruby-changes] [4234] MacRuby/trunk/lib/net/protocol.rb

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 17 13:12:57 PDT 2010


Revision: 4234
          http://trac.macosforge.org/projects/ruby/changeset/4234
Author:   martinlagardette at apple.com
Date:     2010-06-17 13:12:57 -0700 (Thu, 17 Jun 2010)
Log Message:
-----------
More fixes on net/protocol.rb

 - Fixes #340

Modified Paths:
--------------
    MacRuby/trunk/lib/net/protocol.rb

Modified: MacRuby/trunk/lib/net/protocol.rb
===================================================================
--- MacRuby/trunk/lib/net/protocol.rb	2010-06-17 01:03:18 UTC (rev 4233)
+++ MacRuby/trunk/lib/net/protocol.rb	2010-06-17 20:12:57 UTC (rev 4234)
@@ -51,7 +51,7 @@
       @io = io
       @read_timeout = 60
       @debug_output = nil
-      @rbuf = ''
+      @rbuf = ''.force_encoding('BINARY')
     end
 
     attr_reader :io
@@ -79,6 +79,7 @@
     def read(len, dest = '', ignore_eof = false)
       LOG "reading #{len} bytes..."
       read_bytes = 0
+      dest.force_encoding("BINARY")
       begin
         while read_bytes + @rbuf.bytesize < len
           dest << (s = rbuf_consume(@rbuf.bytesize))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100617/b2c85e51/attachment.html>


More information about the macruby-changes mailing list