Просмотр исходного кода

Merge branch 'master' into dev

Feng Lee 11 лет назад
Родитель
Сommit
0a4a241be1
5 измененных файлов с 61 добавлено и 22 удалено
  1. 13 3
      CHANGELOG.md
  2. 3 3
      Makefile
  3. 37 14
      README.md
  4. 6 0
      TODO
  5. 2 2
      apps/emqtt/src/emqtt_pubsub.erl

+ 13 - 3
CHANGELOG.md

@@ -1,10 +1,20 @@
 eMQTT ChangeLog
 ==================
 
-TODO: 0.2.1 (2014-12-31)
--------------------
+v0.2.1-beta (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 
+
+Makefile: deps -> get-deps
+
+rebar.config: fix mochiweb git url
+
+tag emqtt release accoding to [Semantic Versioning](http://semver.org/)
 
-Pass MQTT 3.1.1 Tests
+max clientId length is 1024 now.
 
 0.2.0 (2014-12-07)
 -------------------

+ 3 - 3
Makefile

@@ -1,9 +1,9 @@
-all: dep compile
+all: get-deps compile
 
-compile: dep
+compile: get-deps
 	./rebar compile
 
-dep:
+get-deps:
 	./rebar get-deps
 
 clean:

+ 37 - 14
README.md

@@ -9,15 +9,15 @@ eMQTT requires Erlang R17+.
 ## Startup in Five Minutes
 
 ```
-	$ git clone git://github.com/slimpp/emqtt.git
+$ git clone git://github.com/slimpp/emqtt.git
 
-	$ cd emqtt
+$ cd emqtt
 
-	$ make && make dist
+$ make && make dist
 
-	$ cd rel/emqtt
+$ cd rel/emqtt
 
-	$ ./bin/emqtt console
+$ ./bin/emqtt console
 ```
 
 ## Deploy and Start
@@ -25,18 +25,18 @@ eMQTT requires Erlang R17+.
 ### start
 
 ```
-	cp -R rel/emqtt $INSTALL_DIR
+cp -R rel/emqtt $INSTALL_DIR
 
-	cd $INSTALL_DIR/emqtt
+cd $INSTALL_DIR/emqtt
 
-	./bin/emqtt start
+./bin/emqtt start
 
 ```
 
 ### stop
 
 ```
-	./bin/emqtt stop
+./bin/emqtt stop
 
 ```
 
@@ -77,7 +77,25 @@ When nodes clustered, vm.args should be configured as below:
 -name emqtt@host1
 ```
 
-......
+## Cluster
+
+Suppose we cluster two nodes on 'host1', 'host2', Steps:
+
+on 'host1':
+
+```
+./bin/emqtt start
+```
+
+on 'host2':
+
+```
+./bin/emqtt start
+
+./bin/emqtt_ctl cluster emqtt@host1
+```
+
+Run './bin/emqtt_ctl cluster' on 'host1' or 'host2' to check cluster nodes.
 
 ## Cluster
 
@@ -106,13 +124,13 @@ eMQTT support http to publish message.
 Example:
 
 ```
-	curl -v --basic -u user:passwd -d "topic=/a/b/c&message=hello from http..." -k http://localhost:8883/mqtt/publish
+curl -v --basic -u user:passwd -d "topic=/a/b/c&message=hello from http..." -k http://localhost:8883/mqtt/publish
 ```
 
 ### URL
 
 ```
-	HTTP POST http://host:8883/mqtt/publish
+HTTP POST http://host:8883/mqtt/publish
 ```
 
 ### Parameters
@@ -124,7 +142,7 @@ message | Text Message
 
 ## Design
 
-[Design Wiki](https://github.com/slimpp/emqtt/wiki)
+[Design Wiki](https://github.com/emqtt/emqtt/wiki)
 
 ## License
 
@@ -132,5 +150,10 @@ The MIT License (MIT)
 
 ## Author
 
-feng at slimchat.io
+feng at emqtt.io
+
+## Thanks
+
+@hejin1026 (260495915 at qq.com)
+@desoulter (assoulter123 at gmail.com)
 

+ 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

@@ -247,10 +247,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;	
 	[] ->