From: David ‘Bombe’ Roden Date: Wed, 10 Apr 2013 20:56:03 +0000 (+0200) Subject: Make DCC receiver responsive to stop() requests. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4f8c67e3e99c5a7874dd1148d780bbc625b3264c;p=xudocci.git Make DCC receiver responsive to stop() requests. --- diff --git a/src/main/java/net/pterodactylus/irc/DccReceiver.java b/src/main/java/net/pterodactylus/irc/DccReceiver.java index 58dae01..038f66a 100644 --- a/src/main/java/net/pterodactylus/irc/DccReceiver.java +++ b/src/main/java/net/pterodactylus/irc/DccReceiver.java @@ -150,7 +150,7 @@ public class DccReceiver extends AbstractExecutionThreadService { InputStream socketInputStream = socket.getInputStream(); inputStream = new BandwidthCountingInputStream(socketInputStream, 5, TimeUnit.SECONDS); byte[] buffer = new byte[65536]; - while (true) { + while (isRunning()) { int r = inputStream.read(buffer); if (r == -1) { /* yay, eof! */