Skip to content

Commit

Permalink
allow opting into the no_responders behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmries committed Oct 16, 2022
1 parent 8076ea4 commit f97ed0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/gnat/handshake.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ defmodule Gnat.Handshake do
%{verbose: false}
|> negotiate_auth(server_settings, user_settings)
|> negotiate_headers(server_settings, user_settings)
|> negotiate_no_responders(server_settings, user_settings)
end

defp perform_handshake(tcp, user_settings) do
Expand Down Expand Up @@ -77,6 +78,13 @@ defmodule Gnat.Handshake do
settings
end

defp negotiate_no_responders(%{headers: true} = settings, _server_settings, %{no_responders: true}) do
Map.put(settings, :no_responders, true)
end
defp negotiate_no_responders(settings, _server_settings, _user_settings) do
settings
end

defp upgrade_connection(tcp, %{tls: true, ssl_opts: opts}) do
:ok = :inet.setopts(tcp, [active: true])
:ssl.connect(tcp, opts, 1_000)
Expand Down

0 comments on commit f97ed0a

Please sign in to comment.