lib/rumai/ixp/transport.rb in rumai-3.3.1 vs lib/rumai/ixp/transport.rb in rumai-4.0.0

- old
+ new

@@ -325,18 +325,18 @@ def write content raise 'cannot write to a closed stream' if @closed raise 'cannot write to a directory' if @stat.directory? data = content.to_s - limit = data.length + @pos + limit = data.bytesize + @pos while @pos < limit - chunk = data[@pos, @msize] + chunk = data.byteslice(@pos, @msize) req = Twrite.new( :fid => @fid, :offset => @pos, - :count => chunk.length, + :count => chunk.bytesize, :data => chunk ) rsp = @agent.talk(req) @pos += rsp.count