Project

General

Profile

Bug #14013 ยป webrick_ssl.patch

MSP-Greg (Greg L), 10/18/2017 07:28 PM

View differences:

lib/webrick/server.rb
297 297
            WEBrick::Utils.timeout(@config[:RequestTimeout]) do
298 298

  
299 299
              # we must call OpenSSL::SSL::SSLSocket#accept_nonblock until
300
              # it stop returning wait_* symbols:
301
              case ret = sock.accept_nonblock(exception: false)
302
              when :wait_readable, :wait_writable
303
                sock.to_io.__send__(ret)
304
              else
305
                break
306
              end while true
300
              # it stop returning wait_* symbols or wait_* methods return !nil:
301
              begin
302
                ret = sock.accept_nonblock(exception: false)
303
                if ret == :wait_readable || ret == :wait_writable
304
                  break unless sock.to_io.__send__(ret).nil?
305
                end
306
              end until ret == sock
307 307
            end
308 308
          end
309 309
          call_callback(:AcceptCallback, sock)