Commit 3a4f3598 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Added more debug logging.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1528 b35dd754-fafc-0310-a699-88a17e54d16e
parent d7da1432
......@@ -171,6 +171,8 @@ public class ServerSocketReader extends SocketReader {
*/
private void packetReceived(Packet packet) throws PacketRejectedException {
if (packet.getTo() == null || packet.getFrom() == null) {
Log.debug("Closing IncomingServerSession due to packet with no TO or FROM: " +
packet.toXML());
// Send a stream error saying that the packet includes no TO or FROM
StreamError error = new StreamError(StreamError.Condition.improper_addressing);
connection.deliverRawText(error.toXML());
......@@ -180,6 +182,8 @@ public class ServerSocketReader extends SocketReader {
throw new PacketRejectedException("Packet with no TO or FROM attributes");
}
else if (!((IncomingServerSession) session).isValidDomain(packet.getFrom().getDomain())) {
Log.debug("Closing IncomingServerSession due to packet with invalid domain: " +
packet.toXML());
// Send a stream error saying that the packet includes an invalid FROM
StreamError error = new StreamError(StreamError.Condition.invalid_from);
connection.deliverRawText(error.toXML());
......
......@@ -15,6 +15,7 @@ import org.dom4j.Element;
import org.dom4j.io.XPPPacketReader;
import org.jivesoftware.util.Log;
import java.net.SocketException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
......@@ -98,8 +99,26 @@ public class OutgoingServerSocketReader {
elements.add(doc);
}
}
catch (SocketException e) {
String message = "Finishing Outgoing Server Reader. ";
if (session != null) {
message = message + "Closing session: " + session.toString();
}
else {
message = message + "No session to close.";
}
Log.debug(message, e);
closeSession();
}
catch (Exception e) {
Log.error(e);
String message = "Finishing Outgoing Server Reader. ";
if (session != null) {
message = message + "Closing session: " + session.toString();
}
else {
message = message + "No session to close.";
}
Log.error(message, e);
closeSession();
}
}
......
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