anchor.diff:          {error, Reason} ->
               {error, Reason}
       end;
  -parse(<<?PUBLISH:4, Dup:1, QoS:2, Retain:1>>, <<TopicLen:16/big, Topic:TopicLen/binary, MessageId:16/big, Payload/binary>>)
  +variable(<<?PUBLISH:4, Dup:1, QoS:2, Retain:1>>, <<TopicLen:16/big, Topic:TopicLen/binary, MessageId:16/big, Payload/binary>>)
     when QoS < 3 ->
       case vmq_topic:validate_topic(publish, Topic) of
           {ok, ParsedTopic} ->
  
positive.code: -define(HIGHBIT, 2#10000000).
  -define(LOWBITS, 2#01111111).
  
  -define(MAX_PACKET_SIZE, 266338304).
  
  -spec parse(binary()) -> {mqtt_frame(), binary()} | {error, atom()} | more.
  parse(<<Fixed:1/binary, 0:1, L1:7, Data/binary>>) ->
      case Data of
          <<Var:L1/binary, Rest/binary>> ->
              case parse(Fixed, Var) of
                  {error, _} = E -> E;
                  Frame -> {Frame, Rest}
              end;
          _ -> more
      end;
  parse(<<Fixed:1/binary, 1:1, L1:7, 0:1, L2:7, Data/binary>>) ->
      DataSize = L1 + (L2 bsl 7),
      case Data of
          <<Var:DataSize/binary, Rest/binary>> -> {parse(Fixed, Var), Rest};
          _ -> more
      end;
  parse(<<Fixed:1/binary, 1:1, L1:7, 1:1, L2:7, 0:1, L3:7, Data/binary>>) ->
      DataSize = L1 + (L2 bsl 7) + (L3 bsl 14),
      case Data of
          <<Var:DataSize/binary, Rest/binary>> -> {parse(Fixed, Var), Rest};
          _ -> more
      end;
  parse(<<Fixed:1/binary, 1:1, L1:7, 1:1, L2:7, 1:1, L3:7, 0:1, L4:7, Data/binary>>) ->
      DataSize = L1 + (L2 bsl 7) + (L3 bsl 14) + (L4 bsl 21),
      case Data of
          <<Var:DataSize/binary, Rest/binary>> -> {parse(Fixed, Var), Rest};
          _ -> more
      end;
  parse(<<_:8/binary, _/binary>>) ->
      {error, cant_parse_fixed_header};
  parse(_) ->
      more.
  
  -spec parse(binary(), binary()) -> mqtt_frame() | {error, atom()}.
  parse(<<?PUBLISH:4, Dup:1, 0:2, Retain:1>>, <<TopicLen:16/big, Topic:TopicLen/binary, Payload/binary>>) ->
      case vmq_topic:validate_topic(publish, Topic) of
          {ok, ParsedTopic} ->
              #mqtt_publish{dup=Dup,
  
negative.code:         E ->
              E
      end;
  variable(<<?SUBACK:4, 0:4>>, <<MessageId:16/big, Acks/binary>>) ->
      #mqtt_suback{qos_table=parse_acks(Acks, []),
                   message_id=MessageId};
  variable(<<?UNSUBACK:4, 0:4>>, <<MessageId:16/big>>) ->
      #mqtt_unsuback{message_id=MessageId};
  variable(<<?CONNECT:4, 0:4>>, <<L:16/big, PMagic:L/binary, _/binary>>)
    when not ((PMagic == ?PROTOCOL_MAGIC_311) or
               (PMagic == ?PROTOCOL_MAGIC_31)) ->
      {error, unknown_protocol_magic};
  
  variable(<<?CONNECT:4, 0:4>>,
      <<L:16/big, _:L/binary, ProtoVersion:8,
        UserNameFlag:1, PasswordFlag:1, WillRetain:1, WillQos:2, WillFlag:1,
        CleanSession:1,
  