aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-03-10 09:52:45 +0100
committerLoïc Hoguin <[email protected]>2014-03-10 09:52:45 +0100
commit11dfe71f4b9aedaaedea2ad3b2f32fd006a8480f (patch)
treed0d3a7fa9c2a6c8e90f6a37bfd6c3e3abb465405 /src/gun.erl
parent4d75a78f822928ec8f57b934491d3870d8861308 (diff)
downloadgun-11dfe71f4b9aedaaedea2ad3b2f32fd006a8480f.tar.gz
gun-11dfe71f4b9aedaaedea2ad3b2f32fd006a8480f.tar.bz2
gun-11dfe71f4b9aedaaedea2ad3b2f32fd006a8480f.zip
Add gun_http
Support for HTTP/1.1 and compatibility with HTTP/1.0.
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl10
1 files changed, 4 insertions, 6 deletions
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});