projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix atom leak in AdminAPIController
[akkoma]
/
lib
/
pleroma
/
gun
/
conn.ex
diff --git
a/lib/pleroma/gun/conn.ex
b/lib/pleroma/gun/conn.ex
index 5c12e815356cc086479612fe0d6a8281738d7ee5..75b1ffc0a6a1cef762cc44de0815047eb5efb0d3 100644
(file)
--- a/
lib/pleroma/gun/conn.ex
+++ b/
lib/pleroma/gun/conn.ex
@@
-13,7
+13,7
@@
defmodule Pleroma.Gun.Conn do
opts =
opts
|> Enum.into(%{})
opts =
opts
|> Enum.into(%{})
- |> Map.put_new(:
await_up_timeout, pool_opts[:await_up
_timeout] || 5_000)
+ |> Map.put_new(:
connect_timeout, pool_opts[:connect
_timeout] || 5_000)
|> Map.put_new(:supervise, false)
|> maybe_add_tls_opts(uri)
|> Map.put_new(:supervise, false)
|> maybe_add_tls_opts(uri)
@@
-22,7
+22,7
@@
defmodule Pleroma.Gun.Conn do
defp maybe_add_tls_opts(opts, %URI{scheme: "http"}), do: opts
defp maybe_add_tls_opts(opts, %URI{scheme: "http"}), do: opts
- defp maybe_add_tls_opts(opts, %URI{scheme: "https"
, host: host
}) do
+ defp maybe_add_tls_opts(opts, %URI{scheme: "https"}) do
tls_opts = [
verify: :verify_peer,
cacertfile: CAStore.file_path(),
tls_opts = [
verify: :verify_peer,
cacertfile: CAStore.file_path(),
@@
-50,7
+50,7
@@
defmodule Pleroma.Gun.Conn do
with open_opts <- Map.delete(opts, :tls_opts),
{:ok, conn} <- Gun.open(proxy_host, proxy_port, open_opts),
with open_opts <- Map.delete(opts, :tls_opts),
{:ok, conn} <- Gun.open(proxy_host, proxy_port, open_opts),
- {:ok, _} <- Gun.await_up(conn, opts[:
await_up
_timeout]),
+ {:ok, _} <- Gun.await_up(conn, opts[:
connect
_timeout]),
stream <- Gun.connect(conn, connect_opts),
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
{:ok, conn}
stream <- Gun.connect(conn, connect_opts),
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
{:ok, conn}
@@
-88,7
+88,7
@@
defmodule Pleroma.Gun.Conn do
|> Map.put(:socks_opts, socks_opts)
with {:ok, conn} <- Gun.open(proxy_host, proxy_port, opts),
|> Map.put(:socks_opts, socks_opts)
with {:ok, conn} <- Gun.open(proxy_host, proxy_port, opts),
- {:ok, _} <- Gun.await_up(conn, opts[:
await_up
_timeout]) do
+ {:ok, _} <- Gun.await_up(conn, opts[:
connect
_timeout]) do
{:ok, conn}
else
error ->
{:ok, conn}
else
error ->
@@
-106,7
+106,7
@@
defmodule Pleroma.Gun.Conn do
host = Pleroma.HTTP.AdapterHelper.parse_host(host)
with {:ok, conn} <- Gun.open(host, port, opts),
host = Pleroma.HTTP.AdapterHelper.parse_host(host)
with {:ok, conn} <- Gun.open(host, port, opts),
- {:ok, _} <- Gun.await_up(conn, opts[:
await_up
_timeout]) do
+ {:ok, _} <- Gun.await_up(conn, opts[:
connect
_timeout]) do
{:ok, conn}
else
error ->
{:ok, conn}
else
error ->