summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-07-09 14:14:50 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-07-09 14:14:50 +0100
commitff90a4a0698e2682548d922fd6c0cbec178fb2e5 (patch)
tree37fc12a5c68fc615e6f9ab5a7891064c5c59974d
parentcdb63918b8ca115269d4cbbefd2d971652057927 (diff)
downloadrabbitmq-server-git-ff90a4a0698e2682548d922fd6c0cbec178fb2e5.tar.gz
don't log content on framing error
plus some minor refactors and cosmetic changes
-rw-r--r--src/rabbit_framing_channel.erl14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/rabbit_framing_channel.erl b/src/rabbit_framing_channel.erl
index 889e966315..6f14371f16 100644
--- a/src/rabbit_framing_channel.erl
+++ b/src/rabbit_framing_channel.erl
@@ -73,24 +73,22 @@ read_frame(ChannelPid) ->
end.
mainloop(ChannelPid) ->
- Decoded = read_frame(ChannelPid),
- case Decoded of
+ case read_frame(ChannelPid) of
{method, MethodName, FieldsBin} ->
Method = rabbit_framing:decode_method_fields(MethodName, FieldsBin),
case rabbit_framing:method_has_content(MethodName) of
- true -> {ClassId, _MethodId} =
+ true -> {ClassId, _MethodId} =
rabbit_framing:method_id(MethodName),
- rabbit_channel:do(ChannelPid, Method,
- collect_content(ChannelPid,
- ClassId));
+ Content = collect_content(ChannelPid, ClassId),
+ rabbit_channel:do(ChannelPid, Method, Content);
false -> rabbit_channel:do(ChannelPid, Method)
end,
?MODULE:mainloop(ChannelPid);
_ ->
rabbit_misc:protocol_error(
unexpected_frame,
- "expected method frame, got ~p instead",
- [Decoded])
+ "expected method frame, got non method frame instead",
+ [])
end.
collect_content(ChannelPid, ClassId) ->