Commit 89418f9f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Send stream:error with conflict condition before closing connection. JM-278


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1309 b35dd754-fafc-0310-a699-88a17e54d16e
parent 518dcd4e
......@@ -28,6 +28,7 @@ import org.jivesoftware.stringprep.StringprepException;
import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.StreamError;
import java.util.ArrayList;
import java.util.List;
......@@ -197,6 +198,9 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
if (conflictLimit != SessionManager.NEVER_KICK && oldSession.getConflictCount() > conflictLimit) {
Connection conn = oldSession.getConnection();
if (conn != null) {
// Send a stream:error before closing the connection
StreamError error = new StreamError(StreamError.Condition.conflict);
conn.getWriter().write(error.toXML());
conn.close();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment