Commit 2f783daf authored by Dave Cridland's avatar Dave Cridland

Merge pull request #191 from tevans/OF-888

OF-888: Fix outgoing S2S packet delivery failure
parents c6dd1ae4 c460bc55
......@@ -62,6 +62,7 @@ import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.PacketExtension;
import org.xmpp.packet.Presence;
import com.jcraft.jzlib.JZlib;
......@@ -637,6 +638,14 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
private void returnErrorToSender(Packet packet) {
RoutingTable routingTable = XMPPServer.getInstance().getRoutingTable();
try {
// OF-888 (outgoing S2S failure) Prevent recursion for failed delivery of error response packet
String el = "ext";
String ns = getClass().getName();
if (packet.deleteExtension(el, ns)) {
Log.warn("Failed to route error to sender; remote server not found. Original packet: " + packet);
return;
}
packet.addExtension(new PacketExtension(el, ns));
if (packet instanceof IQ) {
if (((IQ) packet).isResponse()) {
Log.debug("XMPP specs forbid us to respond with an IQ error to: " + packet.toXML());
......
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