fix: subscribe api crash with bad qos.
This commit is contained in:
parent
479507b96a
commit
2be97a24dd
|
@ -48,6 +48,7 @@ File format:
|
|||
* Prompt user how to change the dashboard's initial default password when emqx start.
|
||||
* Fix errno=13 'Permission denied' Cannot create FIFO boot error in Amazon Linux 2022 (el8 package)
|
||||
* Fix user or appid created, name only allow `^[A-Za-z]+[A-Za-z0-9-_]*$`
|
||||
* Fix subscribe http api crash by bad_qos `/mqtt/subscribe`,`/mqtt/subscribe_batch`.
|
||||
|
||||
## v4.3.12
|
||||
### Important changes
|
||||
|
|
|
@ -31,5 +31,6 @@
|
|||
-define(ERROR13, 113). %% User already exist
|
||||
-define(ERROR14, 114). %% OldPassword error
|
||||
-define(ERROR15, 115). %% bad topic
|
||||
-define(ERROR16, 116). %% bad QoS
|
||||
|
||||
-define(VERSIONS, ["4.0", "4.1", "4.2", "4.3"]).
|
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_management,
|
||||
[{description, "EMQ X Management API and CLI"},
|
||||
{vsn, "4.3.12"}, % strict semver, bump manually!
|
||||
{vsn, "4.3.13"}, % strict semver, bump manually!
|
||||
{modules, []},
|
||||
{registered, [emqx_management_sup]},
|
||||
{applications, [kernel,stdlib,minirest]},
|
||||
|
|
|
@ -151,6 +151,8 @@ do_subscribe(ClientId, _Topics, _QoS) when not is_binary(ClientId) ->
|
|||
{ok, ?ERROR8, <<"bad clientid: must be string">>};
|
||||
do_subscribe(_ClientId, [], _QoS) ->
|
||||
{ok, ?ERROR15, bad_topic};
|
||||
do_subscribe(_ClientId, _Topic, QoS) when QoS =/= 0 andalso QoS =/= 1 andalso QoS =/= 2 ->
|
||||
{ok, ?ERROR16, bad_qos};
|
||||
do_subscribe(ClientId, Topics, QoS) ->
|
||||
TopicTable = parse_topic_filters(Topics, QoS),
|
||||
case emqx_mgmt:subscribe(ClientId, TopicTable) of
|
||||
|
|
Loading…
Reference in New Issue