Commit bdc69ab5 authored by Dave Cridland's avatar Dave Cridland

OF-983 Do not bounce packets while lock is held

OF-983 appears to be caused by a complex bouncing process run while the
authentication check lock is held. This patch moves the actual bounce to
outside the synchronized block, so the code no longer deadlocks.

Untested, but based on the stack traces in OF-983 reports.
parent 09a11a0c
......@@ -590,17 +590,20 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
@Override
boolean canProcess(Packet packet) {
String senderDomain = packet.getFrom().getDomain();
boolean processed = true;
if (!getAuthenticatedDomains().contains(senderDomain)) {
synchronized (senderDomain.intern()) {
if (!getAuthenticatedDomains().contains(senderDomain) &&
!authenticateSubdomain(senderDomain, packet.getTo().getDomain())) {
// Return error since sender domain was not validated by remote server
returnErrorToSender(packet);
return false;
processed = false;
}
}
}
return true;
if (!processed) {
returnErrorToSender(packet);
}
return processed;
}
@Override
......
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