зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
4a375f3ef5
Коммит
3b1db7d319
|
@ -295,15 +295,12 @@ module WEBrick
|
||||||
end
|
end
|
||||||
if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately]
|
if sock.respond_to?(:sync_close=) && @config[:SSLStartImmediately]
|
||||||
WEBrick::Utils.timeout(@config[:RequestTimeout]) do
|
WEBrick::Utils.timeout(@config[:RequestTimeout]) do
|
||||||
|
begin
|
||||||
# we must call OpenSSL::SSL::SSLSocket#accept_nonblock until
|
sock.accept # OpenSSL::SSL::SSLSocket#accept
|
||||||
# it stop returning wait_* symbols:
|
rescue Errno::ECONNRESET, Errno::ECONNABORTED,
|
||||||
case ret = sock.accept_nonblock(exception: false)
|
Errno::EPROTO, Errno::EINVAL
|
||||||
when :wait_readable, :wait_writable
|
return
|
||||||
sock.to_io.__send__(ret)
|
end
|
||||||
else
|
|
||||||
break
|
|
||||||
end while true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
call_callback(:AcceptCallback, sock)
|
call_callback(:AcceptCallback, sock)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче