summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-06-29 18:47:35 -0500
committerTristan Sloughter <t@crashfast.com>2015-06-29 19:27:09 -0500
commit1c66f0eb9ff8504bd92960cb7573da853d79b5ab (patch)
tree06829e7ba6cf844829576d8aef7f8678f1586b92 /src
parent0f59ccb9bb2481fffe39fa20be31a4da59fd827e (diff)
setup hex httpc profile and http opts. needed also for proxy
Diffstat (limited to 'src')
-rw-r--r--src/rebar3.erl12
-rw-r--r--src/rebar_pkg_resource.erl3
2 files changed, 13 insertions, 2 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 5c0559f..c501709 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -272,4 +272,14 @@ start_and_load_apps() ->
application:start(asn1),
application:start(public_key),
application:start(ssl),
- inets:start().
+ inets:start(),
+ inets:start(httpc, [{profile, hex}]),
+ http_opts().
+
+http_opts() ->
+ Opts = [{max_sessions, 4},
+ {max_keep_alive_length, 4},
+ {keep_alive_timeout, 120000},
+ {max_pipeline_length, 4},
+ {pipeline_timeout, 60000}],
+ httpc:set_options(Opts, hex).
diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
index 59ce0dc..5b37788 100644
--- a/src/rebar_pkg_resource.erl
+++ b/src/rebar_pkg_resource.erl
@@ -95,7 +95,8 @@ make_vsn(_) ->
request(Url, ETag) ->
case httpc:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]},
[{relaxed, true}],
- [{body_format, binary}]) of
+ [{body_format, binary}],
+ hex) of
{ok, {{_Version, 200, _Reason}, Headers, Body}} ->
?DEBUG("Successfully downloaded ~s", [Url]),
{"etag", ETag1} = lists:keyfind("etag", 1, Headers),