From f44a2c07039e9f86fbc5927f6ba097d9d42b3e21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 13 Jan 2015 20:49:30 +0100 Subject: [PATCH] Search for the connection before removing it. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index ca91805..f7b0595 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -569,8 +569,8 @@ public class Core extends AbstractExecutionThreadService { */ @Subscribe public void connectionClosed(ConnectionClosed connectionClosed) { - removeConnection(connectionClosed.connection()); connectionBackoff.connectionFailed(getNetwork(connectionClosed.connection()).get()); + removeConnection(connectionClosed.connection()); eventBus.post(new GenericMessage(String.format("Connection closed by %s.", connectionClosed.connection().hostname()))); } @@ -582,8 +582,8 @@ public class Core extends AbstractExecutionThreadService { */ @Subscribe public void connectionFailed(ConnectionFailed connectionFailed) { - removeConnection(connectionFailed.connection()); connectionBackoff.connectionFailed(getNetwork(connectionFailed.connection()).get()); + removeConnection(connectionFailed.connection()); eventBus.post(new GenericMessage(String.format("Could not connect to %s: %s.", connectionFailed.connection().hostname(), connectionFailed.cause()))); } -- 2.7.4