25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Improve functions calls when closing client connection.

SVN Revision: 2904
This commit is contained in:
Badlop 2010-01-15 12:01:12 +00:00
parent 7aff5defac
commit 3e4858f348

View File

@ -1306,17 +1306,15 @@ handle_info({'DOWN', Monitor, _Type, _Object, _Info}, _StateName, StateData)
{stop, normal, StateData};
handle_info(system_shutdown, StateName, StateData) ->
case StateName of
wait_for_stream ->
Header = io_lib:format(?STREAM_HEADER,
["none", ?MYNAME, " version='1.0'", ""]),
send_text(StateData, Header),
send_element(StateData, ?SERR_SYSTEM_SHUTDOWN),
send_text(StateData, ?STREAM_TRAILER),
ok;
_ ->
send_element(StateData, ?SERR_SYSTEM_SHUTDOWN),
send_text(StateData, ?STREAM_TRAILER),
ok
wait_for_stream ->
send_header(StateData, ?MYNAME, "1.0", "en"),
send_element(StateData, ?SERR_SYSTEM_SHUTDOWN),
send_trailer(StateData),
ok;
_ ->
send_element(StateData, ?SERR_SYSTEM_SHUTDOWN),
send_trailer(StateData),
ok
end,
{stop, normal, StateData};
handle_info(Info, StateName, StateData) ->