Permalink
Browse files

fix ssl acceptor drain

elli when configured to use SSL/TLS will run out of acceptors after
MinAcceptors failed SSL/TLS handshakes.
This patch takes care of ssl:ssl_accept/2 returning {error, closed} or
{error, {tls_alert, _}}.
  • Loading branch information...
1 parent 49cd96e commit baadac874d208b48199d5ce013832302427043b7 Stefan Grundmann committed Apr 15, 2014
Showing with 4 additions and 0 deletions.
  1. +2 −0 src/elli_http.erl
  2. +2 −0 src/elli_tcp.erl
View
@@ -39,6 +39,8 @@ accept(Server, ListenSocket, Options, Callback) ->
?MODULE:accept(Server, ListenSocket, Options, Callback);
{error, econnaborted} ->
?MODULE:accept(Server, ListenSocket, Options, Callback);
+ {error, {tls_alert, _}} ->
+ ?MODULE:accept(Server, ListenSocket, Options, Callback);
{error, closed} ->
ok;
{error, Other} ->
View
@@ -38,6 +38,8 @@ accept({ssl, Socket}, Timeout) ->
case ssl:ssl_accept(S, Timeout) of
ok ->
{ok, {ssl, S}};
+ {error, closed} ->
+ {error, econnaborted};
{error, Reason} ->
{error, Reason}
end;

0 comments on commit baadac8

Please sign in to comment.