aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-03 20:31:09 +0200
committerLoïc Hoguin <[email protected]>2018-06-03 20:31:09 +0200
commit34307a584149abbf0b2e5b33beb2fca4c585b0d1 (patch)
treef44f3236287271ca0868262cb4401d1c1b88da38 /src/gun.erl
parentca57baf279a164c4b9813267e6bbc96ed5b45ee8 (diff)
downloadgun-34307a584149abbf0b2e5b33beb2fca4c585b0d1.tar.gz
gun-34307a584149abbf0b2e5b33beb2fca4c585b0d1.tar.bz2
gun-34307a584149abbf0b2e5b33beb2fca4c585b0d1.zip
Change messages to gun_upgrade and gun_ws with stream reference
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gun.erl b/src/gun.erl
index cad1da1..1224c82 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -381,6 +381,7 @@ await(ServerPid, StreamRef, Timeout) ->
demonitor(MRef, [flush]),
Res.
+%% @todo Add gun_upgrade and gun_ws?
await(ServerPid, StreamRef, Timeout, MRef) ->
receive
{gun_inform, ServerPid, StreamRef, Status, Headers} ->
@@ -494,9 +495,9 @@ flush_pid(ServerPid) ->
flush_pid(ServerPid);
{gun_error, ServerPid, _} ->
flush_pid(ServerPid);
- {gun_ws_upgrade, ServerPid, _, _} ->
+ {gun_upgrade, ServerPid, _, _, _} ->
flush_pid(ServerPid);
- {gun_ws, ServerPid, _} ->
+ {gun_ws, ServerPid, _, _} ->
flush_pid(ServerPid);
{'DOWN', _, process, ServerPid, _} ->
flush_pid(ServerPid)
@@ -517,6 +518,10 @@ flush_ref(StreamRef) ->
{gun_push, _, StreamRef, _, _, _, _, _} ->
flush_ref(StreamRef);
{gun_error, _, StreamRef, _} ->
+ flush_ref(StreamRef);
+ {gun_upgrade, _, StreamRef, _, _} ->
+ flush_ref(StreamRef);
+ {gun_ws, _, StreamRef, _} ->
flush_ref(StreamRef)
after 0 ->
ok