mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
parent
9d9037856c
commit
408f9b515e
@ -146,7 +146,7 @@ handle_cast({iq_pong, JID, timeout}, State) ->
|
|||||||
JID,
|
JID,
|
||||||
case ejabberd_sm:get_session_pid(User, Server, Resource)
|
case ejabberd_sm:get_session_pid(User, Server, Resource)
|
||||||
of
|
of
|
||||||
Pid when is_pid(Pid) -> ejabberd_c2s:close(Pid);
|
Pid when is_pid(Pid) -> ejabberd_c2s:close(Pid, _SendTrailer = false);
|
||||||
_ -> ok
|
_ -> ok
|
||||||
end;
|
end;
|
||||||
_ -> ok
|
_ -> ok
|
||||||
|
@ -271,6 +271,16 @@ handle_cast({send, Pkt}, State) ->
|
|||||||
noreply(send_pkt(State, Pkt));
|
noreply(send_pkt(State, Pkt));
|
||||||
handle_cast(stop, State) ->
|
handle_cast(stop, State) ->
|
||||||
{stop, normal, State};
|
{stop, normal, State};
|
||||||
|
handle_cast({close, SendTrailer}, #{mod := Mod} = State) ->
|
||||||
|
noreply(
|
||||||
|
case is_disconnected(State) of
|
||||||
|
true -> State;
|
||||||
|
false ->
|
||||||
|
State1 = close(State, SendTrailer),
|
||||||
|
try Mod:handle_stream_end({socket, closed}, State1)
|
||||||
|
catch _:undef -> stop(State1)
|
||||||
|
end
|
||||||
|
end);
|
||||||
handle_cast(Cast, #{mod := Mod} = State) ->
|
handle_cast(Cast, #{mod := Mod} = State) ->
|
||||||
noreply(try Mod:handle_cast(Cast, State)
|
noreply(try Mod:handle_cast(Cast, State)
|
||||||
catch _:undef -> State
|
catch _:undef -> State
|
||||||
|
@ -302,6 +302,16 @@ handle_cast({send, Pkt}, State) ->
|
|||||||
noreply(send_pkt(State, Pkt));
|
noreply(send_pkt(State, Pkt));
|
||||||
handle_cast(stop, State) ->
|
handle_cast(stop, State) ->
|
||||||
{stop, normal, State};
|
{stop, normal, State};
|
||||||
|
handle_cast({close, SendTrailer}, #{mod := Mod} = State) ->
|
||||||
|
noreply(
|
||||||
|
case is_disconnected(State) of
|
||||||
|
true -> State;
|
||||||
|
false ->
|
||||||
|
State1 = close(State, SendTrailer),
|
||||||
|
try Mod:handle_stream_end({socket, closed}, State1)
|
||||||
|
catch _:undef -> stop(State1)
|
||||||
|
end
|
||||||
|
end);
|
||||||
handle_cast(Cast, #{mod := Mod} = State) ->
|
handle_cast(Cast, #{mod := Mod} = State) ->
|
||||||
noreply(try Mod:handle_cast(Cast, State)
|
noreply(try Mod:handle_cast(Cast, State)
|
||||||
catch _:undef -> State
|
catch _:undef -> State
|
||||||
|
Loading…
Reference in New Issue
Block a user