Project

General

Profile

Bug #806 ยป protocol.patch

Patch to make Net::Protocol faster - tenderlovemaking (Aaron Patterson), 12/02/2008 03:27 AM

View differences:

lib/net/protocol.rb (working copy)
BUFSIZE = 1024 * 16
def rbuf_fill
timeout(@read_timeout) {
@rbuf << @io.sysread(BUFSIZE)
}
begin
@rbuf << @io.read_nonblock(BUFSIZE)
rescue Errno::EWOULDBLOCK
if IO.select([@io], nil, nil, @read_timeout)
@rbuf << @io.read_nonblock(BUFSIZE)
else
raise Timeout::TimeoutError
end
end
end
def rbuf_consume(len)
    (1-1/1)