Author: csutherl
Date: 2015-04-30 09:48:00 -0400 (Thu, 30 Apr 2015)
New Revision: 2615
Modified:
tags/JBOSSWEB_2_1_12_GA_patch03/
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
Reverse merging 2610 from the release tag.
Property changes on: tags/JBOSSWEB_2_1_12_GA_patch03
___________________________________________________________________
Deleted: svn:mergeinfo
- /branches/2.1.x:2609
Modified:
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
---
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30
13:31:09 UTC (rev 2614)
+++
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30
13:48:00 UTC (rev 2615)
@@ -101,11 +101,6 @@
*/
protected boolean needCRLFParse = false;
- /**
- * Flag that indicates if an error has occurred.
- */
- private boolean error;
-
// ------------------------------------------------------------- Properties
@@ -127,8 +122,6 @@
if (endChunk)
return -1;
- checkError();
-
if (needCRLFParse) {
needCRLFParse = false;
// FIXME: parse CRLF could return 0 in NB
@@ -228,7 +221,6 @@
lastValid = 0;
endChunk = false;
needCRLFParse = false;
- error = false;
}
@@ -283,7 +275,6 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
- error = true;
throw new IOException("Invalid chunk header");
} else if (n == 0) {
return false;
@@ -295,9 +286,6 @@
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
- } else if (buf[pos] < 0) {
- error = true;
- throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos]] != -1) {
@@ -307,7 +295,6 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
- error = true;
throw new IOException("Invalid chunk header");
}
}
@@ -316,10 +303,8 @@
}
- if (readDigit == 0 || (result < 0)) {
- error = true;
+ if (!readDigit || (result < 0))
throw new IOException("Invalid chunk header");
- }
if (result == 0)
endChunk = true;
@@ -343,26 +328,17 @@
while (!eol) {
if (pos >= lastValid) {
- if (readBytes() <= 0) {
- error = true;
+ if (readBytes() <= 0)
throw new IOException("Invalid CRLF");
- }
}
if (buf[pos] == Constants.CR) {
- if (crfound) {
- error = true;
- throw new IOException("Invalid CRLF, two CR characters
encountered.");
- }
+ if (crfound) throw new IOException("Invalid CRLF, two CR characters
encountered.");
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) {
- error = true;
- throw new IOException("Invalid CRLF, no CR character
encountered.");
- }
+ if (!crfound) throw new IOException("Invalid CRLF, no CR character
encountered.");
eol = true;
} else {
- error = true;
throw new IOException("Invalid CRLF");
}
@@ -386,11 +362,5 @@
}
-
- private void checkError() throws IOException {
- if (error) {
- throw new IOException("Chunked input filter error");
- }
- }
}
Show replies by date