Skip to content

Commit

Permalink
Never tries to ssl_accept with an infinity timeout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
essen committed Apr 8, 2013
1 parent 120d37c commit 708c0c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ranch_ssl.erl
Expand Up @@ -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 ->
Expand Down

1 comment on commit 708c0c0

@rambocoder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Please sign in to comment.