summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-12-05 14:27:08 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-12-05 14:27:08 +0000
commitcb09e46dd8eeb798d65d953702c8a22b92cb47cd (patch)
treef1ffea8415bac7e34be3da03a1b7d361c1b743fd /src
parentfd4531cd514ce54af8d3951606617f9bf165a727 (diff)
downloadrabbitmq-server-git-cb09e46dd8eeb798d65d953702c8a22b92cb47cd.tar.gz
better
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index ddacbf2628..41640f978c 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -625,8 +625,8 @@ create_channel(Channel, State) ->
Protocol, User, VHost, Capabilities, Collector}),
MRef = erlang:monitor(process, ChPid),
put({ch_pid, ChPid}, {Channel, MRef}),
- put({channel, Channel}, {ok, ChPid, AState}),
- {ok, ChPid, AState}
+ put({channel, Channel}, {ChPid, AState}),
+ {ok, {ChPid, AState}}
end.
channel_cleanup(ChPid) ->
@@ -675,25 +675,24 @@ handle_frame(Type, Channel, Payload, State) ->
process_frame(Frame, Channel, State) ->
ChKey = {channel, Channel},
- Ch = case get(ChKey) of
- undefined -> create_channel(Channel, State);
- Other -> Other
- end,
- case Ch of
+ case (case get(ChKey) of
+ undefined -> create_channel(Channel, State);
+ Other -> {ok, Other}
+ end) of
{error, Error} ->
handle_exception(State, Channel, Error);
- {ok, ChPid, AState} ->
+ {ok, {ChPid, AState}} ->
case rabbit_command_assembler:process(Frame, AState) of
{ok, NewAState} ->
- put(ChKey, {ok, ChPid, NewAState}),
+ put(ChKey, {ChPid, NewAState}),
post_process_frame(Frame, ChPid, State);
{ok, Method, NewAState} ->
rabbit_channel:do(ChPid, Method),
- put(ChKey, {ok, ChPid, NewAState}),
+ put(ChKey, {ChPid, NewAState}),
post_process_frame(Frame, ChPid, State);
{ok, Method, Content, NewAState} ->
rabbit_channel:do_flow(ChPid, Method, Content),
- put(ChKey, {ok, ChPid, NewAState}),
+ put(ChKey, {ChPid, NewAState}),
post_process_frame(Frame, ChPid, control_throttle(State));
{error, Reason} ->
handle_exception(State, Channel, Reason)