From: David ‘Bombe’ Roden Date: Fri, 10 Jul 2015 12:20:39 +0000 (+0200) Subject: Parse CloseConnectionDuplicateClientName without identifier X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=05ad35b5401d5cf36e2436b353d9bc0f81a2f248;p=jFCPlib.git Parse CloseConnectionDuplicateClientName without identifier --- 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) { }