Browse Source

Never tries to ssl_accept with an infinity timeout

This should be an acceptable temporary solution to the ssl_accept
problem. We no longer have to worry about acceptors being dead
because ssl_accept never returned.
Loïc Hoguin 12 years ago
parent
commit
708c0c0f0b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/ranch_ssl.erl

+ 5 - 0
src/ranch_ssl.erl

@@ -218,8 +218,13 @@ close(Socket) ->
 
 %% Internal.
 
+%% This call always times out, either because a numeric timeout value
+%% was given, or because we've decided to use 5000ms instead of infinity.
+%% This value should be reasonable enough for the moment.
 -spec ssl_accept(ssl:sslsocket(), timeout())
 	-> {ok, ssl:sslsocket()} | {error, {ssl_accept, atom()}}.
+ssl_accept(Socket, infinity) ->
+	ssl_accept(Socket, 5000);
 ssl_accept(Socket, Timeout) ->
 	case ssl:ssl_accept(Socket, Timeout) of
 		ok ->