Remove proto_ver field stored in the headers of message
This commit is contained in:
parent
3038bd4570
commit
5a3645c97e
|
@ -419,13 +419,10 @@ process_publish(PacketId, Msg = #message{qos = ?QOS_2},
|
||||||
handle_out({pubrec, PacketId, RC}, Channel)
|
handle_out({pubrec, PacketId, RC}, Channel)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
publish_to_msg(Packet, #channel{client = Client = #{mountpoint := MountPoint},
|
publish_to_msg(Packet, #channel{client = Client = #{mountpoint := MountPoint}}) ->
|
||||||
protocol = Protocol}) ->
|
|
||||||
Msg = emqx_packet:to_message(Client, Packet),
|
Msg = emqx_packet:to_message(Client, Packet),
|
||||||
Msg1 = emqx_message:set_flag(dup, false, Msg),
|
Msg1 = emqx_message:set_flag(dup, false, Msg),
|
||||||
ProtoVer = emqx_protocol:info(proto_ver, Protocol),
|
emqx_mountpoint:mount(MountPoint, Msg1).
|
||||||
Msg2 = emqx_message:set_header(proto_ver, ProtoVer, Msg1),
|
|
||||||
emqx_mountpoint:mount(MountPoint, Msg2).
|
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Process Subscribe
|
%% Process Subscribe
|
||||||
|
|
|
@ -177,11 +177,10 @@ will_msg(#mqtt_packet_connect{client_id = ClientId,
|
||||||
will_qos = QoS,
|
will_qos = QoS,
|
||||||
will_topic = Topic,
|
will_topic = Topic,
|
||||||
will_props = Properties,
|
will_props = Properties,
|
||||||
will_payload = Payload,
|
will_payload = Payload}) ->
|
||||||
proto_ver = ProtoVer}) ->
|
|
||||||
Msg = emqx_message:make(ClientId, QoS, Topic, Payload),
|
Msg = emqx_message:make(ClientId, QoS, Topic, Payload),
|
||||||
Msg#message{flags = #{dup => false, retain => Retain},
|
Msg#message{flags = #{dup => false, retain => Retain},
|
||||||
headers = merge_props(#{username => Username, proto_ver => ProtoVer}, Properties)}.
|
headers = merge_props(#{username => Username}, Properties)}.
|
||||||
|
|
||||||
merge_props(Headers, undefined) ->
|
merge_props(Headers, undefined) ->
|
||||||
Headers;
|
Headers;
|
||||||
|
|
Loading…
Reference in New Issue