From eeb169fbd2988542fad9f6cee94e738fdc301a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 23 Sep 2019 12:00:50 +0200 Subject: Remove 'protocol' option from connect_destination() It was deprecated and replaced by 'protocols' in a previous version. --- src/gun.erl | 13 +------------ 1 file changed, 1 insertion(+), 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. -- cgit v1.2.3