fix the issue that websocket client cannot subscribe '/queue/#'

This commit is contained in:
Feng Lee 2015-06-01 16:41:59 +08:00
parent dabddbb6d4
commit 8aa2b8fbed
1 changed files with 6 additions and 1 deletions

View File

@ -145,6 +145,10 @@ handle_info({redeliver, {?PUBREL, PacketId}}, #state{proto_state = ProtoState} =
{ok, ProtoState1} = emqttd_protocol:redeliver({?PUBREL, PacketId}, ProtoState), {ok, ProtoState1} = emqttd_protocol:redeliver({?PUBREL, PacketId}, ProtoState),
{noreply, State#state{proto_state = ProtoState1}}; {noreply, State#state{proto_state = ProtoState1}};
handle_info({subscribe, Topic, Qos}, #state{proto_state = ProtoState} = State) ->
{ok, ProtoState1} = emqttd_protocol:handle({subscribe, Topic, Qos}, ProtoState),
{noreply, State#state{proto_state = ProtoState1}};
handle_info({stop, duplicate_id, _NewPid}, State=#state{proto_state = ProtoState}) -> handle_info({stop, duplicate_id, _NewPid}, State=#state{proto_state = ProtoState}) ->
lager:error("Shutdown for duplicate clientid: ~s", [emqttd_protocol:clientid(ProtoState)]), lager:error("Shutdown for duplicate clientid: ~s", [emqttd_protocol:clientid(ProtoState)]),
stop({shutdown, duplicate_id}, State); stop({shutdown, duplicate_id}, State);
@ -169,7 +173,8 @@ handle_info({keepalive, timeout}, State = #state{request = Req, keepalive = Keep
handle_info({'EXIT', WsPid, Reason}, State = #state{ws_pid = WsPid}) -> handle_info({'EXIT', WsPid, Reason}, State = #state{ws_pid = WsPid}) ->
stop(Reason, State); stop(Reason, State);
handle_info(_Info, State) -> handle_info(Info, State = #state{request = Req}) ->
lager:critical("Client(WebSocket) ~s: Unexpected Info - ~p", [Req:get(peer), Info]),
{noreply, State}. {noreply, State}.
terminate(Reason, #state{proto_state = ProtoState, keepalive = KeepAlive}) -> terminate(Reason, #state{proto_state = ProtoState, keepalive = KeepAlive}) ->