aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-08-26 13:45:34 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:51:58 +0200
commit3de0604eec218996dad4db59c0cc96092cd7e0e7 (patch)
tree01a4dedc50b6f5bc5a88f15764f4df6a4bcdac31 /src/gun_http.erl
parent96e36a877fe79362c829492f71d532541ca857d7 (diff)
downloadgun-3de0604eec218996dad4db59c0cc96092cd7e0e7.tar.gz
gun-3de0604eec218996dad4db59c0cc96092cd7e0e7.tar.bz2
gun-3de0604eec218996dad4db59c0cc96092cd7e0e7.zip
Refactor protocol handling via gun_protocols
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r--src/gun_http.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index 950bda1..2536369 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -347,11 +347,8 @@ handle_connect(Rest, State=#http_state{
], State), EvHandlerState1};
_ ->
[NewProtocol0] = maps:get(protocols, Destination, [http]),
- NewProtocol = {Protocol0, _} = case NewProtocol0 of
- {P, POpts} -> {P, POpts#{stream_ref => RealStreamRef}};
- P -> {P, #{stream_ref => RealStreamRef}}
- end,
- Protocol = gun:protocol_handler(Protocol0),
+ NewProtocol = gun_protocols:add_stream_ref(NewProtocol0, RealStreamRef),
+ Protocol = gun_protocols:handler(NewProtocol),
ReplyTo ! {gun_tunnel_up, self(), RealStreamRef, Protocol:name()},
{handle_ret([
{origin, <<"http">>, NewHost, NewPort, connect},