1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 03:50:15 +02:00

Use p1_http from p1_utils 1.0.6

This commit is contained in:
Christophe Romain 2016-11-14 16:52:03 +01:00
parent 3765210698
commit 309962fb8b
6 changed files with 8 additions and 367 deletions

View file

@ -36,14 +36,14 @@
-define(CONNECT_TIMEOUT, 8000).
start(Host) ->
http_p1:start(),
p1_http:start(),
Pool_size =
ejabberd_config:get_option({ext_api_http_pool_size, Host},
fun(X) when is_integer(X), X > 0->
X
end,
100),
http_p1:set_pool_size(Pool_size).
p1_http:set_pool_size(Pool_size).
stop(_Host) ->
ok.
@ -91,7 +91,7 @@ request(Server, Method, Path, Params, Mime, Data) ->
{"content-type", Mime},
{"User-Agent", "ejabberd"}],
Begin = os:timestamp(),
Result = case catch http_p1:request(Method, URI, Hdrs, Data, Opts) of
Result = case catch p1_http:request(Method, URI, Hdrs, Data, Opts) of
{ok, Code, _, <<>>} ->
{ok, Code, []};
{ok, Code, _, <<" ">>} ->