/**
* Handles an FCP connection to a node.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
/**
* Creates a new connection handler that operates on the given connection
* and input stream.
- *
+ *
* @param fcpConnection
* The underlying FCP connection
* @param remoteInputStream
*/
public void run() {
FcpMessage fcpMessage = null;
+ Throwable throwable = null;
while (true) {
synchronized (this) {
if (shouldStop) {
assert fcpMessage != null: "fcp message is null";
fcpMessage.setField(field, value);
} catch (IOException e) {
+ throwable = null;
break;
}
}
- fcpConnection.handleDisconnect();
+ fcpConnection.handleDisconnect(throwable);
}
/**
/**
* 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