Author: remy.maucherat(a)jboss.com
Date: 2013-12-12 09:14:59 -0500 (Thu, 12 Dec 2013)
New Revision: 2327
Modified:
branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java
branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java
branches/7.4.x/src/main/java/org/apache/catalina/connector/Request.java
Log:
Reset the (kinda new) EOF flag when restoring the request body.
Modified:
branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
---
branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java 2013-12-10
17:43:48 UTC (rev 2326)
+++
branches/7.4.x/src/main/java/org/apache/catalina/authenticator/FormAuthenticator.java 2013-12-12
14:14:59 UTC (rev 2327)
@@ -518,22 +518,17 @@
ByteChunk body = saved.getBody();
if (body != null) {
- request.clearParameters();
- request.getCoyoteRequest().action
- (ActionCode.ACTION_REQ_SET_BODY_REPLAY, body);
-
+ request.resetBody();
+ request.getCoyoteRequest().action(ActionCode.ACTION_REQ_SET_BODY_REPLAY,
body);
// Set content type
MessageBytes contentType = MessageBytes.newInstance();
-
//If no content type specified, use default for POST
String savedContentType = saved.getContentType();
if (savedContentType == null &&
"POST".equalsIgnoreCase(method)) {
savedContentType = "application/x-www-form-urlencoded";
}
-
contentType.setString(savedContentType);
request.getCoyoteRequest().setContentType(contentType);
-
} else {
// Restore the parameters.
Iterator params = saved.getParameterNames();
Modified: branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java 2013-12-10
17:43:48 UTC (rev 2326)
+++ branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java 2013-12-12
14:14:59 UTC (rev 2327)
@@ -276,6 +276,14 @@
}
+ /**
+ * Reset the eof state.
+ */
+ public void resetEof() {
+ eof = false;
+ }
+
+
public int available() {
if (eof || closed) {
return -1;
Modified: branches/7.4.x/src/main/java/org/apache/catalina/connector/Request.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/catalina/connector/Request.java 2013-12-10
17:43:48 UTC (rev 2326)
+++ branches/7.4.x/src/main/java/org/apache/catalina/connector/Request.java 2013-12-12
14:14:59 UTC (rev 2327)
@@ -627,8 +627,7 @@
/**
* Return true if the EOF has been reached.
*/
- public boolean isEof()
- throws IOException {
+ public boolean isEof() {
return (inputBuffer.isEof());
}
@@ -1876,8 +1875,9 @@
/**
* Clear the collection of parameters associated with this Request.
*/
- public void clearParameters() {
+ public void resetBody() {
parametersParsed = false;
+ inputBuffer.resetEof();
}
Show replies by date