[前][次][番号順一覧][スレッド一覧]

ruby-changes:48094

From: normal <ko1@a...>
Date: Thu, 19 Oct 2017 06:45:44 +0900 (JST)
Subject: [ruby-changes:48094] normal:r60208 (trunk): webrick: fix up r60172 and revert r60189

normal	2017-10-19 06:45:34 +0900 (Thu, 19 Oct 2017)

  New Revision: 60208

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60208

  Log:
    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]

  Modified files:
    trunk/lib/webrick/server.rb
Index: lib/webrick/server.rb
===================================================================
--- lib/webrick/server.rb	(revision 60207)
+++ lib/webrick/server.rb	(revision 60208)
@@ -295,15 +295,12 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/server.rb#L295
           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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]