- defp find_conn_from_gun_info(conns, pid) do
- # TODO: temp fix for gun MatchError https://github.com/ninenines/gun/issues/222
- # TODO: REMOVE LATER
- try do
- %{origin_host: host, origin_scheme: scheme, origin_port: port} = Gun.info(pid)
-
- host =
- case :inet.ntoa(host) do
- {:error, :einval} -> host
- ip -> ip
- end
-
- key = "#{scheme}:#{host}:#{port}"
- find_conn(conns, pid, key)
- rescue
- MatcheError -> find_conn(conns, pid)
- end
- end
-