projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'bugfix/inbox-misleading-warning' into 'develop'
[akkoma]
/
lib
/
pleroma
/
gun
/
conn.ex
diff --git
a/lib/pleroma/gun/conn.ex
b/lib/pleroma/gun/conn.ex
index 75b1ffc0a6a1cef762cc44de0815047eb5efb0d3..a1210eabf7cb688597751380511519e4ed4360e6 100644
(file)
--- a/
lib/pleroma/gun/conn.ex
+++ b/
lib/pleroma/gun/conn.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Gun.Conn do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Gun.Conn do
@@
-50,16
+50,14
@@
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[:connect_timeout]),
+ {:ok,
protocol
} <- Gun.await_up(conn, opts[:connect_timeout]),
stream <- Gun.connect(conn, connect_opts),
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
stream <- Gun.connect(conn, connect_opts),
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
- {:ok, conn}
+ {:ok, conn
, protocol
}
else
error ->
Logger.warn(
else
error ->
Logger.warn(
- "Opening proxied connection to #{compose_uri_log(uri)} failed with error #{
- inspect(error)
- }"
+ "Opening proxied connection to #{compose_uri_log(uri)} failed with error #{inspect(error)}"
)
error
)
error
@@
-88,14
+86,12
@@
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[:connect_timeout]) do
- {:ok, conn}
+ {:ok,
protocol
} <- Gun.await_up(conn, opts[:connect_timeout]) do
+ {:ok, conn
, protocol
}
else
error ->
Logger.warn(
else
error ->
Logger.warn(
- "Opening socks proxied connection to #{compose_uri_log(uri)} failed with error #{
- inspect(error)
- }"
+ "Opening socks proxied connection to #{compose_uri_log(uri)} failed with error #{inspect(error)}"
)
error
)
error
@@
-106,8
+102,8
@@
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[:connect_timeout]) do
- {:ok, conn}
+ {:ok,
protocol
} <- Gun.await_up(conn, opts[:connect_timeout]) do
+ {:ok, conn
, protocol
}
else
error ->
Logger.warn(
else
error ->
Logger.warn(