From 3626979e3183ec67b5fb5844aad8edd6703ef9b9 Mon Sep 17 00:00:00 2001 From: erylee Date: Sat, 5 Jan 2013 16:21:37 +0800 Subject: [PATCH] 0.1.5 bug fix --- CHANGES | 9 ++++++++- rel/reltool.config | 2 +- src/emqtt.app.src | 2 +- src/emqtt_client.erl | 3 +-- src/emqtt_topic.erl | 6 ++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index dfb5949b9..a04c03cc1 100644 --- a/CHANGES +++ b/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 diff --git a/rel/reltool.config b/rel/reltool.config index 22e0c2c4f..8f3ba07c7 100644 --- a/rel/reltool.config +++ b/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, diff --git a/src/emqtt.app.src b/src/emqtt.app.src index 78b19534e..01b94fa0a 100644 --- a/src/emqtt.app.src +++ b/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, diff --git a/src/emqtt_client.erl b/src/emqtt_client.erl index 8133fadc1..ee3085cbf 100644 --- a/src/emqtt_client.erl +++ b/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}), diff --git a/src/emqtt_topic.erl b/src/emqtt_topic.erl index d6259d1be..407126ab7 100644 --- a/src/emqtt_topic.erl +++ b/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).