mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +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),
|
||||
{next_state, stream_established, StateData};
|
||||
_ ->
|
||||
send_element(StateData,
|
||||
#xmlel{ns = ?NS_XMPP, name = 'error', children = [
|
||||
#xmlcdata{cdata = <<"Invalid Handshake">>}]}),
|
||||
TextEl =
|
||||
#xmlel{ns = ?NS_STANZA_ERRORS,
|
||||
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()),
|
||||
{stop, normal, StateData}
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user