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

ruby-changes:36150

From: akr <ko1@a...>
Date: Sun, 2 Nov 2014 00:56:33 +0900 (JST)
Subject: [ruby-changes:36150] akr:r48231 (trunk): ignore_ssl_accept_error option is changed to ignore_listener_error.

akr	2014-11-02 00:56:29 +0900 (Sun, 02 Nov 2014)

  New Revision: 48231

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

  Log:
    ignore_ssl_accept_error option is changed to ignore_listener_error.

  Modified files:
    trunk/test/openssl/test_ssl_session.rb
    trunk/test/openssl/utils.rb
Index: test/openssl/utils.rb
===================================================================
--- test/openssl/utils.rb	(revision 48230)
+++ test/openssl/utils.rb	(revision 48231)
@@ -240,7 +240,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOP https://github.com/ruby/ruby/blob/trunk/test/openssl/utils.rb#L240
       ssl.close rescue nil
     end
 
-    def server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
+    def server_loop(ctx, ssls, stop_pipe_r, ignore_listener_error, server_proc, threads)
       loop do
         ssl = nil
         begin
@@ -250,7 +250,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOP https://github.com/ruby/ruby/blob/trunk/test/openssl/utils.rb#L250
           end
           ssl = ssls.accept
         rescue OpenSSL::SSL::SSLError
-          if ignore_ssl_accept_error
+          if ignore_listener_error
             retry
           else
             raise
@@ -263,13 +263,16 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOP https://github.com/ruby/ruby/blob/trunk/test/openssl/utils.rb#L263
         threads << th
       end
     rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK, Errno::ECONNRESET
+      if !ignore_listener_error
+        raise
+      end
     end
 
     def start_server(port0, verify_mode, start_immediately, args = {}, &block)
       IO.pipe {|stop_pipe_r, stop_pipe_w|
         ctx_proc = args[:ctx_proc]
         server_proc = args[:server_proc]
-        ignore_ssl_accept_error = args.fetch(:ignore_ssl_accept_error, true)
+        ignore_listener_error = args.fetch(:ignore_listener_error, true)
         server_proc ||= method(:readwrite_loop)
 
         store = OpenSSL::X509::Store.new
@@ -301,7 +304,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOP https://github.com/ruby/ruby/blob/trunk/test/openssl/utils.rb#L304
         begin
           server = Thread.new do
             begin
-              server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
+              server_loop(ctx, ssls, stop_pipe_r, ignore_listener_error, server_proc, threads)
             ensure
               tcps.close
             end
Index: test/openssl/test_ssl_session.rb
===================================================================
--- test/openssl/test_ssl_session.rb	(revision 48230)
+++ test/openssl/test_ssl_session.rb	(revision 48231)
@@ -292,7 +292,7 @@ __EOS__ https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl_session.rb#L292
       # any resulting value is OK (ignored)
     }
 
-    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ignore_ssl_accept_error: false) do |server, port|
+    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ignore_listener_error: false) do |server, port|
       sock = TCPSocket.new("127.0.0.1", port)
       begin
         ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
@@ -350,7 +350,7 @@ __EOS__ https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl_session.rb#L350
       c.session_cache_stats
       readwrite_loop(c, ssl)
     }
-    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ctx_proc: ctx_proc, server_proc: server_proc, ignore_ssl_accept_error: false) do |server, port|
+    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ctx_proc: ctx_proc, server_proc: server_proc, ignore_listener_error: false) do |server, port|
       last_client_session = nil
       3.times do
         sock = TCPSocket.new("127.0.0.1", port)

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

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