When client is closed, include the Reason in the stream trailer stanza.

SVN Revision: 2154
This commit is contained in:
Badlop 2009-06-09 12:10:24 +00:00
parent 60f52b2cd8
commit 8de03275c3
1 changed files with 3 additions and 0 deletions

View File

@ -1186,6 +1186,9 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
end,
if
Pass == exit ->
%% When Pass==exit, NewState contains a string instead of a #state{}
Lang = StateData#state.lang,
catch send_element(StateData, exmpp_stream:error('undefined-condition', {Lang, NewState})),
catch send_element(StateData, exmpp_stream:closing()),
{stop, normal, StateData};
Pass ->