fix pattern match bu
Prior to this change, when packet have topic alias, the check_pub_caps function could not be matched correctly This change fix this bug.
This commit is contained in:
parent
2d10d6971d
commit
78020de302
|
@ -647,16 +647,16 @@ check_publish(Packet, PState) ->
|
||||||
run_check_steps([fun check_pub_caps/2,
|
run_check_steps([fun check_pub_caps/2,
|
||||||
fun check_pub_acl/2], Packet, PState).
|
fun check_pub_acl/2], Packet, PState).
|
||||||
|
|
||||||
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
|
||||||
variable = #mqtt_packet_publish{ properties = Properties}},
|
|
||||||
#pstate{zone = Zone}) ->
|
|
||||||
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain});
|
|
||||||
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
||||||
variable = #mqtt_packet_publish{
|
variable = #mqtt_packet_publish{
|
||||||
properties = #{'Topic-Alias' := TopicAlias}
|
properties = #{'Topic-Alias' := TopicAlias}
|
||||||
}},
|
}},
|
||||||
#pstate{zone = Zone}) ->
|
#pstate{zone = Zone}) ->
|
||||||
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain, topic_alias => TopicAlias}).
|
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain, topic_alias => TopicAlias});
|
||||||
|
check_pub_caps(#mqtt_packet{header = #mqtt_packet_header{qos = QoS, retain = Retain},
|
||||||
|
variable = #mqtt_packet_publish{ properties = Properties}},
|
||||||
|
#pstate{zone = Zone}) ->
|
||||||
|
emqx_mqtt_caps:check_pub(Zone, #{qos => QoS, retain => Retain}).
|
||||||
|
|
||||||
|
|
||||||
check_pub_acl(_Packet, #pstate{is_super = IsSuper, enable_acl = EnableAcl})
|
check_pub_acl(_Packet, #pstate{is_super = IsSuper, enable_acl = EnableAcl})
|
||||||
|
|
Loading…
Reference in New Issue