diff options
author | Ingela Anderton Andin <[email protected]> | 2011-03-08 09:45:42 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2011-03-08 09:45:54 +0100 |
commit | 442fcfd70f0ddc9bd6ca029f5da1de6a0dee5b05 (patch) | |
tree | e00e0a87beb7823041c1d59ee55e9e63c143fb6a /lib/ssl/src/ssl.erl | |
parent | 4c7786f58f8f101723b00e839baa068f8cf34579 (diff) | |
parent | c034b8ce819cfe1171720499387815ae8dc84bc9 (diff) | |
download | otp-442fcfd70f0ddc9bd6ca029f5da1de6a0dee5b05.tar.gz otp-442fcfd70f0ddc9bd6ca029f5da1de6a0dee5b05.tar.bz2 otp-442fcfd70f0ddc9bd6ca029f5da1de6a0dee5b05.zip |
Merge branch 'jk/ssl_connection_hibernate' into dev
* jk/ssl_connection_hibernate:
Add the option { hibernate_after, int() } to ssl:connect and ssl:listen
OTP-9106
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r-- | lib/ssl/src/ssl.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl index b85188b878..3512e194bc 100644 --- a/lib/ssl/src/ssl.erl +++ b/lib/ssl/src/ssl.erl @@ -60,7 +60,7 @@ {keyfile, path()} | {password, string()} | {cacerts, [der_encoded()]} | {cacertfile, path()} | {dh, der_encoded()} | {dhfile, path()} | {ciphers, ciphers()} | {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | - {reuse_session, fun()}. + {reuse_session, fun()} | {hibernate_after, integer()|undefined}. -type verify_type() :: verify_none | verify_peer. -type path() :: string(). @@ -711,7 +711,8 @@ handle_options(Opts0, _Role) -> reuse_sessions = handle_option(reuse_sessions, Opts, true), secure_renegotiate = handle_option(secure_renegotiate, Opts, false), renegotiate_at = handle_option(renegotiate_at, Opts, ?DEFAULT_RENEGOTIATE_AT), - debug = handle_option(debug, Opts, []) + debug = handle_option(debug, Opts, []), + hibernate_after = handle_option(hibernate_after, Opts, undefined) }, CbInfo = proplists:get_value(cb_info, Opts, {gen_tcp, tcp, tcp_closed, tcp_error}), @@ -720,7 +721,7 @@ handle_options(Opts0, _Role) -> depth, cert, certfile, key, keyfile, password, cacerts, cacertfile, dh, dhfile, ciphers, debug, reuse_session, reuse_sessions, ssl_imp, - cb_info, renegotiate_at, secure_renegotiate], + cb_info, renegotiate_at, secure_renegotiate, hibernate_after], SockOpts = lists:foldl(fun(Key, PropList) -> proplists:delete(Key, PropList) @@ -827,6 +828,10 @@ validate_option(renegotiate_at, Value) when is_integer(Value) -> validate_option(debug, Value) when is_list(Value); Value == true -> Value; +validate_option(hibernate_after, undefined) -> + undefined; +validate_option(hibernate_after, Value) when is_integer(Value), Value >= 0 -> + Value; validate_option(Opt, Value) -> throw({error, {eoptions, {Opt, Value}}}). |