24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-07-27 00:41:28 +02:00

Don't call send_element/2 if previous call failed

Be sure not to try sending data over a TCP socket that is no longer
usable.
This commit is contained in:
Holger Weiss 2015-04-06 22:34:48 +02:00
parent 81b0643036
commit 2a94c68724

View File

@ -2841,8 +2841,12 @@ send_stanza_and_ack_req(StateData, Stanza) ->
AckReq = #xmlel{name = <<"r">>,
attrs = [{<<"xmlns">>, StateData#state.mgmt_xmlns}],
children = []},
send_element(StateData, Stanza),
send_element(StateData, AckReq).
case send_element(StateData, Stanza) of
ok ->
send_element(StateData, AckReq);
error ->
error
end.
mgmt_queue_add(StateData, El) ->
NewNum = case StateData#state.mgmt_stanzas_out of