Skip to content

Commit

Permalink
chore: revert Oleg's HTTP/3 changes as introduced segfaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
samcamwilliams committed Jan 25, 2025
1 parent 2130746 commit 323af6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ar_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ req(Args, ReestablishedConnection, Opts) ->
StartTime = erlang:monotonic_time(),
#{ peer := Peer, path := Path, method := Method } = Args,
Response =
case catch gen_server:call(?MODULE, {get_connection, Args, Opts}, infinity) of
case catch gen_server:call(?MODULE, {get_connection, Args}, infinity) of
{ok, PID} ->
ar_rate_limiter:throttle(Peer, Path, Opts),
case request(PID, Args, Opts) of
Expand Down Expand Up @@ -105,12 +105,12 @@ init(Opts) ->
?event(started),
{ok, #state{ opts = Opts }}.

handle_call({get_connection, Args, Opts}, From,
handle_call({get_connection, Args}, From,
#state{ pid_by_peer = PIDPeer, status_by_pid = StatusByPID } = State) ->
Peer = maps:get(peer, Args),
Peer = maps:get(peer, Args),
case maps:get(Peer, PIDPeer, not_found) of
not_found ->
{ok, PID} = open_connection(Args, Opts),
{ok, PID} = open_connection(Args, State#state.opts),
MonitorRef = monitor(process, PID),
PIDPeer2 = maps:put(Peer, PID, PIDPeer),
StatusByPID2 =
Expand Down Expand Up @@ -296,8 +296,8 @@ open_connection(#{ peer := Peer }, Opts) ->
http2 -> BaseGunOpts#{protocols => [http2], transport => Transport};
http1 -> BaseGunOpts#{protocols => [http], transport => Transport}
end,
?event(http, {gun_open, {host, Host}, {port, Port}, {protocol, Proto}}),
gun:open(Host, Port, GunOpts).
?event(http, {gun_open, {host, Host}, {port, Port}, {protocol, Proto}, {transport, Transport}}),
gun:open(Host, Port, GunOpts).

parse_peer(Peer, Opts) ->
case binary:split(Peer, <<":">>, [global]) of
Expand Down

0 comments on commit 323af6c

Please sign in to comment.