perf(emqx_frame): skip empty tail

This commit is contained in:
Zaiming Shi 2021-05-18 01:29:54 +02:00 committed by JimMoen
parent 9d0ef5de6b
commit fec3c6574e
1 changed files with 1 additions and 0 deletions

View File

@ -174,6 +174,7 @@ parse_remaining_len(<<0:1, Len:7, Rest/binary>>, Header, Multiplier, Value,
body_bytes(B) when is_binary(B) -> size(B); body_bytes(B) when is_binary(B) -> size(B);
body_bytes(?Q(Bytes, _)) -> Bytes. body_bytes(?Q(Bytes, _)) -> Bytes.
append_body(H, <<>>) -> H;
append_body(H, T) when is_binary(H) andalso size(H) < 1024 -> append_body(H, T) when is_binary(H) andalso size(H) < 1024 ->
<<H/binary, T/binary>>; <<H/binary, T/binary>>;
append_body(H, T) when is_binary(H) -> append_body(H, T) when is_binary(H) ->