summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-01-17 16:21:19 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-01-17 16:21:19 +0000
commitf90640eda347e7dc1756f5dbe747628816614fc8 (patch)
tree54dedee08d4aecf280c12f4be53b50ceedf6c76b
parentffb441fa1f41c4ff6edb98acbe57ecc1753a21fd (diff)
downloadrabbitmq-server-f90640eda347e7dc1756f5dbe747628816614fc8.tar.gz
Unwind the stack before taking that one-way trip.
-rw-r--r--src/rabbit_reader.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 6d4becc0..a1dfeeff 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -245,6 +245,8 @@ start_connection(Parent, ChannelSupSupPid, Collector, StartHeartbeatFun, Deb,
handshake, 8)),
log(info, "closing AMQP connection ~p (~s)~n", [self(), Name])
catch
+ throw:{become, M, F, A} ->
+ apply(M, F, A);
Ex -> log(case Ex of
connection_closed_abruptly -> warning;
_ -> error
@@ -996,8 +998,8 @@ emit_stats(State) ->
become_1_0(Mode, Version, State = #v1{sock = Sock}) ->
case code:is_loaded(rabbit_amqp1_0_reader) of
false -> refuse_connection(Sock, {bad_version, Version});
- _ -> M = rabbit_amqp1_0_reader, %% fool xref
- M:become(Mode, pack_for_1_0(State))
+ _ -> throw({become, rabbit_amqp1_0_reader, become,
+ [Mode, pack_for_1_0(State)]})
end.
pack_for_1_0(#v1{parent = Parent,