aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-11-29 14:58:44 +0100
committerBjörn-Egil Dahlberg <[email protected]>2012-12-06 14:46:54 +0100
commita1bd47a9e8b562bdc8dca741bbd9e1bc4c0f9b2b (patch)
treeb9557305ec4e2d672088dc850c487f0af3367dea /lib/ssl/src
parentd5de2e1ffd6403f5d7ec62e6ce8da508e1cb1239 (diff)
downloadotp-a1bd47a9e8b562bdc8dca741bbd9e1bc4c0f9b2b.tar.gz
otp-a1bd47a9e8b562bdc8dca741bbd9e1bc4c0f9b2b.tar.bz2
otp-a1bd47a9e8b562bdc8dca741bbd9e1bc4c0f9b2b.zip
ssl: Timeout handling changed so that the fsm-process will terminate if the ssl:ssl_accept/[2,3] or ssl:connect/[3,4] timeout expires.
Add missing function clause to handle timeout during handshake. The missing clause had the effect that the timeout was wrongly discarded. Also add an extra test case for the recv timeout in addition to the one in ssl_packet_SUITE. The missing functions clause was introduced in 8a789189. This commit changed the timeout implementation, the previous implememtation could cause other type of problems as the timeout was client side.
Diffstat (limited to 'lib/ssl/src')
-rw-r--r--lib/ssl/src/ssl_connection.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index eb71bc61e9..c5280d26f0 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -981,8 +981,12 @@ handle_info({'DOWN', MonitorRef, _, _, _}, _,
handle_info(allow_renegotiate, StateName, State) ->
{next_state, StateName, State#state{allow_renegotiate = true}, get_timeout(State)};
-
-handle_info({cancel_start_or_recv, RecvFrom}, connection = StateName, #state{start_or_recv_from = RecvFrom} = State) ->
+
+handle_info({cancel_start_or_recv, StartFrom}, StateName, #state{renegotiation = {false, first}} = State) when StateName =/= connection ->
+ gen_fsm:reply(StartFrom, {error, timeout}),
+ {stop, {shutdown, user_timeout}, State};
+
+handle_info({cancel_start_or_recv, RecvFrom}, StateName, #state{start_or_recv_from = RecvFrom} = State) ->
gen_fsm:reply(RecvFrom, {error, timeout}),
{next_state, StateName, State#state{start_or_recv_from = undefined}, get_timeout(State)};