Correct regression caused by connector re-factoring that meant that sendfile data...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 6 Jul 2011 15:05:45 +0000 (15:05 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 6 Jul 2011 15:05:45 +0000 (15:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1143457 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/AbstractHttp11Processor.java
java/org/apache/coyote/http11/Http11AprProcessor.java
java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/coyote/http11/Http11Processor.java
webapps/docs/changelog.xml

index 78bfc74..c1aa4b0 100644 (file)
@@ -776,6 +776,9 @@ public abstract class AbstractHttp11Processor extends AbstractProcessor {
         http09 = false;
         contentDelimitation = false;
         expectation = false;
+        
+        prepareRequestInternal();
+
         if (endpoint.isSSLEnabled()) {
             request.scheme().setString("https");
         }
@@ -971,6 +974,12 @@ public abstract class AbstractHttp11Processor extends AbstractProcessor {
 
 
     /**
+     * Connector implementation specific request preparation. Ideally, this will
+     * go away in the future.
+     */
+    protected abstract void prepareRequestInternal();
+    
+    /**
      * When committing the response, we have to validate the set of headers, as
      * well as setup the response filters.
      */
index 0d4cb6b..56f9ef3 100644 (file)
@@ -621,6 +621,11 @@ public class Http11AprProcessor extends AbstractHttp11Processor {
 
 
     @Override
+    protected void prepareRequestInternal() {
+        sendfileData = null;
+    }
+
+    @Override
     protected boolean prepareSendfile(OutputFilter[] outputFilters) {
         String fileName = (String) request.getAttribute(
                 "org.apache.tomcat.sendfile.filename");
index c277eab..ecb0415 100644 (file)
@@ -676,6 +676,11 @@ public class Http11NioProcessor extends AbstractHttp11Processor {
 
 
     @Override
+    protected void prepareRequestInternal() {
+        sendfileData = null;
+    }
+
+    @Override
     protected boolean prepareSendfile(OutputFilter[] outputFilters) {
         String fileName = (String) request.getAttribute(
                 "org.apache.tomcat.sendfile.filename");
index 852eba4..e332e71 100644 (file)
@@ -582,6 +582,11 @@ public class Http11Processor extends AbstractHttp11Processor {
 
 
     @Override
+    protected void prepareRequestInternal() {
+        // NOOP for BIO
+    }
+
+    @Override
     protected boolean prepareSendfile(OutputFilter[] outputFilters) {
         // Should never, ever call this code
         Exception e = new Exception();
index 4b3e50b..7c1e821 100644 (file)
         Correct regression caused by connector re-factoring that made AJP
         APR/native connector very unstable on Windows platforms. (markt)
       </fix>
+      <fix>
+        Correct regression caused by connector re-factoring that meant that
+        sendfile data was not reset between pipe-lined HTTP requests. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Tribes">