Project

General

Profile

0001-lib-net-protocol.rb-avoid-exceptions-in-rbuf_fill.patch

normalperson (Eric Wong), 04/07/2011 11:48 AM

View differences:

lib/net/protocol.rb
20 20

  
21 21
require 'socket'
22 22
require 'timeout'
23
require 'io/wait'
23 24

  
24 25
module Net # :nodoc:
25 26

  
......
135 136
    BUFSIZE = 1024 * 16
136 137

  
137 138
    def rbuf_fill
139
      if @io.respond_to?(:wait)
140
        false == @io.wait(@read_timeout) and raise Timeout::Error
141
      end
138 142
      begin
139 143
        @rbuf << @io.read_nonblock(BUFSIZE)
140 144
      rescue IO::WaitReadable
141
-