summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-08-07 23:33:48 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-08-07 23:33:48 +0100
commit81774a2718da5364015dbd6b8f6bb9d3451f7876 (patch)
tree88dcaec8d24d5aa731d1e4ed084848f59f2d4696
parent1dbeefe4b8d18c88fa5aee1b3adcd20da0e2dd94 (diff)
downloadrabbitmq-server-git-81774a2718da5364015dbd6b8f6bb9d3451f7876.tar.gz
handle transcoding of content when it is not available decoded
-rw-r--r--src/rabbit_binary_generator.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl
index f7a3409006..056ab1b574 100644
--- a/src/rabbit_binary_generator.erl
+++ b/src/rabbit_binary_generator.erl
@@ -283,7 +283,16 @@ ensure_content_encoded(Content = #content{properties_bin = PropBin,
protocol = Protocol}, Protocol)
when PropBin =/= none ->
Content;
-ensure_content_encoded(Content = #content{properties = Props}, Protocol) ->
+ensure_content_encoded(Content = #content{properties = none,
+ properties_bin = PropBin,
+ protocol = Protocol}, Protocol1)
+ when PropBin =/= none ->
+ Props = Protocol:decode_properties(Content#content.class_id, PropBin),
+ Content#content{properties = Props,
+ properties_bin = Protocol1:encode_properties(Props),
+ protocol = Protocol1};
+ensure_content_encoded(Content = #content{properties = Props}, Protocol)
+ when Props =/= none ->
Content#content{properties_bin = Protocol:encode_properties(Props),
protocol = Protocol}.