aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-01-03 22:12:42 +0100
committerLoïc Hoguin <[email protected]>2019-01-03 22:12:42 +0100
commitfbe58ec837cc3c84b08d701c82b95222738c775f (patch)
treed0c34202fefe8c7aa8edf12128f03c360c320bc1 /src
parent8a30f96cf19f9104e3ae8df5f85df33b66b5bfc2 (diff)
downloadgun-fbe58ec837cc3c84b08d701c82b95222738c775f.tar.gz
gun-fbe58ec837cc3c84b08d701c82b95222738c775f.tar.bz2
gun-fbe58ec837cc3c84b08d701c82b95222738c775f.zip
Consolidate origin server test helpers
Also fixes an issue with switch_transport introduced when converting the Gun process to gen_statem.
Diffstat (limited to 'src')
-rw-r--r--src/gun.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gun.erl b/src/gun.erl
index f27e7f4..e74c43f 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -888,7 +888,8 @@ commands([{origin, _Scheme, Host, Port, Type}|Tail],
commands(Tail, State#state{origin_host=Host, origin_port=Port,
intermediaries=[Info|Intermediaries]});
commands([{switch_transport, Transport, Socket}|Tail], State) ->
- commands(Tail, State#state{socket=Socket, transport=Transport});
+ commands(Tail, active(State#state{socket=Socket, transport=Transport,
+ messages=Transport:messages()}));
%% @todo The two loops should be reunified and this clause generalized.
commands([{switch_protocol, Protocol=gun_ws, ProtoState}], State) ->
{keep_state, keepalive_cancel(State#state{protocol=Protocol, protocol_state=ProtoState})};