projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hand reason for disconnects to listeners
[jFCPlib.git]
/
src
/
net
/
pterodactylus
/
fcp
/
FcpConnectionHandler.java
diff --git
a/src/net/pterodactylus/fcp/FcpConnectionHandler.java
b/src/net/pterodactylus/fcp/FcpConnectionHandler.java
index
b6404c5
..
a8132c3
100644
(file)
--- a/
src/net/pterodactylus/fcp/FcpConnectionHandler.java
+++ b/
src/net/pterodactylus/fcp/FcpConnectionHandler.java
@@
-26,7
+26,7
@@
import java.nio.charset.Charset;
/**
* Handles an FCP connection to a node.
/**
* Handles an FCP connection to a node.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
@@
-47,7
+47,7
@@
class FcpConnectionHandler implements Runnable {
/**
* Creates a new connection handler that operates on the given connection
* and input stream.
/**
* Creates a new connection handler that operates on the given connection
* and input stream.
- *
+ *
* @param fcpConnection
* The underlying FCP connection
* @param remoteInputStream
* @param fcpConnection
* The underlying FCP connection
* @param remoteInputStream
@@
-63,6
+63,7
@@
class FcpConnectionHandler implements Runnable {
*/
public void run() {
FcpMessage fcpMessage = null;
*/
public void run() {
FcpMessage fcpMessage = null;
+ Throwable throwable = null;
while (true) {
synchronized (this) {
if (shouldStop) {
while (true) {
synchronized (this) {
if (shouldStop) {
@@
-97,10
+98,11
@@
class FcpConnectionHandler implements Runnable {
assert fcpMessage != null: "fcp message is null";
fcpMessage.setField(field, value);
} catch (IOException e) {
assert fcpMessage != null: "fcp message is null";
fcpMessage.setField(field, value);
} catch (IOException e) {
+ throwable = null;
break;
}
}
break;
}
}
- fcpConnection.handleDisconnect();
+ fcpConnection.handleDisconnect(
throwable
);
}
/**
}
/**
@@
-119,7
+121,7
@@
class FcpConnectionHandler implements Runnable {
/**
* Reads bytes from {@link #remoteInputStream} until ‘\r’ or ‘\n’ are
* encountered and decodes the read bytes using UTF-8.
/**
* 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
* @return The decoded line
* @throws IOException
* if an I/O error occurs