stop when badmsg, badinfo

This commit is contained in:
Ery Lee 2015-01-14 13:34:07 +08:00
parent 22797172a4
commit 85be3eef49
1 changed files with 4 additions and 5 deletions

View File

@ -184,8 +184,8 @@ handle_call({unsubscribe, Topics}, _From, State) ->
{ok, NewState} = unsubscribe(State, Topics), {ok, NewState} = unsubscribe(State, Topics),
{reply, ok, NewState}; {reply, ok, NewState};
handle_call(_Request, _From, State) -> handle_call(Req, _From, State) ->
{reply, ok, State}. {stop, {badreq, Req}, State}.
handle_cast({publish, ?QOS_2, Message}, State) -> handle_cast({publish, ?QOS_2, Message}, State) ->
NewState = publish(State, {?QOS_2, Message}), NewState = publish(State, {?QOS_2, Message}),
@ -210,8 +210,8 @@ handle_cast({pubcomp, PacketId}, State) ->
handle_cast(Msg, State) -> handle_cast(Msg, State) ->
{stop, {badmsg, Msg}, State}. {stop, {badmsg, Msg}, State}.
handle_info(_Info, State) -> handle_info(Info, State) ->
{noreply, State}. {stop, {badinfo, Info}, State}.
terminate(_Reason, _State) -> terminate(_Reason, _State) ->
ok. ok.
@ -224,4 +224,3 @@ code_change(_OldVsn, State, _Extra) ->
%% ------------------------------------------------------------------ %% ------------------------------------------------------------------