Просмотр исходного кода

Rename macro 'MAX_PACKET_LEN' to 'MAX_PACKET_SIZE'

Feng 9 лет назад
Родитель
Сommit
6c50a59cad
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      include/emqttd_protocol.hrl
  2. 1 1
      src/emqttd_serializer.erl

+ 1 - 1
include/emqttd_protocol.hrl

@@ -133,7 +133,7 @@
 %% Max MQTT Packet Length
 %%--------------------------------------------------------------------
 
--define(MAX_PACKET_LEN, 16#fffffff).
+-define(MAX_PACKET_SIZE, 16#fffffff).
 
 %%--------------------------------------------------------------------
 %% MQTT Parser and Serializer

+ 1 - 1
src/emqttd_serializer.erl

@@ -42,7 +42,7 @@ serialize_header(#mqtt_packet_header{type   = Type,
                  {VariableBin, PayloadBin})
     when ?CONNECT =< Type andalso Type =< ?DISCONNECT ->
     Len = byte_size(VariableBin) + byte_size(PayloadBin),
-    true = (Len =< ?MAX_PACKET_LEN),
+    true = (Len =< ?MAX_PACKET_SIZE),
     [<<Type:4, (opt(Dup)):1, (opt(Qos)):2, (opt(Retain)):1>>,
      serialize_len(Len), VariableBin, PayloadBin].