aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-04-08 19:42:05 +0200
committerLoïc Hoguin <[email protected]>2013-04-08 19:42:05 +0200
commit708c0c0f0b9b8f94b987d28896057b6ef0ba0069 (patch)
tree9a18897b05548dc839fd7416d6d0465611f168c8
parent120d37cf752357a5b31ab8c94656fbfe2d2c7c35 (diff)
downloadranch-708c0c0f0b9b8f94b987d28896057b6ef0ba0069.tar.gz
ranch-708c0c0f0b9b8f94b987d28896057b6ef0ba0069.tar.bz2
ranch-708c0c0f0b9b8f94b987d28896057b6ef0ba0069.zip
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.
-rw-r--r--src/ranch_ssl.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ranch_ssl.erl b/src/ranch_ssl.erl
index 3155f25..3c2d6fb 100644
--- a/src/ranch_ssl.erl
+++ b/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 ->