Bläddra i källkod

fix wildcard topics match

Feng Lee 11 år sedan
förälder
incheckning
5ed1217b0a
3 ändrade filer med 15 tillägg och 2 borttagningar
  1. 7 0
      CHANGELOG.md
  2. 6 0
      TODO
  3. 2 2
      apps/emqtt/src/emqtt_pubsub.erl

+ 7 - 0
CHANGELOG.md

@@ -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)
 -------------------
 

+ 6 - 0
TODO

@@ -1,3 +1,9 @@
+
+0.2.2
+=====
+
+merge pull request#26
+
 0.2.0
 =====
 

+ 2 - 2
apps/emqtt/src/emqtt_pubsub.erl

@@ -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;	
 	[] ->