X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FFcpConnectionHandler.java;h=2c37e5eace1e1c21f52493d07ae8b3025b9d763c;hb=80d0435162508dc161adb7c0f8b7c2c644ef217c;hp=a8132c31f8a3b03a547d7a45d642e026958b17f1;hpb=930a13cd3640422a0fd23e2952cacf798286f0bc;p=jFCPlib.git diff --git a/src/net/pterodactylus/fcp/FcpConnectionHandler.java b/src/net/pterodactylus/fcp/FcpConnectionHandler.java index a8132c3..2c37e5e 100644 --- a/src/net/pterodactylus/fcp/FcpConnectionHandler.java +++ b/src/net/pterodactylus/fcp/FcpConnectionHandler.java @@ -26,9 +26,8 @@ import java.nio.charset.Charset; /** * Handles an FCP connection to a node. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ class FcpConnectionHandler implements Runnable { @@ -47,7 +46,7 @@ class FcpConnectionHandler implements Runnable { /** * Creates a new connection handler that operates on the given connection * and input stream. - * + * * @param fcpConnection * The underlying FCP connection * @param remoteInputStream @@ -84,7 +83,7 @@ class FcpConnectionHandler implements Runnable { fcpMessage = new FcpMessage(line); continue; } - if ("EndMessage".equals(line)) { + if ("EndMessage".equalsIgnoreCase(line) || "Data".equalsIgnoreCase(line)) { fcpConnection.handleMessage(fcpMessage); fcpMessage = null; } @@ -97,8 +96,8 @@ class FcpConnectionHandler implements Runnable { String value = line.substring(equalSign + 1); assert fcpMessage != null: "fcp message is null"; fcpMessage.setField(field, value); - } catch (IOException e) { - throwable = null; + } catch (IOException ioe1) { + throwable = ioe1; break; } } @@ -121,7 +120,7 @@ class FcpConnectionHandler implements Runnable { /** * Reads bytes from {@link #remoteInputStream} until ‘\r’ or ‘\n’ are * encountered and decodes the read bytes using UTF-8. - * + * * @return The decoded line * @throws IOException * if an I/O error occurs