mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Improve stream error stanza when receives invalid handshake from component.
SVN Revision: 2641
This commit is contained in:
parent
75793f7cf4
commit
f4e35033e7
@ -198,9 +198,23 @@ wait_for_handshake({xmlstreamelement, El}, StateData) ->
|
|||||||
end, StateData#state.hosts),
|
end, StateData#state.hosts),
|
||||||
{next_state, stream_established, StateData};
|
{next_state, stream_established, StateData};
|
||||||
_ ->
|
_ ->
|
||||||
send_element(StateData,
|
TextEl =
|
||||||
#xmlel{ns = ?NS_XMPP, name = 'error', children = [
|
#xmlel{ns = ?NS_STANZA_ERRORS,
|
||||||
#xmlcdata{cdata = <<"Invalid Handshake">>}]}),
|
name = 'text',
|
||||||
|
children =
|
||||||
|
[#xmlcdata{cdata = <<"Invalid Handshake">>}]
|
||||||
|
},
|
||||||
|
NotAuthorizedEl =
|
||||||
|
#xmlel{ns = ?NS_STANZA_ERRORS,
|
||||||
|
name = 'not-authorized',
|
||||||
|
children = [TextEl]
|
||||||
|
},
|
||||||
|
InvalidHandshakeEl =
|
||||||
|
#xmlel{ns = ?NS_XMPP,
|
||||||
|
name = 'error',
|
||||||
|
children = [NotAuthorizedEl]
|
||||||
|
},
|
||||||
|
send_element(StateData, InvalidHandshakeEl),
|
||||||
send_element(StateData, exmpp_stream:closing()),
|
send_element(StateData, exmpp_stream:closing()),
|
||||||
{stop, normal, StateData}
|
{stop, normal, StateData}
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user