diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-09-17 15:57:59 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-09-17 15:57:59 +0100 |
commit | a2573b46fbd9aa9e6e4d1b7b80cbc0e1aa5df71d (patch) | |
tree | 32207b01f6fd47669417bc1646a4bfac182b54dc | |
parent | 9261402fce87d6f5e98ae862723f9e5949c7566a (diff) | |
parent | d4fc4cbe253d6d6677d70c0a0f8b494a6cad69ba (diff) | |
download | rabbitmq-server-a2573b46fbd9aa9e6e4d1b7b80cbc0e1aa5df71d.tar.gz |
merge heads
-rw-r--r-- | src/rabbit_channel.erl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 78f5d3b8..ab13b2fe 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -470,6 +470,14 @@ check_user_id_header(#'P_basic'{user_id = Claimed}, "user_id property set to '~s' but authenticated user was '~s'", [Claimed, Actual]). +check_expiration_header(Props) -> + case rabbit_basic:parse_expiration(Props) of + {ok, _} -> ok; + {error, E} -> rabbit_misc:protocol_error( + invalid_expiration, "cannot parse expiration '~p': ~p", + [Props#'P_basic'.expiration, E]) + end. + check_internal_exchange(#exchange{name = Name, internal = true}) -> rabbit_misc:protocol_error(access_refused, "cannot publish to internal ~s", @@ -611,12 +619,7 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin, DecodedContent = #content {properties = Props} = rabbit_binary_parser:ensure_content_decoded(Content), check_user_id_header(Props, State), - case rabbit_basic:parse_expiration(Props) of - {ok, _} -> ok; - {error, E} -> rabbit_misc:protocol_error( - invalid_expiration, "cannot parse expiration '~p': ~p", - [Props#'P_basic'.expiration, E]) - end, + check_expiration_header(Props), {MsgSeqNo, State1} = case {TxStatus, ConfirmEnabled} of {none, false} -> {undefined, State}; |