fix(stomp): not allow to create same subscriptions
This commit is contained in:
parent
3c91a65804
commit
0483c6afef
|
@ -1,6 +1,6 @@
|
|||
{application, emqx_gateway_stomp, [
|
||||
{description, "Stomp Gateway"},
|
||||
{vsn, "0.1.1"},
|
||||
{vsn, "0.1.2"},
|
||||
{registered, []},
|
||||
{applications, [kernel, stdlib, emqx, emqx_gateway]},
|
||||
{env, []},
|
||||
|
|
|
@ -695,12 +695,15 @@ check_subscribed_status(
|
|||
) ->
|
||||
MountedTopic = emqx_mountpoint:mount(Mountpoint, ParsedTopic),
|
||||
case lists:keyfind(SubId, 1, Subs) of
|
||||
{SubId, MountedTopic, _Ack, _} ->
|
||||
ok;
|
||||
{SubId, _OtherTopic, _Ack, _} ->
|
||||
{SubId, _MountedTopic, _Ack, _} ->
|
||||
{error, subscription_id_inused};
|
||||
false ->
|
||||
case lists:keyfind(MountedTopic, 2, Subs) of
|
||||
{_OtherSubId, MountedTopic, _Ack, _} ->
|
||||
{error, subscription_inused};
|
||||
false ->
|
||||
ok
|
||||
end
|
||||
end.
|
||||
|
||||
check_sub_acl(
|
||||
|
|
Loading…
Reference in New Issue