[erlang-bugs] SSL accept timeout broken in R15B03?

Ingela Anderton Andin <>
Thu Nov 29 11:16:06 CET 2012


Hi Steve!

There is a missing function clause to handle the ssl:ssl_accept-timeout 
so alas it was treated as a canceled timeout. I failed to realize that
we needed a special test case for the accept case when I solved the
problem with client side timeouts for ssl:recv. The client side timeout
is a problem for accept/connect too and is solved by the same mechanism
with the only difference being the following clause:


index 87cf49d..102dd4a 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1001,6 +1001,10 @@ handle_info({cancel_start_or_recv, RecvFrom}, 
connection = StateName, #state{sta
      gen_fsm:reply(RecvFrom, {error, timeout}),
      {next_state, StateName, State#state{start_or_recv_from = 
undefined}, get_timeout(State)};

+handle_info({cancel_start_or_recv, RecvFrom}, StateName, State) when 
connection =/= StateName->
+    gen_fsm:reply(RecvFrom, {error, timeout}),
+    {next_state, StateName, State#state{start_or_recv_from = 
undefined}, get_timeout(State)};
+
  handle_info({cancel_start_or_recv, _RecvFrom}, StateName, State) ->
      {next_state, StateName, State, get_timeout(State)};

Thank you for reporting this and I will make your your test into a test 
case.

Regards Ingela Erlang/OTP team - Ericsson AB


Steve Vinoski wrote:
> 
> 
> On Wed, Nov 28, 2012 at 1:27 PM, Steve Vinoski < 
> <mailto:>> wrote:
> 
>     In trying to verify Yaws under R15B03 I noticed it was failing its
>     SSL accept timeout test, which works fine under previous Erlang/OTP
>     versions.
> 
>     Compile this module and run its start/0 function to reproduce the
>     problem:
> 
>     https://gist.github.com/4163038
> 
>     The test does an SSL accept with a timeout, then does a TCP connect
>     from a client which of course won't complete the handshake and
>     should cause the timeout to kick in. Unfortunately the timeout
>     doesn't occur.
> 
> 
> Running a git bisect in the otp repo shows commit 8a789189 to be the 
> culprit.
> 
> --steve 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs



More information about the erlang-bugs mailing list