diff options
author | Loïc Hoguin <[email protected]> | 2019-08-05 17:59:07 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-08-05 19:57:16 +0200 |
commit | 9429902d017929afca014af8cc7f4bbc07b63abe (patch) | |
tree | 22d3fa041b5b040573a2fbc69e8f6eeabaf46a2d | |
parent | 611f9a9b78cab4005892e13dffb7a2c8e44580ee (diff) | |
download | gun-9429902d017929afca014af8cc7f4bbc07b63abe.tar.gz gun-9429902d017929afca014af8cc7f4bbc07b63abe.tar.bz2 gun-9429902d017929afca014af8cc7f4bbc07b63abe.zip |
Don't link gun_tls_proxy process to the ssl process
It is ignored by ssl for the purpose we want, and causes
problems in the other direction. Also use a normal shutdown
when TLS handshake errors occur.
-rw-r--r-- | src/gun_tls_proxy.erl | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gun_tls_proxy.erl b/src/gun_tls_proxy.erl index d0558b2..3978822 100644 --- a/src/gun_tls_proxy.erl +++ b/src/gun_tls_proxy.erl @@ -252,7 +252,7 @@ not_connected(cast, Msg={connect_proc, Error}, State=#state{owner_pid=OwnerPid, OwnerPid ! {?MODULE, self(), Error, Extra}, %% We unlink from the owner process to avoid taking it down with us. unlink(OwnerPid), - {stop, Error, State}; + {stop, {shutdown, Error}, State}; not_connected(Type, Event, State) -> handle_common(Type, Event, State). @@ -312,8 +312,6 @@ handle_common(cast, Msg={set_owner, OwnerPid}, State) -> {keep_state, State#state{owner_pid=OwnerPid}}; handle_common(cast, Msg={cb_controlling_process, ProxyPid}, State) -> ?DEBUG_LOG("msg ~0p state ~0p", [Msg, State]), - %% We link so that the ssl process terminates when we do. - link(ProxyPid), {keep_state, State#state{proxy_pid=ProxyPid}}; handle_common(cast, Msg={setopts, Opts}, State) -> ?DEBUG_LOG("msg ~0p state ~0p", [Msg, State]), |