summaryrefslogtreecommitdiff
path: root/src/rabbit_basic.erl
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2012-04-10 10:26:13 +0100
committerEmile Joubert <emile@rabbitmq.com>2012-04-10 10:26:13 +0100
commit478acb61ef5589efa45622a278dc3809d1f2e70f (patch)
treeb3a31bb2ac84fd997dbbc0126d05b249a157ce7d /src/rabbit_basic.erl
parent1fe82ee9b57658fe2861144da9eb0e219da616e4 (diff)
downloadrabbitmq-server-478acb61ef5589efa45622a278dc3809d1f2e70f.tar.gz
Restore rabbit_basic:extract_headers/1
Diffstat (limited to 'src/rabbit_basic.erl')
-rw-r--r--src/rabbit_basic.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl
index cc876cb4..8ad59016 100644
--- a/src/rabbit_basic.erl
+++ b/src/rabbit_basic.erl
@@ -20,7 +20,7 @@
-export([publish/4, publish/6, publish/1,
message/3, message/4, properties/1, append_table_header/3,
- map_headers/2, delivery/4, header_routes/1]).
+ extract_headers/1, map_headers/2, delivery/4, header_routes/1]).
-export([build_content/2, from_content/1]).
%%----------------------------------------------------------------------------
@@ -61,6 +61,8 @@
-spec(append_table_header/3 ::
(binary(), rabbit_framing:amqp_table(), headers()) -> headers()).
+-spec(extract_headers/1 :: (rabbit_types:content()) -> headers()).
+
-spec(map_headers/2 :: (rabbit_types:content(), fun((headers()) -> headers()))
-> rabbit_types:content()).
@@ -186,6 +188,11 @@ append_table_header(Name, Info, Headers) ->
end,
rabbit_misc:set_table_value(Headers, Name, array, [{table, Info} | Prior]).
+extract_headers(Content) ->
+ #content{properties = #'P_basic'{headers = Headers}} =
+ rabbit_binary_parser:ensure_content_decoded(Content),
+ Headers.
+
map_headers(F, Content) ->
Content1 = rabbit_binary_parser:ensure_content_decoded(Content),
#content{properties = #'P_basic'{headers = Headers} = Props} = Content1,