Skip to content

Commit

Permalink
Remove Cowboy 1 related code
Browse files Browse the repository at this point in the history
  • Loading branch information
ream88 committed Nov 13, 2020
1 parent 906ee6a commit d1c445a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/bypass/instance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,16 @@ defmodule Bypass.Instance do
}
end

defp new_route(fun, :any, expected),
do: new_route(fun, [], expected)
defp new_route(fun, :any, expected) do
new_route(fun, [], expected)
end

defp new_route(fun, path, expected),
do: new_route(fun, build_path_match(path) |> elem(1), expected)
defp new_route(fun, path, expected) do
new_route(fun, build_path_match(path) |> elem(1), expected)
end

defp cowboy_opts(port, ref, socket) do
case Application.spec(:plug_cowboy, :vsn) do
'1.' ++ _ -> [ref: ref, acceptors: 5, port: port, socket: socket]
_ -> [ref: ref, port: port, transport_options: [num_acceptors: 5, socket: socket]]
end
[ref: ref, port: port, transport_options: [num_acceptors: 5, socket: socket]]
end

# Use raw socket options to set SO_REUSEPORT so we fix {:error, :eaddrinuse} - where the OS errors
Expand Down

0 comments on commit d1c445a

Please sign in to comment.