aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-06-09 09:31:05 +0200
committerLoïc Hoguin <[email protected]>2014-06-09 09:31:05 +0200
commit71df001167e423b0661b56406a3052cca02c9ce1 (patch)
tree4e1c5a6ac72dfea014e12efffd92258d3423ddeb
parent5df930c2f4ee360e3a30e5ee644e9d573b5ca153 (diff)
parentc5a42cc4a32f38a195f9c15e4456a48eaefdfa82 (diff)
downloadgun-71df001167e423b0661b56406a3052cca02c9ce1.tar.gz
gun-71df001167e423b0661b56406a3052cca02c9ce1.tar.bz2
gun-71df001167e423b0661b56406a3052cca02c9ce1.zip
Merge branch 'fix-unexpected-messages' of git://github.com/unix1/gun
-rw-r--r--src/gun.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 85cedb3..71af26e 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -483,6 +483,12 @@ loop(State=#state{parent=Parent, owner=Owner, host=Host,
Transport:close(Socket),
retry(State#state{socket=undefined, transport=undefined,
protocol=undefined}, Retry);
+ {OK, _PreviousSocket, _Data} ->
+ loop(State);
+ {Closed, _PreviousSocket} ->
+ loop(State);
+ {Error, _PreviousSocket, _} ->
+ loop(State);
keepalive ->
ProtoState2 = Protocol:keepalive(ProtoState),
before_loop(State#state{protocol_state=ProtoState2});
@@ -529,7 +535,8 @@ loop(State=#state{parent=Parent, owner=Owner, host=Host,
"before the gun:ws_send/1 function can be used."}},
loop(State);
Any ->
- error_logger:error_msg("Unexpected message: ~w~n", [Any])
+ error_logger:error_msg("Unexpected message: ~w~n", [Any]),
+ loop(State)
end.
ws_loop(State=#state{parent=Parent, owner=Owner, retry=Retry, socket=Socket,