normal feafe07874 webrick: do not hang acceptor on slow TLS connections
OpenSSL::SSL::SSLSocket#accept may block indefinitely on clients
which negotiate the TCP connection, but fail (or are slow) to
negotiate the subsequent TLS handshake.  This prevents the
multi-threaded WEBrick server from accepting other connections.

Since the TLS handshake (via OpenSSL::SSL::SSLSocket#accept)
consists of normal read/write traffic over TCP, handle it in the
per-client thread, instead.

Furthermore, using non-blocking accept() is useful for non-TLS
sockets anyways because spurious wakeups are possible from
select(2).

* lib/webrick/server.rb (accept_client): use TCPServer#accept_nonblock
  and remove OpenSSL::SSL::SSLSocket#accept call
* lib/webrick/server.rb (start_thread): call OpenSSL::SSL::SSLSocket#accept
* test/webrick/test_ssl_server.rb (test_slow_connect): new test
  [ruby-core:83221] [Bug #14005]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-12 18:50:07 +00:00
..
2017-10-05 08:32:01 +00:00
2017-10-08 07:00:01 +00:00
2016-11-20 02:12:48 +00:00
2017-10-08 07:00:01 +00:00
2016-11-08 19:55:59 +00:00
2017-10-10 02:01:01 +00:00
2017-10-08 07:00:01 +00:00
2017-10-10 08:58:22 +00:00
2017-10-08 07:00:01 +00:00
2017-09-12 08:38:06 +00:00
2017-09-12 08:38:06 +00:00
2017-06-24 03:35:29 +00:00
2017-09-29 11:00:00 +00:00
2017-09-16 11:59:47 +00:00
2017-01-03 09:47:16 +00:00
2017-09-02 02:05:34 +00:00
2017-04-20 09:11:36 +00:00
2017-07-20 16:47:26 +00:00
2017-02-27 07:37:55 +00:00
2017-10-08 07:00:01 +00:00
2017-10-08 07:00:01 +00:00
2017-04-04 12:54:42 +00:00
2017-10-10 04:54:49 +00:00
2017-10-10 08:58:22 +00:00
2017-09-19 08:45:12 +00:00
2016-11-05 23:58:02 +00:00
2017-10-08 07:00:01 +00:00
2017-10-08 07:00:01 +00:00