summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-12-12 11:57:16 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-12-12 11:57:16 +0000
commit158b456381a0d1874cf8bb47fac89474f54c7bc0 (patch)
treec083f55216ab301cf63541b1d9381f68309bc5cb
parentf89aa7840430eec4c46019f2a0086c57c4d43d47 (diff)
downloadrabbitmq-server-158b456381a0d1874cf8bb47fac89474f54c7bc0.tar.gz
refactor: simplify and reduce distance to 'default'
-rw-r--r--src/rabbit_reader.erl19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 7fac4f80..d4ae9655 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -488,16 +488,15 @@ close_connection(State = #v1{queue_collector = Collector,
State#v1{connection_state = closed}.
handle_dependent_exit(ChPid, Reason, State) ->
- case {channel_cleanup(ChPid, State), termination_kind(Reason)} of
- {{undefined, State1}, controlled} ->
- State1;
- {{undefined, _}, uncontrolled} ->
- exit({abnormal_dependent_exit, ChPid, Reason});
- {{_, State1}, controlled} ->
- maybe_close(control_throttle(State1));
- {{Channel, State1}, uncontrolled} ->
- State2 = handle_exception(State1, Channel, Reason),
- maybe_close(control_throttle(State2))
+ {Channel, State1} = channel_cleanup(ChPid, State),
+ case {Channel, termination_kind(Reason)} of
+ {undefined, controlled} -> State1;
+ {undefined, uncontrolled} -> exit({abnormal_dependent_exit,
+ ChPid, Reason});
+ {_, controlled} -> maybe_close(control_throttle(State1));
+ {_, uncontrolled} -> State2 = handle_exception(
+ State1, Channel, Reason),
+ maybe_close(control_throttle(State2))
end.
terminate_channels(State) ->