Util: Fix corruption of cached ReusableGZIPInputStreams,

caused by calling close() from HTTPResponseOutputStream.Pusher,
but close() rendered the underlying InflaterInputStream unusable.
Broken in -15. Caused failed HTTP fetches and other flakiness.
This commit is contained in:
zzz
2015-05-11 00:08:26 +00:00
parent 7f30f481b2
commit f25d2a3d3f
3 changed files with 20 additions and 1 deletions

View File

@ -168,6 +168,21 @@ public class ResettableGZIPInputStream extends InflaterInputStream {
}
}
/**
* Does NOT call super.close(), as it cannot be reused if we do that.
* Broken before 0.9.20.
* @since 0.9.20
*/
@Override
public void close() throws IOException {
len = 0;
inf.reset();
_complete = false;
_crc32.reset();
_buf1[0] = 0x0;
_extraByteInputStream.close();
}
/**
* Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream
* @since 0.8.9