Commit 7932ff02 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Close connection of user when a parsing error was found (e.g. user sent a very...

Close connection of user when a parsing error was found (e.g. user sent a very very big stanza). JM-980

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@7155 b35dd754-fafc-0310-a699-88a17e54d16e
parent 444ea38c
...@@ -13,6 +13,7 @@ package org.jivesoftware.wildfire.nio; ...@@ -13,6 +13,7 @@ package org.jivesoftware.wildfire.nio;
import org.apache.mina.common.IdleStatus; import org.apache.mina.common.IdleStatus;
import org.apache.mina.common.IoHandlerAdapter; import org.apache.mina.common.IoHandlerAdapter;
import org.apache.mina.common.IoSession; import org.apache.mina.common.IoSession;
import org.apache.mina.filter.codec.ProtocolDecoderException;
import org.dom4j.io.XMPPPacketReader; import org.dom4j.io.XMPPPacketReader;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.Connection; import org.jivesoftware.wildfire.Connection;
...@@ -100,6 +101,10 @@ public abstract class ConnectionHandler extends IoHandlerAdapter { ...@@ -100,6 +101,10 @@ public abstract class ConnectionHandler extends IoHandlerAdapter {
// TODO Verify if there were packets pending to be sent and decide what to do with them // TODO Verify if there were packets pending to be sent and decide what to do with them
Log.debug(cause); Log.debug(cause);
} }
else if (cause instanceof ProtocolDecoderException) {
Log.warn("Closing session due to exception: " + session, cause);
session.close();
}
else { else {
Log.error(cause); Log.error(cause);
} }
......
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