diff options
author | Ingela Anderton Andin <[email protected]> | 2018-08-14 15:52:47 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2018-08-14 15:52:47 +0200 |
commit | f54e6b513e746344d5252c269b8bb072dd6136a3 (patch) | |
tree | 417f509d9b45e9cace955a9d62696a717da330cb /lib/ssl/src/ssl_pem_cache.erl | |
parent | 80fc5d8bbb7d3fbc626e7206ef8125fd6749a7c6 (diff) | |
parent | e6361e0df384d1b8358955529c1d6f02c694274b (diff) | |
download | otp-f54e6b513e746344d5252c269b8bb072dd6136a3.tar.gz otp-f54e6b513e746344d5252c269b8bb072dd6136a3.tar.bz2 otp-f54e6b513e746344d5252c269b8bb072dd6136a3.zip |
Merge branch 'ingela/ssl/ERL-686/OTP-15224' into maint
* ingela/ssl/ERL-686/OTP-15224:
ssl: Error handling improvment
Diffstat (limited to 'lib/ssl/src/ssl_pem_cache.erl')
-rw-r--r-- | lib/ssl/src/ssl_pem_cache.erl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/ssl/src/ssl_pem_cache.erl b/lib/ssl/src/ssl_pem_cache.erl index 115ab4451d..a952e20133 100644 --- a/lib/ssl/src/ssl_pem_cache.erl +++ b/lib/ssl/src/ssl_pem_cache.erl @@ -29,7 +29,7 @@ -export([start_link/1, start_link_dist/1, name/1, - insert/1, + insert/2, clear/0]). % Spawn export @@ -90,19 +90,17 @@ start_link_dist(_) -> %%-------------------------------------------------------------------- --spec insert(binary()) -> {ok, term()} | {error, reason()}. +-spec insert(binary(), term()) -> ok | {error, reason()}. %% %% Description: Cache a pem file and return its content. %%-------------------------------------------------------------------- -insert(File) -> - {ok, PemBin} = file:read_file(File), - Content = public_key:pem_decode(PemBin), +insert(File, Content) -> case bypass_cache() of true -> - {ok, Content}; + ok; false -> cast({cache_pem, File, Content}), - {ok, Content} + ok end. %%-------------------------------------------------------------------- |