projects
/
jSite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add “reset edition” button
[jSite.git]
/
src
/
de
/
todesbaum
/
util
/
freenet
/
fcp2
/
Connection.java
diff --git
a/src/de/todesbaum/util/freenet/fcp2/Connection.java
b/src/de/todesbaum/util/freenet/fcp2/Connection.java
index
1109aec
..
9932d25
100644
(file)
--- a/
src/de/todesbaum/util/freenet/fcp2/Connection.java
+++ b/
src/de/todesbaum/util/freenet/fcp2/Connection.java
@@
-31,6
+31,7
@@
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
+import de.todesbaum.util.io.Closer;
import de.todesbaum.util.io.LineInputStream;
import de.todesbaum.util.io.StreamCopier;
import de.todesbaum.util.io.TempFileInputStream;
import de.todesbaum.util.io.LineInputStream;
import de.todesbaum.util.io.StreamCopier;
import de.todesbaum.util.io.TempFileInputStream;
@@
-253,7
+254,13
@@
public class Connection {
nodeWriter.write("EndMessage" + Command.LINEFEED);
nodeWriter.flush();
if (command.hasPayload()) {
nodeWriter.write("EndMessage" + Command.LINEFEED);
nodeWriter.flush();
if (command.hasPayload()) {
- StreamCopier.copy(command.getPayload(), nodeOutputStream, command.getPayloadLength());
+ InputStream payloadInputStream = null;
+ try {
+ payloadInputStream = command.getPayload();
+ StreamCopier.copy(payloadInputStream, nodeOutputStream, command.getPayloadLength());
+ } finally {
+ Closer.close(payloadInputStream);
+ }
nodeOutputStream.flush();
}
}
nodeOutputStream.flush();
}
}
@@
-294,7
+301,7
@@
public class Connection {
Message message = null;
while (line != null) {
line = nodeReader.readLine();
Message message = null;
while (line != null) {
line = nodeReader.readLine();
- System.err.println("> " + line);
+
//
System.err.println("> " + line);
if (line == null) {
break;
}
if (line == null) {
break;
}