From 11dfe71f4b9aedaaedea2ad3b2f32fd006a8480f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 10 Mar 2014 09:52:45 +0100 Subject: Add gun_http Support for HTTP/1.1 and compatibility with HTTP/1.0. --- src/gun.erl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/gun.erl') diff --git a/src/gun.erl b/src/gun.erl index 57d29e2..978e550 100644 --- a/src/gun.erl +++ b/src/gun.erl @@ -261,12 +261,10 @@ connect(State=#state{owner=Owner, host=Host, port=Port, type=ssl}, Retries) -> {client, [<<"spdy/3">>, <<"http/1.1">>], <<"spdy/3">>}}], case Transport:connect(Host, Port, Opts) of {ok, Socket} -> - Protocol = gun_spdy, -%% @todo For some reasons this function doesn't work? Bug submitted. -% Protocol = case ssl:negotiated_next_protocol(Socket) of -% {ok, <<"spdy/3">>} -> gun_spdy; -% _ -> gun_http -% end, + Protocol = case ssl:negotiated_next_protocol(Socket) of + {ok, <<"spdy/3">>} -> gun_spdy; + _ -> gun_http + end, ProtoState = Protocol:init(Owner, Socket, Transport), before_loop(State#state{socket=Socket, transport=Transport, protocol=Protocol, protocol_state=ProtoState}); -- cgit v1.2.3