diff --git a/Makefile b/Makefile index 7202915cc..e12a516b1 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ EUNIT_OPTS = verbose CT_SUITES = emqx emqx_banned emqx_connection emqx_session emqx_access emqx_broker emqx_cm emqx_frame emqx_guid emqx_inflight \ emqx_json emqx_keepalive emqx_lib emqx_metrics emqx_misc emqx_mod emqx_mqtt_caps \ - emqx_mqtt_compat emqx_mqtt_properties emqx_mqueue emqx_net emqx_pqueue emqx_router emqx_sm \ + emqx_mqtt_compat emqx_mqtt_props emqx_mqueue emqx_net emqx_pqueue emqx_router emqx_sm \ emqx_stats emqx_tables emqx_time emqx_topic emqx_trie emqx_vm emqx_zone \ emqx_mountpoint emqx_listeners emqx_protocol diff --git a/src/emqx_client.erl b/src/emqx_client.erl index 192569ca4..85d6ca59d 100644 --- a/src/emqx_client.erl +++ b/src/emqx_client.erl @@ -159,7 +159,7 @@ start_link() -> start_link([]). start_link(Options) when is_map(Options) -> start_link(maps:to_list(Options)); start_link(Options) when is_list(Options) -> - ok = emqx_mqtt_properties:validate( + ok = emqx_mqtt_props:validate( proplists:get_value(properties, Options, #{})), case start_client(with_owner(Options)) of {ok, Client} -> @@ -265,7 +265,7 @@ publish(Client, Topic, Payload, Opts) when is_binary(Topic), is_list(Opts) -> -> ok | {ok, packet_id()} | {error, term()}). publish(Client, Topic, Properties, Payload, Opts) when is_binary(Topic), is_map(Properties), is_list(Opts) -> - ok = emqx_mqtt_properties:validate(Properties), + ok = emqx_mqtt_props:validate(Properties), Retain = proplists:get_bool(retain, Opts), QoS = ?QOS_I(proplists:get_value(qos, Opts, ?QOS_0)), publish(Client, #mqtt_msg{qos = QoS, @@ -541,7 +541,7 @@ mqtt_connect(State = #state{client_id = ClientId, will_msg = WillMsg, properties = Properties}) -> ?WILL_MSG(WillQoS, WillRetain, WillTopic, WillProps, WillPayload) = WillMsg, - ConnProps = emqx_mqtt_properties:filter(?CONNECT, Properties), + ConnProps = emqx_mqtt_props:filter(?CONNECT, Properties), send(?CONNECT_PACKET( #mqtt_packet_connect{proto_ver = ProtoVer, proto_name = ProtoName, diff --git a/src/emqx_mqtt_properties.erl b/src/emqx_mqtt_props.erl similarity index 99% rename from src/emqx_mqtt_properties.erl rename to src/emqx_mqtt_props.erl index 643156013..33acb360b 100644 --- a/src/emqx_mqtt_properties.erl +++ b/src/emqx_mqtt_props.erl @@ -13,7 +13,7 @@ %% limitations under the License. %% @doc MQTT5 Properties --module(emqx_mqtt_properties). +-module(emqx_mqtt_props). -include("emqx_mqtt.hrl"). diff --git a/test/emqx_mqtt_properties_SUITE.erl b/test/emqx_mqtt_props_SUITE.erl similarity index 73% rename from test/emqx_mqtt_properties_SUITE.erl rename to test/emqx_mqtt_props_SUITE.erl index a8301d1f4..8d3b16a14 100644 --- a/test/emqx_mqtt_properties_SUITE.erl +++ b/test/emqx_mqtt_props_SUITE.erl @@ -12,7 +12,7 @@ %% See the License for the specific language governing permissions and %% limitations under the License. --module(emqx_mqtt_properties_SUITE). +-module(emqx_mqtt_props_SUITE). -compile(export_all). -compile(nowarn_export_all). @@ -22,6 +22,7 @@ all() -> [t_mqtt_properties_all]. t_mqtt_properties_all(_) -> - Props = emqx_mqtt_properties:filter(?CONNECT, #{'Session-Expiry-Interval' => 1, 'Maximum-Packet-Size' => 255}), - ok = emqx_mqtt_properties:validate(Props), - #{} = emqx_mqtt_properties:filter(?CONNECT, #{'Maximum-QoS' => ?QOS_2}). + Props = emqx_mqtt_props:filter(?CONNECT, #{'Session-Expiry-Interval' => 1, 'Maximum-Packet-Size' => 255}), + ok = emqx_mqtt_props:validate(Props), + #{} = emqx_mqtt_props:filter(?CONNECT, #{'Maximum-QoS' => ?QOS_2}). +