Author: remy.maucherat(a)jboss.com
Date: 2012-08-29 04:36:47 -0400 (Wed, 29 Aug 2012)
New Revision: 2073
Modified:
trunk/src/main/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
trunk/src/main/java/org/jboss/web/CoyoteMessages.java
Log:
Missing i18n
Modified: trunk/src/main/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
---
trunk/src/main/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2012-08-29
08:10:44 UTC (rev 2072)
+++
trunk/src/main/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2012-08-29
08:36:47 UTC (rev 2073)
@@ -17,6 +17,8 @@
package org.apache.coyote.http11.filters;
+import static org.jboss.web.CoyoteMessages.MESSAGES;
+
import java.io.IOException;
import org.apache.coyote.InputBuffer;
@@ -276,22 +278,22 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
- throw new IOException("Invalid chunk header");
+ throw MESSAGES.invalidChunkHeader();
} else if (n == 0) {
return false;
}
}
if (buf[pos] == Constants.CR) {
- if (crfound) throw new IOException("Invalid CRLF, two CR characters
encountered.");
+ if (crfound) throw MESSAGES.invalidCrlfTwoCr();
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) throw new IOException("Invalid CRLF, no CR character
encountered.");
+ if (!crfound) throw MESSAGES.invalidCrlfNoCr();
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
} else if (buf[pos] < 0) {
- throw new IOException("Invalid chunk header");
+ throw MESSAGES.invalidChunkHeader();
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos] & 0xff] != -1) {
@@ -301,7 +303,7 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
- throw new IOException("Invalid chunk header");
+ throw MESSAGES.invalidChunkHeader();
}
}
@@ -310,7 +312,7 @@
}
if (!readDigit || (result < 0))
- throw new IOException("Invalid chunk header");
+ throw MESSAGES.invalidChunkHeader();
if (result == 0)
endChunk = true;
@@ -335,17 +337,17 @@
if (pos >= lastValid) {
if (readBytes() <= 0)
- throw new IOException("Invalid CRLF");
+ throw MESSAGES.invalidCrlf();
}
if (buf[pos] == Constants.CR) {
- if (crfound) throw new IOException("Invalid CRLF, two CR characters
encountered.");
+ if (crfound) throw MESSAGES.invalidCrlfTwoCr();
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) throw new IOException("Invalid CRLF, no CR character
encountered.");
+ if (!crfound) throw MESSAGES.invalidCrlfNoCr();
eol = true;
} else {
- throw new IOException("Invalid CRLF");
+ throw MESSAGES.invalidCrlf();
}
pos++;
Modified: trunk/src/main/java/org/jboss/web/CoyoteMessages.java
===================================================================
--- trunk/src/main/java/org/jboss/web/CoyoteMessages.java 2012-08-29 08:10:44 UTC (rev
2072)
+++ trunk/src/main/java/org/jboss/web/CoyoteMessages.java 2012-08-29 08:36:47 UTC (rev
2073)
@@ -22,6 +22,8 @@
package org.jboss.web;
+import java.io.IOException;
+
import org.jboss.logging.Cause;
import org.jboss.logging.Message;
import org.jboss.logging.MessageBundle;
@@ -90,4 +92,16 @@
@Message(id = 2016, value = "Backlog is present")
String invalidBacklog();
+ @Message(id = 2017, value = "Invalid CRLF, no CR character encountered")
+ IOException invalidCrlfNoCr();
+
+ @Message(id = 2018, value = "Invalid CRLF, two CR characters encountered")
+ IOException invalidCrlfTwoCr();
+
+ @Message(id = 2019, value = "Invalid CRLF")
+ IOException invalidCrlf();
+
+ @Message(id = 2019, value = "Invalid chunk header")
+ IOException invalidChunkHeader();
+
}
Show replies by date