Skip to content

Commit

Permalink
Fix ranch:recv_proxy_header/2 with OTP-28 (master)
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Nov 7, 2024
1 parent 3a1ef19 commit d915df3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ranch_ssl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ recv_proxy_header(SSLSocket, Timeout) ->
%% nothing prevents us from retrieving the TCP socket and using
%% it. Since it's an undocumented interface this may however
%% make forward-compatibility more difficult.
{sslsocket, {gen_tcp, TCPSocket, _, _}, _} = SSLSocket,
TCPSocket = case element(2, SSLSocket) of
%% Before OTP-28.
{gen_tcp, TCPSocket0, _, _} -> TCPSocket0;
%% OTP-28+.
TCPSocket0 -> TCPSocket0
end,
ranch_tcp:recv_proxy_header(TCPSocket, Timeout).

-spec send(ssl:sslsocket(), iodata()) -> ok | {error, atom()}.
Expand Down

0 comments on commit d915df3

Please sign in to comment.