Просмотр исходного кода

fix(gw): fix bad conn property type

JianBo He 3 лет назад
Родитель
Сommit
5d362eeb60

+ 1 - 1
apps/emqx_gateway/src/coap/emqx_coap_channel.erl

@@ -579,7 +579,7 @@ ensure_connected(
     }
     }
 ) ->
 ) ->
     NConnInfo = ConnInfo#{connected_at => erlang:system_time(millisecond)},
     NConnInfo = ConnInfo#{connected_at => erlang:system_time(millisecond)},
-    _ = run_hooks(Ctx, 'client.connack', [NConnInfo, connection_accepted, []]),
+    _ = run_hooks(Ctx, 'client.connack', [NConnInfo, connection_accepted, #{}]),
     ok = run_hooks(Ctx, 'client.connected', [ClientInfo, NConnInfo]),
     ok = run_hooks(Ctx, 'client.connected', [ClientInfo, NConnInfo]),
     Channel#channel{conninfo = NConnInfo, conn_state = connected}.
     Channel#channel{conninfo = NConnInfo, conn_state = connected}.
 
 

+ 2 - 2
apps/emqx_gateway/src/stomp/emqx_stomp_channel.erl

@@ -417,10 +417,10 @@ handle_in(Packet = ?PACKET(?CMD_CONNECT), Channel) ->
         emqx_misc:pipeline(
         emqx_misc:pipeline(
             [
             [
                 fun enrich_conninfo/2,
                 fun enrich_conninfo/2,
-                fun run_conn_hooks/2,
                 fun negotiate_version/2,
                 fun negotiate_version/2,
                 fun enrich_clientinfo/2,
                 fun enrich_clientinfo/2,
                 fun assign_clientid_to_conninfo/2,
                 fun assign_clientid_to_conninfo/2,
+                fun run_conn_hooks/2,
                 fun set_log_meta/2,
                 fun set_log_meta/2,
                 %% TODO: How to implement the banned in the gateway instance?
                 %% TODO: How to implement the banned in the gateway instance?
                 %, fun check_banned/2
                 %, fun check_banned/2
@@ -755,7 +755,7 @@ handle_out(
     }
     }
 ) ->
 ) ->
     %% XXX: connection_accepted is not defined by stomp protocol
     %% XXX: connection_accepted is not defined by stomp protocol
-    _ = run_hooks(Ctx, 'client.connack', [ConnInfo, connection_accepted, []]),
+    _ = run_hooks(Ctx, 'client.connack', [ConnInfo, connection_accepted, #{}]),
     Replies = [
     Replies = [
         {outgoing, connected_frame(Headers)},
         {outgoing, connected_frame(Headers)},
         {event, connected}
         {event, connected}