|
|
@@ -30,6 +30,7 @@
|
|
|
-include_lib("hocon/include/hoconsc.hrl").
|
|
|
-include_lib("logger.hrl").
|
|
|
|
|
|
+-define(MAX_INT_MQTT_PACKET_SIZE, 268435456).
|
|
|
-define(MAX_INT_TIMEOUT_MS, 4294967295).
|
|
|
%% floor(?MAX_INT_TIMEOUT_MS / 1000).
|
|
|
-define(MAX_INT_TIMEOUT_S, 4294967).
|
|
|
@@ -45,6 +46,7 @@
|
|
|
-type timeout_duration_s() :: 0..?MAX_INT_TIMEOUT_S.
|
|
|
-type timeout_duration_ms() :: 0..?MAX_INT_TIMEOUT_MS.
|
|
|
-type bytesize() :: integer().
|
|
|
+-type mqtt_max_packet_size() :: 1..?MAX_INT_MQTT_PACKET_SIZE.
|
|
|
-type wordsize() :: bytesize().
|
|
|
-type percent() :: float().
|
|
|
-type file() :: string().
|
|
|
@@ -71,6 +73,7 @@
|
|
|
-typerefl_from_string({timeout_duration_s/0, emqx_schema, to_timeout_duration_s}).
|
|
|
-typerefl_from_string({timeout_duration_ms/0, emqx_schema, to_timeout_duration_ms}).
|
|
|
-typerefl_from_string({bytesize/0, emqx_schema, to_bytesize}).
|
|
|
+-typerefl_from_string({mqtt_max_packet_size/0, emqx_schema, to_bytesize}).
|
|
|
-typerefl_from_string({wordsize/0, emqx_schema, to_wordsize}).
|
|
|
-typerefl_from_string({percent/0, emqx_schema, to_percent}).
|
|
|
-typerefl_from_string({comma_separated_list/0, emqx_schema, to_comma_separated_list}).
|
|
|
@@ -151,6 +154,7 @@
|
|
|
timeout_duration_s/0,
|
|
|
timeout_duration_ms/0,
|
|
|
bytesize/0,
|
|
|
+ mqtt_max_packet_size/0,
|
|
|
wordsize/0,
|
|
|
percent/0,
|
|
|
file/0,
|
|
|
@@ -3357,7 +3361,7 @@ mqtt_general() ->
|
|
|
)},
|
|
|
{"max_packet_size",
|
|
|
sc(
|
|
|
- bytesize(),
|
|
|
+ mqtt_max_packet_size(),
|
|
|
#{
|
|
|
default => <<"1MB">>,
|
|
|
desc => ?DESC(mqtt_max_packet_size)
|