aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRansom Richardson <[email protected]>2013-09-23 17:43:25 +0000
committerRansom Richardson <[email protected]>2013-09-23 17:43:25 +0000
commit9f30ca5b4bf9707a3fbe47f5ac1cd183e99d9ac5 (patch)
tree615109cec4e2d420e26baab9dd429eff55f5eed7
parentf047b0990c4385eb6d5678b06fa2b404c66eb8b4 (diff)
downloadranch-9f30ca5b4bf9707a3fbe47f5ac1cd183e99d9ac5.tar.gz
ranch-9f30ca5b4bf9707a3fbe47f5ac1cd183e99d9ac5.tar.bz2
ranch-9f30ca5b4bf9707a3fbe47f5ac1cd183e99d9ac5.zip
Add hibernate_after ssl option
-rw-r--r--src/ranch_ssl.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ranch_ssl.erl b/src/ranch_ssl.erl
index dfc5f11..c9c8adb 100644
--- a/src/ranch_ssl.erl
+++ b/src/ranch_ssl.erl
@@ -49,6 +49,7 @@
| {certfile, string()}
| {ciphers, [ssl:erl_cipher_suite()] | string()}
| {fail_if_no_peer_cert, boolean()}
+ | {hibernate_after, integer() | undefined}
| {ip, inet:ip_address()}
| {key, Der::binary()}
| {keyfile, string()}
@@ -94,6 +95,10 @@ messages() -> {ssl, ssl_closed, ssl_error}.
%% to send, i.e. sends a empty certificate, if set to false (that is by default)
%% it will only fail if the client sends an invalid certificate (an empty
%% certificate is considered valid).</dd>
+%% <dt>hibernate_after</dt><dd>When an integer-value is specified, the ssl_connection
+%% will go into hibernation after the specified number of milliseconds of inactivity,
+%% thus reducing its memory footprint. When undefined is specified (this is the
+%% default), the process will never go into hibernation.</dd>
%% <dt>ip</dt><dd>Interface to listen on. Listen on all interfaces
%% by default.</dd>
%% <dt>key</dt><dd>Optional. The DER encoded users private key. If this option
@@ -144,8 +149,9 @@ listen(Opts) ->
%% first argument.
ssl:listen(0, ranch:filter_options(Opts3,
[backlog, cacertfile, cacerts, cert, certfile, ciphers,
- fail_if_no_peer_cert, ip, key, keyfile, next_protocols_advertised,
- nodelay, password, port, raw, reuse_session, reuse_sessions,
+ fail_if_no_peer_cert, hibernate_after, ip, key, keyfile,
+ next_protocols_advertised, nodelay, password, port, raw,
+ reuse_session, reuse_sessions,
secure_renegotiate, verify, verify_fun],
[binary, {active, false}, {packet, raw},
{reuseaddr, true}, {nodelay, true}])).