diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2010-07-09 17:51:50 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2010-07-09 17:51:50 +0100 |
| commit | 4ff838e74360176024305c2101f4fc6b1c09e50b (patch) | |
| tree | 05b80e31804c097908d5478de7da888c36153ca8 /src | |
| parent | 15fe9989cea3c207d69be81e219a88bb28aefa4f (diff) | |
| download | rabbitmq-server-git-4ff838e74360176024305c2101f4fc6b1c09e50b.tar.gz | |
Remove maybe_encode_properties
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_binary_generator.erl | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl index 07f25c15c0..f0ec618044 100644 --- a/src/rabbit_binary_generator.erl +++ b/src/rabbit_binary_generator.erl @@ -85,31 +85,18 @@ build_simple_method_frame(ChannelInt, MethodRecord, Protocol) -> {ClassId, MethodId} = Protocol:method_id(MethodName), create_frame(1, ChannelInt, [<<ClassId:16, MethodId:16>>, MethodFields]). -build_simple_content_frames(ChannelInt, - #content{class_id = ClassId, - properties = ContentProperties, - properties_bin = ContentPropertiesBin, - protocol = ContentProtocol, - payload_fragments_rev = PayloadFragmentsRev}, - FrameMax, Protocol) -> - {BodySize, ContentFrames} = build_content_frames(PayloadFragmentsRev, FrameMax, ChannelInt), +build_simple_content_frames(ChannelInt, Content, FrameMax, Protocol) -> + #content{class_id = ClassId, + properties_bin = ContentPropertiesBin, + payload_fragments_rev = PayloadFragmentsRev} = + ensure_content_encoded(Content, Protocol), + {BodySize, ContentFrames} = + build_content_frames(PayloadFragmentsRev, FrameMax, ChannelInt), HeaderFrame = create_frame(2, ChannelInt, [<<ClassId:16, 0:16, BodySize:64>>, - maybe_encode_properties(ContentProperties, - ContentPropertiesBin, - ContentProtocol, - Protocol)]), + ContentPropertiesBin]), [HeaderFrame | ContentFrames]. -maybe_encode_properties(_ContentProperties, - ContentPropertiesBin, - Protocol, - Protocol) - when is_binary(ContentPropertiesBin) -> - ContentPropertiesBin; -maybe_encode_properties(ContentProperties, none, _ContentProtocol, Protocol) -> - Protocol:encode_properties(ContentProperties). - build_content_frames(FragsRev, FrameMax, ChannelInt) -> BodyPayloadMax = if FrameMax == 0 -> iolist_size(FragsRev); |
