Skip to content

Commit

Permalink
*) Bugfix: calling close must not close the wrapped input stream, oth…
Browse files Browse the repository at this point in the history
…erwise

   keep-alive connections would terminate

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2853 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Oct 24, 2006
1 parent d38ef04 commit 88cfdec
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions source/de/anomic/http/httpContentLengthInputStream.java
Expand Up @@ -66,11 +66,20 @@ public boolean isClosed() {
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 {
if (!this.closed) {
this.closed = true;
super.close();
}
if (!this.closed) {
try {
// read to the end of the stream and throw read bytes away
httpChunkedInputStream.exhaustInputStream(this);
} finally {
this.closed = true;
}
}
}

public int read() throws IOException {
Expand Down

0 comments on commit 88cfdec

Please sign in to comment.