Explorar o código

Fix testcases for new object field protocol

terry-xiaoyu %!s(int64=6) %!d(string=hai) anos
pai
achega
eb0826ef3f
Modificáronse 3 ficheiros con 3 adicións e 0 borrados
  1. 1 0
      src/emqx_connection.erl
  2. 1 0
      src/emqx_ws_connection.erl
  3. 1 0
      test/emqx_channel_SUITE.erl

+ 1 - 0
src/emqx_connection.erl

@@ -180,6 +180,7 @@ init({Transport, RawSocket, Options}) ->
     ChanState = emqx_channel:init(#{peername => Peername,
                                     sockname => Sockname,
                                     peercert => Peercert,
+                                    protocol => mqtt,
                                     conn_mod => ?MODULE}, Options),
     IdleTimout = emqx_zone:get_env(Zone, idle_timeout, 30000),
     State = #connection{transport    = Transport,

+ 1 - 0
src/emqx_ws_connection.erl

@@ -181,6 +181,7 @@ websocket_init([Req, Opts]) ->
                                     sockname  => Sockname,
                                     peercert  => Peercert,
                                     ws_cookie => WsCookie,
+                                    protocol  => mqtt,
                                     conn_mod  => ?MODULE
                                    }, Opts),
     Zone = proplists:get_value(zone, Opts),

+ 1 - 0
test/emqx_channel_SUITE.erl

@@ -293,6 +293,7 @@ with_channel(TestFun) ->
                  expiry_interval => 60
                 },
     ClientInfo = #{zone => <<"external">>,
+                   protocol => mqtt,
                    peerhost => {127,0,0,1},
                    client_id => <<"clientid">>,
                    username => <<"username">>,