diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-09 12:30:29 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-09 12:30:29 +0100 |
commit | f0e94a8cefeefd582e732cfe4ff928578eef73d4 (patch) | |
tree | 4f145083efc44cd2dfe525fd0563b180f73898cd /src/rabbit_basic.erl | |
parent | fa440d982ce2a4ecfdcbd5cf984a594ba9f87836 (diff) | |
parent | bf0d78abd2f6757f054dcb06048f6a7eabade0f4 (diff) | |
download | rabbitmq-server-bug23045.tar.gz |
merged default into bug23045bug23045
Diffstat (limited to 'src/rabbit_basic.erl')
-rw-r--r-- | src/rabbit_basic.erl | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index 848c1e91..c1445a0c 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -49,12 +49,10 @@ | rabbit_types:error('not_found'))). -spec(publish/1 :: - (rabbit_types:delivery()) -> publish_result() | - rabbit_types:connection_exit()). + (rabbit_types:delivery()) -> publish_result()). -spec(delivery/4 :: (boolean(), boolean(), rabbit_types:maybe(rabbit_types:txn()), - rabbit_types:message()) - -> rabbit_types:delivery()). + rabbit_types:message()) -> rabbit_types:delivery()). -spec(message/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) @@ -64,12 +62,12 @@ -spec(publish/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) - -> publish_result() | rabbit_types:connection_exit()). + -> publish_result()). -spec(publish/7 :: (rabbit_exchange:name(), rabbit_router:routing_key(), boolean(), boolean(), rabbit_types:maybe(rabbit_types:txn()), properties_input(), binary()) - -> publish_result() | rabbit_types:connection_exit()). + -> publish_result()). -spec(build_content/2 :: (rabbit_framing:amqp_property_record(), binary()) -> rabbit_types:content()). @@ -99,18 +97,24 @@ delivery(Mandatory, Immediate, Txn, Message) -> sender = self(), message = Message}. build_content(Properties, BodyBin) -> - {ClassId, _MethodId} = rabbit_framing:method_id('basic.publish'), + %% basic.publish hasn't changed so we can just hard-code amqp_0_9_1 + {ClassId, _MethodId} = + rabbit_framing_amqp_0_9_1:method_id('basic.publish'), #content{class_id = ClassId, properties = Properties, properties_bin = none, + protocol = none, payload_fragments_rev = [BodyBin]}. 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'), + %% basic.publish hasn't changed so we can just hard-code amqp_0_9_1 + rabbit_binary_parser:ensure_content_decoded(Content, + rabbit_framing_amqp_0_9_1), + {ClassId, _MethodId} = + rabbit_framing_amqp_0_9_1:method_id('basic.publish'), {Props, list_to_binary(lists:reverse(FragmentsRev))}. message(ExchangeName, RoutingKeyBin, RawProperties, BodyBin) -> |