Commit 2f13c8e7 authored by Alexander Strizhakov's avatar Alexander Strizhakov

formatting and pool fix

parent 2a80f032
......@@ -121,8 +121,8 @@ def handle_info({:gun_up, conn_pid, _protocol}, state) do
@impl true
def handle_info({:gun_down, conn_pid, _protocol, _reason, _killed, _unprocessed}, state) do
conn_key = compose_key_gun_info(conn_pid)
{key, conn} = find_conn(state.conns, conn_pid, conn_key)
# we can't get info on this pid, because pid is dead
{key, conn} = find_conn(state.conns, conn_pid)
Enum.each(conn.waiting_pids, fn waiting_pid -> GenServer.reply(waiting_pid, nil) end)
......@@ -137,6 +137,12 @@ defp compose_key_gun_info(pid) do
"#{info.origin_scheme}:#{info.origin_host}:#{info.origin_port}"
end
defp find_conn(conns, conn_pid) do
Enum.find(conns, fn {_key, conn} ->
conn.conn == conn_pid
end)
end
defp find_conn(conns, conn_pid, conn_key) do
Enum.find(conns, fn {key, conn} ->
key == conn_key and conn.conn == conn_pid
......
......@@ -91,8 +91,9 @@ defp process_sni_options(options, url) do
"https" ->
adapter_opts = Keyword.get(options, :adapter, [])
tls_opts = Keyword.get(adapter_opts, :tls_opts, [])
|> Keyword.put(:server_name_indication, host)
tls_opts =
Keyword.get(adapter_opts, :tls_opts, [])
|> Keyword.put(:server_name_indication, host)
adapter_opts = Keyword.put(adapter_opts, :tls_opts, tls_opts)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment