aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test/ssl_test_lib.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2018-11-06 09:35:45 +0100
committerIngela Anderton Andin <[email protected]>2018-11-06 09:35:45 +0100
commite7e3f59e5350bb39f57f0403f3c78443c58039b1 (patch)
treeba87b01ee86e26d0fef001b4aed4074edda5caa3 /lib/ssl/test/ssl_test_lib.erl
parent8f4eb75f5a8d3f76d4e5e1c7d56024c727358ac7 (diff)
parente64822b68ec1f06481af5ea776273b6dbb526d63 (diff)
downloadotp-e7e3f59e5350bb39f57f0403f3c78443c58039b1.tar.gz
otp-e7e3f59e5350bb39f57f0403f3c78443c58039b1.tar.bz2
otp-e7e3f59e5350bb39f57f0403f3c78443c58039b1.zip
Merge branch 'ingela/ssl/controlling-process-allowed-on-transport-accept-socket' into maint
* ingela/ssl/controlling-process-allowed-on-transport-accept-socket: ssl: controlling_process should be allowed on transpor_accept sockets along with handshake
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r--lib/ssl/test/ssl_test_lib.erl25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 289793bac8..8a2f0824fb 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -204,6 +204,14 @@ start_server_transport_abuse_socket(Args) ->
Result
end.
+start_server_transport_control(Args) ->
+ Result = spawn_link(?MODULE, transport_switch_control, [Args]),
+ receive
+ {listen, up} ->
+ Result
+ end.
+
+
transport_accept_abuse(Opts) ->
Node = proplists:get_value(node, Opts),
Port = proplists:get_value(port, Opts),
@@ -220,6 +228,23 @@ transport_accept_abuse(Opts) ->
_ = rpc:call(Node, ssl, handshake, [AcceptSocket, infinity]),
Pid ! {self(), ok}.
+
+transport_switch_control(Opts) ->
+ Node = proplists:get_value(node, Opts),
+ Port = proplists:get_value(port, Opts),
+ Options = proplists:get_value(options, Opts),
+ Pid = proplists:get_value(from, Opts),
+ Transport = proplists:get_value(transport, Opts, ssl),
+ ct:log("~p:~p~nssl:listen(~p, ~p)~n", [?MODULE,?LINE, Port, Options]),
+ {ok, ListenSocket} = rpc:call(Node, Transport, listen, [Port, Options]),
+ Pid ! {listen, up},
+ send_selected_port(Pid, Port, ListenSocket),
+ {ok, AcceptSocket} = rpc:call(Node, ssl, transport_accept,
+ [ListenSocket]),
+ ok = rpc:call(Node, ssl, controlling_process, [AcceptSocket, self()]),
+ Pid ! {self(), ok}.
+
+
remove_close_msg(0) ->
ok;
remove_close_msg(ReconnectTimes) ->