fix emqtt_messsage
This commit is contained in:
parent
69568cfb61
commit
46d1749120
|
@ -22,6 +22,8 @@
|
|||
|
||||
-module(emqtt_message).
|
||||
|
||||
-author('feng@emqtt.io').
|
||||
|
||||
-include("emqtt.hrl").
|
||||
|
||||
-include("emqtt_packet.hrl").
|
||||
|
@ -44,8 +46,8 @@
|
|||
%% @doc message from packet
|
||||
%%
|
||||
from_packet(#mqtt_packet{ header = #mqtt_packet_header{ type = ?PUBLISH,
|
||||
qos = Qos,
|
||||
retain = Retain,
|
||||
qos = Qos,
|
||||
dup = Dup },
|
||||
variable = #mqtt_packet_publish{ topic_name = Topic,
|
||||
packet_id = PacketId },
|
||||
|
|
|
@ -153,14 +153,14 @@ handle_packet(?CONNECT, Packet = #mqtt_packet {
|
|||
handle_packet(?PUBLISH, Packet = #mqtt_packet {
|
||||
header = #mqtt_packet_header {qos = ?QOS_0}},
|
||||
State = #proto_state{session = Session}) ->
|
||||
emqtt_session:publish(Session, {?QOS_0, emqtt_messsage:from_packet(Packet)}),
|
||||
emqtt_session:publish(Session, {?QOS_0, emqtt_message:from_packet(Packet)}),
|
||||
{ok, State};
|
||||
|
||||
handle_packet(?PUBLISH, Packet = #mqtt_packet {
|
||||
header = #mqtt_packet_header { qos = ?QOS_1 },
|
||||
variable = #mqtt_packet_publish{packet_id = PacketId }},
|
||||
State = #proto_state { session = Session }) ->
|
||||
emqtt_session:publish(Session, {?QOS_1, emqtt_messsage:from_packet(Packet)}),
|
||||
emqtt_session:publish(Session, {?QOS_1, emqtt_message:from_packet(Packet)}),
|
||||
send_packet( make_packet(?PUBACK, PacketId), State);
|
||||
|
||||
handle_packet(?PUBLISH, Packet = #mqtt_packet {
|
||||
|
|
Loading…
Reference in New Issue