aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-04-08 09:05:34 +0000
committerErlang/OTP <[email protected]>2010-04-08 09:05:34 +0000
commite84e8a42a1ad4025156b5ae8926575c7f08fadb6 (patch)
tree795353f9ae12895b14671fd3fbbab914ae7c083f /lib/ssl/test
parent899f040789a9a0cda2ee2b2555da6f6805308575 (diff)
parent0e502e41948e8835920ce82bb84405b141a00eaa (diff)
downloadotp-e84e8a42a1ad4025156b5ae8926575c7f08fadb6.tar.gz
otp-e84e8a42a1ad4025156b5ae8926575c7f08fadb6.tar.bz2
otp-e84e8a42a1ad4025156b5ae8926575c7f08fadb6.zip
Merge branch 'rb/ssl-transport-accept-fix' into dev
* rb/ssl-transport-accept-fix: Fix ssl:transport_accept/2 to return properly when socket is closed OTP-8560 rb/ssl-transport-accept-fix Fixed ssl:transport_accept/2 to return properly when socket is closed. Thanks to Rory Byrne.
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index d1ee2ed77f..faf62bd9e9 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -155,7 +155,7 @@ all(suite) ->
upgrade, upgrade_with_timeout, tcp_connect,
ipv6, ekeyfile, ecertfile, ecacertfile, eoptions, shutdown,
shutdown_write, shutdown_both, shutdown_error, ciphers,
- send_close, dh_params,
+ send_close, close_transport_accept, dh_params,
server_verify_peer_passive,
server_verify_peer_active, server_verify_peer_active_once,
server_verify_none_passive, server_verify_none_active,
@@ -729,6 +729,32 @@ send_close(Config) when is_list(Config) ->
gen_tcp:close(TcpS),
{error, _} = ssl:send(SslS, "Hello world"),
ssl_test_lib:close(Server).
+
+%%--------------------------------------------------------------------
+close_transport_accept(doc) ->
+ ["Tests closing ssl socket when waiting on ssl:transport_accept/1"];
+
+close_transport_accept(suite) ->
+ [];
+
+close_transport_accept(Config) when is_list(Config) ->
+ ServerOpts = ?config(server_opts, Config),
+ {_ClientNode, ServerNode, _Hostname} = ssl_test_lib:run_where(Config),
+
+ Port = 0,
+ Opts = [{active, false} | ServerOpts],
+ {ok, ListenSocket} = rpc:call(ServerNode, ssl, listen, [Port, Opts]),
+ spawn_link(fun() ->
+ test_server:sleep(?SLEEP),
+ rpc:call(ServerNode, ssl, close, [ListenSocket])
+ end),
+ case rpc:call(ServerNode, ssl, transport_accept, [ListenSocket]) of
+ {error, closed} ->
+ ok;
+ Other ->
+ exit({?LINE, Other})
+ end.
+
%%--------------------------------------------------------------------
dh_params(doc) ->
["Test to specify DH-params file in server."];