0.1.5 bug fix
This commit is contained in:
parent
3979c83550
commit
3626979e31
9
CHANGES
9
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
|
Changes with emqtt 0.1.4 04 Jan 2012
|
||||||
|
|
||||||
*) Bugfix: fix "mosquitto_sub -q 2 ......" bug
|
*) 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
|
Changes with emqtt 0.1.3 04 Jan 2012
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{lib_dirs, ["../..", "../lib", "../plugins"]},
|
{lib_dirs, ["../..", "../lib", "../plugins"]},
|
||||||
{erts, [{mod_cond, derived}, {app_file, strip}]},
|
{erts, [{mod_cond, derived}, {app_file, strip}]},
|
||||||
{app_file, strip},
|
{app_file, strip},
|
||||||
{rel, "emqtt", "0.1.2",
|
{rel, "emqtt", "0.1.5",
|
||||||
[
|
[
|
||||||
kernel,
|
kernel,
|
||||||
stdlib,
|
stdlib,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{application, emqtt,
|
{application, emqtt,
|
||||||
[
|
[
|
||||||
{description, "erlang mqtt broker"},
|
{description, "erlang mqtt broker"},
|
||||||
{vsn, "0.1.4"},
|
{vsn, "0.1.5"},
|
||||||
{modules, [
|
{modules, [
|
||||||
emqtt,
|
emqtt,
|
||||||
emqtt_app,
|
emqtt_app,
|
||||||
|
|
|
@ -100,7 +100,7 @@ handle_info({route, Msg}, #state{socket = Sock, message_id=MsgId} = State) ->
|
||||||
topic = Topic,
|
topic = Topic,
|
||||||
dup = Dup,
|
dup = Dup,
|
||||||
payload = Payload} = Msg,
|
payload = Payload} = Msg,
|
||||||
|
|
||||||
Frame = #mqtt_frame{
|
Frame = #mqtt_frame{
|
||||||
fixed = #mqtt_frame_fixed{type = ?PUBLISH,
|
fixed = #mqtt_frame_fixed{type = ?PUBLISH,
|
||||||
qos = Qos,
|
qos = Qos,
|
||||||
|
@ -291,7 +291,6 @@ process_request(?PUBREC, #mqtt_frame{
|
||||||
|
|
||||||
process_request(?PUBREL,
|
process_request(?PUBREL,
|
||||||
#mqtt_frame{
|
#mqtt_frame{
|
||||||
fixed = #mqtt_frame_fixed{ qos = ?QOS_1 },
|
|
||||||
variable = #mqtt_frame_publish{message_id = MsgId}},
|
variable = #mqtt_frame_publish{message_id = MsgId}},
|
||||||
State=#state{socket=Sock}) ->
|
State=#state{socket=Sock}) ->
|
||||||
erase({msg, MsgId}),
|
erase({msg, MsgId}),
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
%%
|
%%
|
||||||
-module(emqtt_topic).
|
-module(emqtt_topic).
|
||||||
|
|
||||||
|
-import(lists, [reverse/1]).
|
||||||
|
|
||||||
-import(string, [rchr/2, substr/2, substr/3]).
|
-import(string, [rchr/2, substr/2, substr/3]).
|
||||||
|
|
||||||
%% ------------------------------------------------------------------------
|
%% ------------------------------------------------------------------------
|
||||||
|
@ -113,13 +115,13 @@ words(Topic) when is_list(Topic) ->
|
||||||
words(Topic, [], []).
|
words(Topic, [], []).
|
||||||
|
|
||||||
words([], Word, ResAcc) ->
|
words([], Word, ResAcc) ->
|
||||||
lists:reverse([Word|ResAcc]);
|
reverse([reverse(W) || W <- [Word|ResAcc]]);
|
||||||
|
|
||||||
words([$/|Topic], Word, ResAcc) ->
|
words([$/|Topic], Word, ResAcc) ->
|
||||||
words(Topic, [], [Word|ResAcc]);
|
words(Topic, [], [Word|ResAcc]);
|
||||||
|
|
||||||
words([C|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);
|
||||||
valid(Words) -> valid2(Words).
|
valid(Words) -> valid2(Words).
|
||||||
|
|
Loading…
Reference in New Issue