fix wildcard topics match
This commit is contained in:
parent
4a2b586ff9
commit
5ed1217b0a
|
@ -1,6 +1,13 @@
|
|||
eMQTT ChangeLog
|
||||
==================
|
||||
|
||||
0.2.1 (2015-01-08)
|
||||
-------------------
|
||||
|
||||
pull request 26: Use binaries for topic paths and fix wildcard topics
|
||||
|
||||
emqtt_pubsub.erl: fix wildcard topic match bug caused by binary topic in 0.2.0
|
||||
|
||||
0.2.0 (2014-12-07)
|
||||
-------------------
|
||||
|
||||
|
|
|
@ -249,10 +249,10 @@ trie_match(NodeId, [W|Words], ResAcc) ->
|
|||
[#topic_trie{node_id=ChildId}] -> trie_match(ChildId, Words, Acc);
|
||||
[] -> Acc
|
||||
end
|
||||
end, 'trie_match_#'(NodeId, ResAcc), [W, "+"]).
|
||||
end, 'trie_match_#'(NodeId, ResAcc), [W, <<"+">>]).
|
||||
|
||||
'trie_match_#'(NodeId, ResAcc) ->
|
||||
case mnesia:read(topic_trie, #topic_trie_edge{node_id=NodeId, word="#"}) of
|
||||
case mnesia:read(topic_trie, #topic_trie_edge{node_id=NodeId, word = <<"#">>}) of
|
||||
[#topic_trie{node_id=ChildId}] ->
|
||||
mnesia:read(topic_trie_node, ChildId) ++ ResAcc;
|
||||
[] ->
|
||||
|
|
Loading…
Reference in New Issue