소스 검색

Fix QoS tuning

Feng Lee 7 년 전
부모
커밋
645c971a07
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 6
      src/emqx_session.erl

+ 4 - 6
src/emqx_session.erl

@@ -758,14 +758,12 @@ dequeue2(State = #state{mqueue = Q}) ->
 tune_qos(Topic, Msg = #message{qos = PubQoS},
 tune_qos(Topic, Msg = #message{qos = PubQoS},
          #state{subscriptions = SubMap, upgrade_qos = UpgradeQoS}) ->
          #state{subscriptions = SubMap, upgrade_qos = UpgradeQoS}) ->
     case maps:find(Topic, SubMap) of
     case maps:find(Topic, SubMap) of
-        {ok, SubQoS} when UpgradeQoS andalso (SubQoS > PubQoS) ->
+        {ok, #{qos := SubQoS}} when UpgradeQoS andalso (SubQoS > PubQoS) ->
             Msg#message{qos = SubQoS};
             Msg#message{qos = SubQoS};
-        {ok, SubQoS} when (not UpgradeQoS) andalso (SubQoS < PubQoS) ->
+        {ok, #{qos := SubQoS}} when (not UpgradeQoS) andalso (SubQoS < PubQoS) ->
             Msg#message{qos = SubQoS};
             Msg#message{qos = SubQoS};
-        {ok, _} ->
-            Msg;
-        error ->
-            Msg
+        {ok, _} -> Msg;
+        error   -> Msg
     end.
     end.
 
 
 %%------------------------------------------------------------------------------
 %%------------------------------------------------------------------------------