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 | db0518cb26c6f1bd87708829ed4b24ba017a679e (patch) | |
| tree | 32207b01f6fd47669417bc1646a4bfac182b54dc /src | |
| parent | 755c6a293ca14243860e675cada59faf8143475e (diff) | |
| parent | 76ec63195079209c6a2793a181ec2fbf2e34d8cb (diff) | |
| download | rabbitmq-server-git-db0518cb26c6f1bd87708829ed4b24ba017a679e.tar.gz | |
merge heads
Diffstat (limited to 'src')
| -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 78f5d3b80f..ab13b2fe1b 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}; |
