Review Board 1.7.22


Proposed fix for BZ 50903

Review Request #500 - Created March 13, 2011 and submitted

markt
trunk
https://issues.apache.org/bugzilla/show_bug.cgi?id=50903
Reviewers
tomcat
tomcat-7.0.x
Fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=50903
Currently, if a connector is stopped with an open keep-alive connection, the next request received on that connection will be processed. This patch changes that so the request is not processed and the socket closed.
Includes unit test (executed with BIO)
Manually tested with all 5 connectors.
/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
Revision 1081214 New Change
[20] 180 lines
[+20] [+] protected abstract Log getLog();
181
    /**
181
    /**
182
     * Bytes written to client for the current request
182
     * Bytes written to client for the current request
183
     */
183
     */
184
    protected long byteCount = 0;
184
    protected long byteCount = 0;
185
    
185
    
186
    
186

   

    
   
187
    /**

    
   
188
     * Track if processing for a request has started.

    
   
189
     */

    
   
190
    protected boolean newRequest = true;

    
   
191

   
187
    // ------------------------------------------------------------- Properties
192
    // ------------------------------------------------------------- Properties
188

    
   
193

   
189

    
   
194

   
190
    /**
195
    /**
191
     * Use Tomcat authentication ?
196
     * Use Tomcat authentication ?
[+20] [20] 219 lines
[+20] [+] public void recycle() {
411
       finished = false;
416
       finished = false;
412
       request.recycle();
417
       request.recycle();
413
       response.recycle();
418
       response.recycle();
414
       certificates.recycle();
419
       certificates.recycle();
415
       byteCount = 0;
420
       byteCount = 0;

    
   
421
       newRequest = true;
416
   }
422
   }
417
   
423
   
418
   // ------------------------------------------------------ Connector Methods
424
   // ------------------------------------------------------ Connector Methods
419

    
   
425

   
420

    
   
426

   
[+20] [20] 453 lines
/java/org/apache/coyote/ajp/AjpAprProcessor.java
Revision 1081214 New Change
 
/java/org/apache/coyote/ajp/AjpProcessor.java
Revision 1081214 New Change
 
/java/org/apache/coyote/ajp/LocalStrings.properties
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/AbstractInputBuffer.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/Http11AprProcessor.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/Http11NioProcessor.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/Http11Processor.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/InternalAprInputBuffer.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/InternalInputBuffer.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/InternalNioInputBuffer.java
Revision 1081214 New Change
 
/java/org/apache/coyote/http11/LocalStrings.properties
Revision 1081214 New Change
 
/test/org/apache/catalina/connector/TestConnector.java
New File
 
/test/org/apache/catalina/startup/TesterServlet.java
New File
 
/test/org/apache/catalina/startup/TomcatBaseTest.java
Revision 1081214 New Change
 
/test/org/apache/coyote/http11/TestTbd.java
New File
 
  1. /java/org/apache/coyote/ajp/AbstractAjpProcessor.java: Loading...
  2. /java/org/apache/coyote/ajp/AjpAprProcessor.java: Loading...
  3. /java/org/apache/coyote/ajp/AjpProcessor.java: Loading...
  4. /java/org/apache/coyote/ajp/LocalStrings.properties: Loading...
  5. /java/org/apache/coyote/http11/AbstractInputBuffer.java: Loading...
  6. /java/org/apache/coyote/http11/Http11AprProcessor.java: Loading...
  7. /java/org/apache/coyote/http11/Http11NioProcessor.java: Loading...
  8. /java/org/apache/coyote/http11/Http11Processor.java: Loading...
  9. /java/org/apache/coyote/http11/InternalAprInputBuffer.java: Loading...
  10. /java/org/apache/coyote/http11/InternalInputBuffer.java: Loading...
  11. /java/org/apache/coyote/http11/InternalNioInputBuffer.java: Loading...
  12. /java/org/apache/coyote/http11/LocalStrings.properties: Loading...
  13. /test/org/apache/catalina/connector/TestConnector.java: Loading...
  14. /test/org/apache/catalina/startup/TesterServlet.java: Loading...
  15. /test/org/apache/catalina/startup/TomcatBaseTest.java: Loading...
  16. /test/org/apache/coyote/http11/TestTbd.java: Loading...