From 088adeda3bcb76e27121c60932c59c5e7bbedd9d Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 22 Feb 2017 14:11:10 +0800 Subject: [PATCH] Fix issue #916 - add 'mqtt_msg_from()' type --- include/emqttd.hrl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/emqttd.hrl b/include/emqttd.hrl index 0d7d4c134..3f4f22229 100644 --- a/include/emqttd.hrl +++ b/include/emqttd.hrl @@ -108,13 +108,15 @@ -type(mqtt_pktid() :: 1..16#ffff | undefined). +-type(mqtt_msg_from() :: atom() | {binary(), undefined | binary()}). + -record(mqtt_message, { %% Global unique message ID id :: mqtt_msgid(), %% PacketId pktid :: mqtt_pktid(), %% ClientId and Username - from :: {binary(), undefined | binary()}, + from :: mqtt_msg_from(), %% Topic that the message is published to topic :: binary(), %% Message QoS @@ -127,12 +129,13 @@ dup = false :: boolean(), %% $SYS flag sys = false :: boolean(), + %% Headers headers = [] :: list(), %% Payload payload :: binary(), %% Timestamp timestamp :: erlang:timestamp() -}). + }). -type(mqtt_message() :: #mqtt_message{}).