erylee 13 лет назад
Родитель
Сommit
3626979e31
5 измененных файлов с 15 добавлено и 7 удалено
  1. 8 1
      CHANGES
  2. 1 1
      rel/reltool.config
  3. 1 1
      src/emqtt.app.src
  4. 1 2
      src/emqtt_client.erl
  5. 4 2
      src/emqtt_topic.erl

+ 8 - 1
CHANGES

@@ -1,8 +1,15 @@
+Changes with emqtt 0.1.5                                         05 Jan 2012
+
+    *) Bugfix: remove QOS_1 match when handle PUBREL request 
+	
+    *) Bugfix: reverse word in emqtt_topic:words/1 function
+
+
 Changes with emqtt 0.1.4                                         04 Jan 2012
 
     *) Bugfix: fix "mosquitto_sub -q 2 ......" bug
 
-	*) Bugfix: fix keep alive bug
+    *) Bugfix: fix keep alive bug
 
 Changes with emqtt 0.1.3                                         04 Jan 2012
 

+ 1 - 1
rel/reltool.config

@@ -2,7 +2,7 @@
        {lib_dirs, ["../..", "../lib", "../plugins"]},
        {erts, [{mod_cond, derived}, {app_file, strip}]},
        {app_file, strip},
-       {rel, "emqtt", "0.1.2",
+       {rel, "emqtt", "0.1.5",
         [
          kernel,
          stdlib,

+ 1 - 1
src/emqtt.app.src

@@ -1,7 +1,7 @@
 {application, emqtt,
  [
   {description, "erlang mqtt broker"},
-  {vsn, "0.1.4"},
+  {vsn, "0.1.5"},
   {modules, [
 	emqtt,
 	emqtt_app,

+ 1 - 2
src/emqtt_client.erl

@@ -100,7 +100,7 @@ handle_info({route, Msg}, #state{socket = Sock, message_id=MsgId} = State) ->
 			  topic      = Topic,
 			  dup        = Dup,
 			  payload    = Payload} = Msg,
-	
+
 	Frame = #mqtt_frame{
 		fixed = #mqtt_frame_fixed{type 	 = ?PUBLISH,
 								  qos    = Qos,
@@ -291,7 +291,6 @@ process_request(?PUBREC, #mqtt_frame{
 
 process_request(?PUBREL,
                 #mqtt_frame{
-                  fixed = #mqtt_frame_fixed{ qos    = ?QOS_1 },
                   variable = #mqtt_frame_publish{message_id = MsgId}},
 				  State=#state{socket=Sock}) ->
 	erase({msg, MsgId}),

+ 4 - 2
src/emqtt_topic.erl

@@ -13,6 +13,8 @@
 %%
 -module(emqtt_topic).
 
+-import(lists, [reverse/1]).
+
 -import(string, [rchr/2, substr/2, substr/3]).
 
 %% ------------------------------------------------------------------------
@@ -113,13 +115,13 @@ words(Topic) when is_list(Topic) ->
 	words(Topic, [], []).
 
 words([], Word, ResAcc) ->
-	lists:reverse([Word|ResAcc]);
+	reverse([reverse(W) || W <- [Word|ResAcc]]);
 
 words([$/|Topic], Word, ResAcc) ->
 	words(Topic, [], [Word|ResAcc]);
 
 words([C|Topic], Word, ResAcc) ->
-	words(Topic, lists:reverse([C|Word]), ResAcc).
+	words(Topic, [C|Word], ResAcc).
 
 valid([""|Words]) -> valid2(Words);
 valid(Words) -> valid2(Words).