From 05ad35b5401d5cf36e2436b353d9bc0f81a2f248 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Jul 2015 14:20:39 +0200 Subject: [PATCH] Parse CloseConnectionDuplicateClientName without identifier --- .../java/net/pterodactylus/fcp/quelaton/FcpReplySequence.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/FcpReplySequence.java b/src/main/java/net/pterodactylus/fcp/quelaton/FcpReplySequence.java index afaac4c..2c2dfe1 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/FcpReplySequence.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/FcpReplySequence.java @@ -126,11 +126,15 @@ public abstract class FcpReplySequence implements AutoCloseable, FcpListener private void consume(Consumer consumer, M message, String identifier) { if (Objects.equals(message.getField(identifier), this.identifier.get())) { - consumer.accept(message); - notifySyncObject(); + consumeAlways(consumer, message); } } + private void consumeAlways(Consumer consumer, M message) { + consumer.accept(message); + notifySyncObject(); + } + private void consumeUnknown(FcpMessage fcpMessage) { if (Objects.equals(fcpMessage.getField("Identifier"), identifier.get())) { consumeUnknownMessage(fcpMessage); @@ -153,7 +157,7 @@ public abstract class FcpReplySequence implements AutoCloseable, FcpListener @Override public final void receivedCloseConnectionDuplicateClientName(FcpConnection fcpConnection, CloseConnectionDuplicateClientName closeConnectionDuplicateClientName) { - consume(this::consumeCloseConnectionDuplicateClientName, closeConnectionDuplicateClientName); + consumeAlways(this::consumeCloseConnectionDuplicateClientName, closeConnectionDuplicateClientName); } protected void consumeCloseConnectionDuplicateClientName(CloseConnectionDuplicateClientName closeConnectionDuplicateClientName) { } -- 2.7.4