diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-08-21 09:38:16 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-08-21 09:38:16 +0100 |
| commit | 914e917df9082ced1a275779af96a8782a53aef6 (patch) | |
| tree | d97e53757da44f03efca9328ae11d2956289c03c /src | |
| parent | a9e3887873b0556544abd24883ff5bef43c6892d (diff) | |
| download | rabbitmq-server-git-914e917df9082ced1a275779af96a8782a53aef6.tar.gz | |
Avoid binary:split/2.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_channel.erl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 418653dfb0..59453385c3 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -174,12 +174,13 @@ declare_fast_reply_to(<<"amq.rabbitmq.reply-to.", Rest/binary>>) -> declare_fast_reply_to(_) -> not_found. -decode_fast_reply_to(Suffix) -> - case binary:split(Suffix, <<".">>) of - [PidEnc, Key] -> Pid = binary_to_term(base64:decode(PidEnc)), - {ok, Pid, Key}; - _ -> error - end. +%% It's inelegant to depend on the encoded lengths here, but +%% binary:split/2 does not exist in R13B03. +decode_fast_reply_to(<<PidEnc:40/binary, ".", Key:24/binary>>) -> + Pid = binary_to_term(base64:decode(PidEnc)), + {ok, Pid, Key}; +decode_fast_reply_to(_) -> + error. send_credit_reply(Pid, Len) -> gen_server2:cast(Pid, {send_credit_reply, Len}). |
