ruby/test/webrick
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
..
.htaccess
test_cgi.rb webrick: filter out HTTP_PROXY for CGIHandler 2016-07-22 16:43:12 +00:00
test_config.rb Delay Utils.getservername until needed. 2016-12-07 12:59:48 +00:00
test_cookie.rb * lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791] 2016-09-27 03:17:47 +00:00
test_do_not_reverse_lookup.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_filehandler.rb leakchecker.rb: remove temporary measure 2016-01-05 06:09:17 +00:00
test_htmlutils.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_httpauth.rb lib/webrick/log.rb: sanitize any type of logs 2017-09-14 11:16:23 +00:00
test_httpproxy.rb webrick: don't use OpenSSL::TestUtils from webrick tests 2016-11-29 15:48:47 +00:00
test_httprequest.rb Multiple values X-Forwarded-Proto in webrick 2016-06-21 10:32:26 +00:00
test_httpresponse.rb * lib/webrick/httpresponse.rb: Move error_body to method. It allow to 2016-03-29 03:45:32 +00:00
test_https.rb webrick: fix SNI support 2017-07-18 01:59:28 +00:00
test_httpserver.rb leakchecker.rb: remove temporary measure 2016-01-05 06:09:17 +00:00
test_httputils.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_httpversion.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_server.rb Add frozen_string_literal: false for all files 2015-12-16 05:07:31 +00:00
test_ssl_server.rb webrick: do not hang acceptor on slow TLS connections 2017-10-12 18:50:07 +00:00
test_utils.rb Fix a typo. 2017-09-13 02:21:02 +00:00
utils.rb Import gemspec 2017-04-25 09:23:04 +00:00
webrick.cgi webrick: filter out HTTP_PROXY for CGIHandler 2016-07-22 16:43:12 +00:00
webrick_long_filename.cgi * test/webrick/webrick.cgi: Don't use debug mode. 2014-11-09 20:58:22 +00:00