From d09c1e793db490ac2339b048b35bf47257a2dd56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 22 May 2009 07:10:33 +0200 Subject: [PATCH] Make synchronization more consistent. --- src/net/pterodactylus/fcp/FcpConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/pterodactylus/fcp/FcpConnection.java b/src/net/pterodactylus/fcp/FcpConnection.java index a80c610..e9db700 100644 --- a/src/net/pterodactylus/fcp/FcpConnection.java +++ b/src/net/pterodactylus/fcp/FcpConnection.java @@ -359,7 +359,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 +482,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); } -- 2.7.4