Author: markt
Date: Fri Aug 12 15:17:50 2011
New Revision: 1157151
URL: http://svn.apache.org/viewvc?rev=1157151&view=rev
Log:
Push down inputStream as it is only used by BIO
Modified:
tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java
Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1157151&r1=1157150&r2=1157151&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri Aug
12 15:17:50 2011
@@ -17,7 +17,6 @@
package org.apache.coyote.http11;
import java.io.IOException;
-import java.io.InputStream;
import org.apache.coyote.InputBuffer;
import org.apache.coyote.Request;
@@ -137,12 +136,6 @@ public abstract class AbstractInputBuffe
/**
- * Underlying input stream.
- */
- protected InputStream inputStream;
-
-
- /**
* Underlying input buffer.
*/
protected InputBuffer inputStreamInputBuffer;
@@ -171,28 +164,6 @@ public abstract class AbstractInputBuffe
/**
- * Set the underlying socket input stream.
- */
- public void setInputStream(InputStream inputStream) {
-
- // FIXME: Check for null ?
-
- this.inputStream = inputStream;
-
- }
-
-
- /**
- * Get the underlying socket input stream.
- */
- public InputStream getInputStream() {
-
- return inputStream;
-
- }
-
-
- /**
* Add an input filter to the filter library.
*/
public void addFilter(InputFilter filter) {
@@ -271,7 +242,6 @@ public abstract class AbstractInputBuffe
// Recycle Request object
request.recycle();
- inputStream = null;
lastValid = 0;
pos = 0;
lastActiveFilter = -1;
Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java?rev=1157151&r1=1157150&r2=1157151&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java Fri Aug
12 15:17:50 2011
@@ -18,6 +18,7 @@ package org.apache.coyote.http11;
import java.io.EOFException;
import java.io.IOException;
+import java.io.InputStream;
import java.nio.charset.Charset;
import org.apache.coyote.InputBuffer;
@@ -39,6 +40,12 @@ public class InternalInputBuffer extends
/**
+ * Underlying input stream.
+ */
+ protected InputStream inputStream;
+
+
+ /**
* Default constructor.
*/
public InternalInputBuffer(Request request, int headerBufferSize) {
@@ -59,6 +66,29 @@ public class InternalInputBuffer extends
}
+
+ /**
+ * Set the underlying socket input stream.
+ */
+ public void setInputStream(InputStream inputStream) {
+
+ // FIXME: Check for null ?
+
+ this.inputStream = inputStream;
+
+ }
+
+
+ /**
+ * Get the underlying socket input stream.
+ */
+ public InputStream getInputStream() {
+
+ return inputStream;
+
+ }
+
+
/**
* Read the request line. This function is meant to be used during the
* HTTP request header parsing. Do NOT attempt to read the request body
@@ -428,6 +458,13 @@ public class InternalInputBuffer extends
}
+ @Override
+ public void recycle() {
+ super.recycle();
+ inputStream = null;
+ }
+
+
// ------------------------------------------------------ Protected Methods
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]