Skip to content

Commit

Permalink
fix ssl acceptor drain
Browse files Browse the repository at this point in the history
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
Stefan Grundmann committed Apr 15, 2014
1 parent 49cd96e commit baadac8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elli_http.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ accept(Server, ListenSocket, Options, Callback) ->
?MODULE:accept(Server, ListenSocket, Options, Callback); ?MODULE:accept(Server, ListenSocket, Options, Callback);
{error, econnaborted} -> {error, econnaborted} ->
?MODULE:accept(Server, ListenSocket, Options, Callback); ?MODULE:accept(Server, ListenSocket, Options, Callback);
{error, {tls_alert, _}} ->
?MODULE:accept(Server, ListenSocket, Options, Callback);
{error, closed} -> {error, closed} ->
ok; ok;
{error, Other} -> {error, Other} ->
Expand Down
2 changes: 2 additions & 0 deletions src/elli_tcp.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ accept({ssl, Socket}, Timeout) ->
case ssl:ssl_accept(S, Timeout) of case ssl:ssl_accept(S, Timeout) of
ok -> ok ->
{ok, {ssl, S}}; {ok, {ssl, S}};
{error, closed} ->
{error, econnaborted};
{error, Reason} -> {error, Reason} ->
{error, Reason} {error, Reason}
end; end;
Expand Down

0 comments on commit baadac8

Please sign in to comment.