diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_basic.erl | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index 6e5c503b62..ca18087df4 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -259,19 +259,18 @@ header_routes(HeadersTable) -> binary_to_list(HeaderKey), Type}}) end || HeaderKey <- ?ROUTING_HEADERS]). +parse_expiration(#'P_basic'{expiration = undefined}) -> + {ok, undefined}; parse_expiration(#'P_basic'{expiration = Expiration}) -> - case Expiration of - undefined -> {ok, undefined}; - B -> case string:to_integer(binary_to_list(B)) of - {error, no_integer} = E -> - E; - {N, ""} -> - case rabbit_misc:check_expiry_size(N) of - ok -> {ok, N}; - E = {error, _} -> E - end; - {_, S} -> - {error, {leftover_string, S}} - end + case string:to_integer(binary_to_list(Expiration)) of + {error, no_integer} = E -> + E; + {N, ""} -> + case rabbit_misc:check_expiry_size(N) of + ok -> {ok, N}; + E = {error, _} -> E + end; + {_, S} -> + {error, {leftover_string, S}} end. |
