summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2009-08-09 01:04:41 +0100
committerMatthias Radestock <matthias@lshift.net>2009-08-09 01:04:41 +0100
commitec13792cb5b71f142b9709565de2dbb240986017 (patch)
tree517c2cd25b2b287c4d52bb6b6d0d51678c01b292
parent524dd0f35929da26a8d4ffd0e733ff4ebafa8e7f (diff)
downloadrabbitmq-server-bug21335.tar.gz
assemble fragments in correct orderbug21335
and handle the case where both props are available in both binary and decoded form.
-rw-r--r--src/rabbit_basic.erl16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl
index 0f6aeb7a..4033aaaf 100644
--- a/src/rabbit_basic.erl
+++ b/src/rabbit_basic.erl
@@ -82,17 +82,13 @@ build_content(Properties, BodyBin) ->
properties_bin = none,
payload_fragments_rev = [BodyBin]}.
-from_content(#content{properties = Props,
- properties_bin = none,
- payload_fragments_rev = BodyList}) ->
- {Props, list_to_binary(BodyList)};
-
-from_content(#content{properties = none,
- properties_bin = PropsBin,
- payload_fragments_rev = BodyList}) ->
+from_content(Content) ->
+ #content{class_id = ClassId,
+ properties = Props,
+ payload_fragments_rev = FragmentsRev} =
+ rabbit_binary_parser:ensure_content_decoded(Content),
{ClassId, _MethodId} = rabbit_framing:method_id('basic.publish'),
- Props = rabbit_framing:decode_properties(ClassId, PropsBin),
- {Props, list_to_binary(BodyList)}.
+ {Props, list_to_binary(lists:reverse(FragmentsRev))}.
message(ExchangeName, RoutingKeyBin, RawProperties, BodyBin) ->
Properties = properties(RawProperties),