Permalink
Browse files

timeout for SSL close hang

  • Loading branch information...
1 parent f21ff09 commit b5c843552ad9b554af5eeaee7101446c2bc235dd Minsu Choi committed Jun 6, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/ssl/src/ssl_connection.erl
View
3 lib/ssl/src/ssl_connection.erl
@@ -99,6 +99,7 @@
#'DHParameter'{prime = ?DEFAULT_DIFFIE_HELLMAN_PRIME,
base = ?DEFAULT_DIFFIE_HELLMAN_GENERATOR}).
-define(WAIT_TO_ALLOW_RENEGOTIATION, 12000).
+-define(CLOSE_TIMEOUT, 5000).
-type state_name() :: hello | abbreviated | certify | cipher | connection.
-type gen_fsm_state_return() :: {next_state, state_name(), #state{}} |
@@ -2347,7 +2348,7 @@ workaround_transport_delivery_problems(Socket, Transport, _) ->
%% get a correct error message.
inet:setopts(Socket, [{active, false}]),
Transport:shutdown(Socket, write),
- Transport:recv(Socket, 0).
+ Transport:recv(Socket, 0, ?CLOSE_TIMEOUT).
linux_workaround_transport_delivery_problems(#alert{level = ?FATAL}, Socket) ->
case os:type() of

0 comments on commit b5c8435

Please sign in to comment.