aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-23 12:00:50 +0200
committerLoïc Hoguin <[email protected]>2019-09-23 12:00:50 +0200
commiteeb169fbd2988542fad9f6cee94e738fdc301a29 (patch)
tree18fe11390352ad742bc7a8149f64f7e4a02b1ff6
parent5793cfb2ca439eada5a3a0be168d83ed7b2d2a13 (diff)
downloadgun-eeb169fbd2988542fad9f6cee94e738fdc301a29.tar.gz
gun-eeb169fbd2988542fad9f6cee94e738fdc301a29.tar.bz2
gun-eeb169fbd2988542fad9f6cee94e738fdc301a29.zip
Remove 'protocol' option from connect_destination()
It was deprecated and replaced by 'protocols' in a previous version.
-rw-r--r--src/gun.erl13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 8eaa55e..da91514 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -146,7 +146,6 @@
port := inet:port_number(),
username => iodata(),
password => iodata(),
- protocol => http | http2, %% @todo Remove in Gun 2.0.
protocols => protocols(),
transport => tcp | tls,
tls_opts => [ssl:tls_client_option()],
@@ -1062,18 +1061,8 @@ connected(cast, {request, ReplyTo, StreamRef, Method, Path, Headers, Body, Initi
StreamRef, ReplyTo, Method, Host, Port, Path, Headers, Body,
InitialFlow, EvHandler, EvHandlerState0),
{keep_state, State#state{protocol_state=ProtoState2, event_handler_state=EvHandlerState}};
-connected(cast, {connect, ReplyTo, StreamRef, Destination0, Headers, InitialFlow},
+connected(cast, {connect, ReplyTo, StreamRef, Destination, Headers, InitialFlow},
State=#state{protocol=Protocol, protocol_state=ProtoState}) ->
- %% The protocol option has been deprecated in favor of the protocols option.
- %% Nobody probably ended up using it, but let's not break the interface.
- Destination = case Destination0 of
- #{protocols := _} ->
- Destination0;
- #{protocol := DestProto} ->
- Destination0#{protocols => [DestProto]};
- _ ->
- Destination0
- end,
ProtoState2 = Protocol:connect(ProtoState, StreamRef, ReplyTo, Destination, Headers, InitialFlow),
{keep_state, State#state{protocol_state=ProtoState2}};
%% Public Websocket interface.