From d65be6e7d86faf9c43d3c6768028c3e2a25c8805 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 12 Aug 2011 15:17:50 +0000 Subject: [PATCH] Push down inputStream as it is only used by BIO git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1157151 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/coyote/http11/AbstractInputBuffer.java | 30 ------------------ .../apache/coyote/http11/InternalInputBuffer.java | 37 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/java/org/apache/coyote/http11/AbstractInputBuffer.java b/java/org/apache/coyote/http11/AbstractInputBuffer.java index 7788b87d7..a81d64263 100644 --- a/java/org/apache/coyote/http11/AbstractInputBuffer.java +++ b/java/org/apache/coyote/http11/AbstractInputBuffer.java @@ -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 AbstractInputBuffer implements InputBuffer{ /** - * Underlying input stream. - */ - protected InputStream inputStream; - - - /** * Underlying input buffer. */ protected InputBuffer inputStreamInputBuffer; @@ -171,28 +164,6 @@ public abstract class AbstractInputBuffer implements InputBuffer{ /** - * 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 AbstractInputBuffer implements InputBuffer{ // Recycle Request object request.recycle(); - inputStream = null; lastValid = 0; pos = 0; lastActiveFilter = -1; diff --git a/java/org/apache/coyote/http11/InternalInputBuffer.java b/java/org/apache/coyote/http11/InternalInputBuffer.java index 081fa757a..6c06d74ab 100644 --- a/java/org/apache/coyote/http11/InternalInputBuffer.java +++ b/java/org/apache/coyote/http11/InternalInputBuffer.java @@ -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 AbstractInputBuffer { /** + * Underlying input stream. + */ + protected InputStream inputStream; + + + /** * Default constructor. */ public InternalInputBuffer(Request request, int headerBufferSize) { @@ -59,6 +66,29 @@ public class InternalInputBuffer extends AbstractInputBuffer { } + + /** + * 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 AbstractInputBuffer { } + @Override + public void recycle() { + super.recycle(); + inputStream = null; + } + + // ------------------------------------------------------ Protected Methods -- 2.11.0