0.1.5 bug fix

This commit is contained in:
erylee 2013-01-05 16:21:37 +08:00
parent 3979c83550
commit 3626979e31
5 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,10 @@
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

View File

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

View File

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

View File

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

View File

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