*) Bugfix: calling close must not close the wrapped input stream, otherwise

keep-alive connections would terminate

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2853 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 18 years ago
parent d38ef0493d
commit 88cfdecd38

@ -66,11 +66,20 @@ public class httpContentLengthInputStream extends httpdByteCountInputStream {
return this.closed; return this.closed;
} }
/**
* Closes this input stream.
* <b>Attention:</b> This does not close the wrapped input stream, because
* otherwise keep-alive connections would terminate
*/
public void close() throws IOException { public void close() throws IOException {
if (!this.closed) { if (!this.closed) {
this.closed = true; try {
super.close(); // read to the end of the stream and throw read bytes away
} httpChunkedInputStream.exhaustInputStream(this);
} finally {
this.closed = true;
}
}
} }
public int read() throws IOException { public int read() throws IOException {

Loading…
Cancel
Save