Commit b2c6447d authored by Tom Evans's avatar Tom Evans Committed by Dave Cridland

OF-855: Ensure valid connection for session packets

Check the underlying connection for a given session before delivering a
packet; if the connection is missing, clean up session and resend packet
parent 64c735bc
......@@ -854,8 +854,13 @@ public class LocalClientSession extends LocalSession implements ClientSession {
@Override
public void deliver(Packet packet) throws UnauthorizedException {
if (conn != null && !conn.isClosed()) {
if (conn != null) {
conn.deliver(packet);
} else {
// invalid session; clean up and retry delivery (offline)
Log.error("Failed to deliver packet to invalid session (no connection); will retry");
sessionManager.removeSession(this);
XMPPServer.getInstance().getPacketDeliverer().deliver(packet);
}
}
......
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