*) Bugfix for problems with charset detection

See: http://www.yacy-forum.de/viewtopic.php?p=26196

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2708 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent db294687ea
commit 1c0e65f55f

@ -91,7 +91,10 @@ public class htmlFilterInputStream extends InputStream implements htmlFilterEven
// don't close writer here, otherwise it will shutdown our source stream
// reset the buffer if not already done
if (this.mode != MODE_PRESCAN_FINISHED) this.bufferedIn.reset();
if (this.mode != MODE_PRESCAN_FINISHED) {
this.mode++;
this.bufferedIn.reset();
}
// return scanning result
return (this.charsetChanged) ? this.detectedCharset : null;
@ -100,9 +103,7 @@ public class htmlFilterInputStream extends InputStream implements htmlFilterEven
public int read() throws IOException {
// mode 0 is called from within the detectCharset function
if (this.mode == MODE_PRESCAN) {
if (this.endOfHead || this.charsetChanged || this.preRead >= this.preBufferSize) {
this.mode++;
this.bufferedIn.reset();
if (this.endOfHead || this.charsetChanged || this.preRead >= this.preBufferSize-1) {
return -1;
}
this.preRead++;

Loading…
Cancel
Save