X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FFcpConnection.java;h=b7129b7d64ddcff12753f4cbe57fd524da62c628;hb=e0d4c56493b97a16514ca865cad0ae42a2d8a5a2;hp=a80c6100269f4267a4e5cdf1d2592cbd0b9f5c4e;hpb=5d8be52616c65515b440313aa5b8e954eb426fd2;p=jFCPlib.git diff --git a/src/net/pterodactylus/fcp/FcpConnection.java b/src/net/pterodactylus/fcp/FcpConnection.java index a80c610..b7129b7 100644 --- a/src/net/pterodactylus/fcp/FcpConnection.java +++ b/src/net/pterodactylus/fcp/FcpConnection.java @@ -1,6 +1,5 @@ /* - * jSite2 - FpcConnection.java - - * Copyright © 2008 David Roden + * jFCPlib - FpcConnection.java - Copyright © 2008 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -309,6 +308,8 @@ public class FcpConnection implements Closeable { fcpListenerManager.fireReceivedNodeHello(new NodeHello(fcpMessage)); } else if ("CloseConnectionDuplicateClientName".equals(messageName)) { fcpListenerManager.fireReceivedCloseConnectionDuplicateClientName(new CloseConnectionDuplicateClientName(fcpMessage)); + } else if ("ReceivedBookmarkFeed".equals(messageName)) { + fcpListenerManager.fireReceivedBookmarkFeed(new ReceivedBookmarkFeed(fcpMessage)); } else { fcpListenerManager.fireMessageReceived(fcpMessage); } @@ -337,8 +338,8 @@ public class FcpConnection implements Closeable { // /** - * Incremets the counter in {@link #incomingMessageStatistics} by 1 - * for the given message name. + * Incremets the counter in {@link #incomingMessageStatistics} by + * 1 for the given message name. * * @param name * The name of the message to count @@ -359,7 +360,7 @@ public class FcpConnection implements Closeable { * The length of the stream * @return The limited input stream */ - private LimitedInputStream getInputStream(long dataLength) { + private synchronized LimitedInputStream getInputStream(long dataLength) { if (dataLength <= 0) { return new LimitedInputStream(null, 0); } @@ -482,7 +483,7 @@ public class FcpConnection implements Closeable { * @throws IOException * if an I/O error occurs */ - public void consume() throws IOException { + public synchronized void consume() throws IOException { while (remaining > 0) { skip(remaining); }