Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/tesla.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ defmodule Tesla do

alias Tesla.Env

require Tesla.Adapter.Httpc
@default_adapter Tesla.Adapter.Httpc

defmacro __using__(opts \\ []) do
Expand Down
38 changes: 19 additions & 19 deletions lib/tesla/adapter/gun.ex
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,25 @@ if Code.ensure_loaded?(:gun) do
end
end
end

defp next_reply_state(_state, {:gun_response, _pid, _stream, :nofin, _status, _headers}),
do: :streaming

defp next_reply_state(state, _message), do: state

defp terminal_reply_message?({:gun_response, _pid, _stream, :fin, _status, _headers}),
do: true

defp terminal_reply_message?({:gun_data, _pid, _stream, :fin, _data}), do: true
defp terminal_reply_message?({:gun_error, _pid, _stream, _reason}), do: true
defp terminal_reply_message?({:gun_error, _pid, _reason}), do: true

defp terminal_reply_message?(
{:gun_down, _pid, _protocol, _reason, _killed_streams, _unprocessed}
),
do: true

defp terminal_reply_message?(_message), do: false
end

defp route_reply_message(request_owner, stream_owner, original_reply_to, message) do
Expand All @@ -547,25 +566,6 @@ if Code.ensure_loaded?(:gun) do
end
end

defp next_reply_state(_state, {:gun_response, _pid, _stream, :nofin, _status, _headers}),
do: :streaming

defp next_reply_state(state, _message), do: state

defp terminal_reply_message?({:gun_response, _pid, _stream, :fin, _status, _headers}),
do: true

defp terminal_reply_message?({:gun_data, _pid, _stream, :fin, _data}), do: true
defp terminal_reply_message?({:gun_error, _pid, _stream, _reason}), do: true
defp terminal_reply_message?({:gun_error, _pid, _reason}), do: true

defp terminal_reply_message?(
{:gun_down, _pid, _protocol, _reason, _killed_streams, _unprocessed}
),
do: true

defp terminal_reply_message?(_message), do: false

defp notify_reply_to(reply_to, request_owner, _message)
when is_pid(reply_to) and reply_to == request_owner,
do: :ok
Expand Down
7 changes: 5 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ defmodule Tesla.Mixfile do
plt_add_apps: [:mix, :inets, :idna, :ssl_verify_fun, :ex_unit],
plt_add_deps: :apps_direct
],
docs: docs(),
preferred_cli_env: [coveralls: :test, "coveralls.html": :test]
docs: docs()
]
end

def cli do
[preferred_envs: [coveralls: :test, "coveralls.html": :test]]
end

def application do
[extra_applications: [:logger, :ssl, :inets]]
end
Expand Down
Loading