diff options
author | Loïc Hoguin <[email protected]> | 2025-03-21 13:10:50 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2025-03-21 13:10:50 +0100 |
commit | dd1a09d7c8395d8e77d40a8bc5e1e4537c3c15b3 (patch) | |
tree | 3d5b39a82b96a0f27790d4f441f69f3fec424b63 /src/gun.erl | |
parent | 04c3436586eb150225791f96692eeff78f4d27c1 (diff) | |
download | gun-respect-remote-concurrency-limit.tar.gz gun-respect-remote-concurrency-limit.tar.bz2 gun-respect-remote-concurrency-limit.zip |
Respect remote concurrency limit for headers/connect/ws_upgraderespect-remote-concurrency-limit
In order to simplify the implementation the CookieStore is
given to the connect function now, even though it's not
currently used.
Diffstat (limited to 'src/gun.erl')
-rw-r--r-- | src/gun.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gun.erl b/src/gun.erl index a7c0239..5a3c233 100644 --- a/src/gun.erl +++ b/src/gun.erl @@ -1401,13 +1401,14 @@ connected(cast, {request, ReplyTo, StreamRef, Method, Path, Headers, Body, Initi event_handler_state=EvHandlerState}); connected(cast, {connect, ReplyTo, StreamRef, Destination, Headers, InitialFlow}, State=#state{origin_host=Host, origin_port=Port, - protocol=Protocol, protocol_state=ProtoState, + protocol=Protocol, protocol_state=ProtoState, cookie_store=CookieStore0, event_handler=EvHandler, event_handler_state=EvHandlerState0}) -> - {Commands, EvHandlerState} = Protocol:connect(ProtoState, + {Commands, CookieStore, EvHandlerState} = Protocol:connect(ProtoState, dereference_stream_ref(StreamRef, State), ReplyTo, Destination, #{host => Host, port => Port}, - Headers, InitialFlow, EvHandler, EvHandlerState0), - commands(Commands, State#state{event_handler_state=EvHandlerState}); + Headers, InitialFlow, CookieStore0, EvHandler, EvHandlerState0), + commands(Commands, State#state{cookie_store=CookieStore, + event_handler_state=EvHandlerState}); %% Public Websocket interface. connected(cast, {ws_upgrade, ReplyTo, StreamRef, Path, Headers}, State=#state{opts=Opts}) -> WsOpts = maps:get(ws_opts, Opts, #{}), |