diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-18 21:45:34 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-18 21:45:34 +0000 |
commit | f700a7f191a882f3f3532d95c7db9a6c9ed769fb (patch) | |
tree | 1c1e61d8299259c7f772b3215e98d370bd4e15d9 /lib/webrick | |
parent | 42c01a1de153952ee112843bab016a4529e8997d (diff) | |
download | ruby-f700a7f191a882f3f3532d95c7db9a6c9ed769fb.tar.gz |
webrick: fix up r60172 and revert r60189
Thanks to MSP-Greg (Greg L) for helping with this.
* lib/webrick/server.rb (start_thread): ignore ECONNRESET, ECONNABORTED,
EPROTO, and EINVAL on TLS negotiation errors the same way they
were ignored before r60172 in the accept_client method of the
main acceptor thread.
[Bug #14013] [Bug #14005]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick')
-rw-r--r-- | lib/webrick/server.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb index 2d678273e5..0c853b240c 100644 --- a/lib/webrick/server.rb +++ b/lib/webrick/server.rb @@ -295,15 +295,12 @@ module WEBrick end if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately] WEBrick::Utils.timeout(@config[:RequestTimeout]) do - - # we must call OpenSSL::SSL::SSLSocket#accept_nonblock until - # it stop returning wait_* symbols: - case ret = sock.accept_nonblock(exception: false) - when :wait_readable, :wait_writable - sock.to_io.__send__(ret) - else - break - end while true + begin + sock.accept # OpenSSL::SSL::SSLSocket#accept + rescue Errno::ECONNRESET, Errno::ECONNABORTED, + Errno::EPROTO, Errno::EINVAL + return + end end end call_callback(:AcceptCallback, sock) |