Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48132
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 5 Nov 2009 01:14:16 +0000 (01:14 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 5 Nov 2009 01:14:16 +0000 (01:14 +0000)
Patch provided by sebb

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@832951 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
java/org/apache/coyote/Request.java
java/org/apache/coyote/ajp/AjpAprProtocol.java
java/org/apache/coyote/ajp/AjpProtocol.java
java/org/apache/coyote/http11/Http11AprProtocol.java
java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/coyote/http11/Http11NioProtocol.java
java/org/apache/coyote/http11/Http11Processor.java
java/org/apache/coyote/http11/Http11Protocol.java
java/org/apache/coyote/http11/InternalInputBuffer.java
java/org/apache/coyote/http11/InternalNioInputBuffer.java
java/org/apache/coyote/http11/InternalNioOutputBuffer.java
java/org/apache/coyote/http11/InternalOutputBuffer.java
java/org/apache/coyote/http11/filters/GzipOutputFilter.java

index 46be435..ebadf5f 100644 (file)
@@ -434,6 +434,7 @@ public final class Request {
 
     // -------------------- debug --------------------
 
+    @Override
     public String toString() {
         return "R( " + requestURI().toString() + ")";
     }
index 7393a6f..08fd4d5 100644 (file)
@@ -327,6 +327,7 @@ public class AjpAprProtocol
         protected ConcurrentLinkedQueue<AjpAprProcessor> recycledProcessors = 
             new ConcurrentLinkedQueue<AjpAprProcessor>() {
             protected AtomicInteger size = new AtomicInteger(0);
+            @Override
             public boolean offer(AjpAprProcessor processor) {
                 boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
                 //avoid over growing our cache or add after we have stopped
@@ -341,6 +342,7 @@ public class AjpAprProtocol
                 return result;
             }
             
+            @Override
             public AjpAprProcessor poll() {
                 AjpAprProcessor result = super.poll();
                 if ( result != null ) {
@@ -349,6 +351,7 @@ public class AjpAprProtocol
                 return result;
             }
             
+            @Override
             public void clear() {
                 AjpAprProcessor next = poll();
                 while ( next != null ) {
index 47b753c..4f5ccc1 100644 (file)
@@ -321,6 +321,7 @@ public class AjpProtocol
         protected ConcurrentLinkedQueue<AjpProcessor> recycledProcessors = 
             new ConcurrentLinkedQueue<AjpProcessor>() {
             protected AtomicInteger size = new AtomicInteger(0);
+            @Override
             public boolean offer(AjpProcessor processor) {
                 boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
                 //avoid over growing our cache or add after we have stopped
@@ -335,6 +336,7 @@ public class AjpProtocol
                 return result;
             }
             
+            @Override
             public AjpProcessor poll() {
                 AjpProcessor result = super.poll();
                 if ( result != null ) {
@@ -343,6 +345,7 @@ public class AjpProtocol
                 return result;
             }
             
+            @Override
             public void clear() {
                 AjpProcessor next = poll();
                 while ( next != null ) {
index a17ba16..eb44dd5 100644 (file)
@@ -478,6 +478,7 @@ public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration {
         protected ConcurrentLinkedQueue<Http11AprProcessor> recycledProcessors = 
             new ConcurrentLinkedQueue<Http11AprProcessor>() {
             protected AtomicInteger size = new AtomicInteger(0);
+            @Override
             public boolean offer(Http11AprProcessor processor) {
                 boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
                 //avoid over growing our cache or add after we have stopped
@@ -492,6 +493,7 @@ public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration {
                 return result;
             }
             
+            @Override
             public Http11AprProcessor poll() {
                 Http11AprProcessor result = super.poll();
                 if ( result != null ) {
@@ -500,6 +502,7 @@ public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration {
                 return result;
             }
             
+            @Override
             public void clear() {
                 Http11AprProcessor next = poll();
                 while ( next != null ) {
index 9379c33..98a838a 100644 (file)
@@ -1253,6 +1253,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
      * Specialized utility method: find a sequence of lower case bytes inside
      * a ByteChunk.
      */
+    @Override
     protected int findBytes(ByteChunk bc, byte[] b) {
 
         byte first = b[0];
@@ -1281,6 +1282,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
      * Determine if we must drop the connection because of the HTTP status
      * code.  Use the same list of codes as Apache/httpd.
      */
+    @Override
     protected boolean statusDropsConnection(int status) {
         return status == 400 /* SC_BAD_REQUEST */ ||
                status == 408 /* SC_REQUEST_TIMEOUT */ ||
index 9246e5f..5ccf6b1 100644 (file)
@@ -600,6 +600,7 @@ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration
             new ConcurrentHashMap<NioChannel, Http11NioProcessor>();
         protected ConcurrentLinkedQueue<Http11NioProcessor> recycledProcessors = new ConcurrentLinkedQueue<Http11NioProcessor>() {
             protected AtomicInteger size = new AtomicInteger(0);
+            @Override
             public boolean offer(Http11NioProcessor processor) {
                 boolean offer = proto.processorCache==-1?true:size.get() < proto.processorCache;
                 //avoid over growing our cache or add after we have stopped
@@ -614,6 +615,7 @@ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration
                 return result;
             }
             
+            @Override
             public Http11NioProcessor poll() {
                 Http11NioProcessor result = super.poll();
                 if ( result != null ) {
@@ -622,6 +624,7 @@ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration
                 return result;
             }
             
+            @Override
             public void clear() {
                 Http11NioProcessor next = poll();
                 while ( next != null ) {
index d1ba91e..7170530 100644 (file)
@@ -1016,6 +1016,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
      * Set the socket buffer flag.
      * @Override
      */
+    @Override
     public void setSocketBuffer(int socketBuffer) {
         super.setSocketBuffer(socketBuffer);
         outputBuffer.setSocketBuffer(socketBuffer);
index 0ed13e0..b4df3d6 100644 (file)
@@ -531,6 +531,7 @@ public class Http11Protocol
         protected ConcurrentLinkedQueue<Http11Processor> recycledProcessors = 
             new ConcurrentLinkedQueue<Http11Processor>() {
             protected AtomicInteger size = new AtomicInteger(0);
+            @Override
             public boolean offer(Http11Processor processor) {
                 boolean offer = (proto.processorCache == -1) ? true : (size.get() < proto.processorCache);
                 //avoid over growing our cache or add after we have stopped
@@ -545,6 +546,7 @@ public class Http11Protocol
                 return result;
             }
             
+            @Override
             public Http11Processor poll() {
                 Http11Processor result = super.poll();
                 if ( result != null ) {
@@ -553,6 +555,7 @@ public class Http11Protocol
                 return result;
             }
             
+            @Override
             public void clear() {
                 Http11Processor next = poll();
                 while ( next != null ) {
index c890609..3b21a71 100644 (file)
@@ -72,6 +72,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
      * read operations, or if the given buffer is not big enough to accomodate
      * the whole line.
      */
+    @Override
     public boolean parseRequestLine(boolean useAvailableDataOnly)
     
         throws IOException {
@@ -249,6 +250,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
     /**
      * Parse the HTTP headers.
      */
+    @Override
     public boolean parseHeaders()
         throws IOException {
 
@@ -433,6 +435,7 @@ public class InternalInputBuffer extends AbstractInputBuffer {
         return fill(true);
     }
 
+    @Override
     protected boolean fill(boolean block) throws IOException {
 
         int nRead = 0;
index 57cb436..a0bfaea 100644 (file)
@@ -153,6 +153,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
      * Recycle the input buffer. This should be called when closing the 
      * connection.
      */
+    @Override
     public void recycle() {
         super.recycle();
         // Recycle filters
@@ -176,6 +177,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
      * consumed. This method only resets all the pointers so that we are ready
      * to parse the next HTTP request.
      */
+    @Override
     public void nextRequest() {
         super.nextRequest();
         parsingHeader = true;
@@ -199,6 +201,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
      * @return true if data is properly fed; false if no data is available 
      * immediately and thread should be freed
      */
+    @Override
     public boolean parseRequestLine(boolean useAvailableDataOnly)
         throws IOException {
 
@@ -425,6 +428,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
     /**
      * Parse the HTTP headers.
      */
+    @Override
     public boolean parseHeaders()
         throws IOException {
         HeaderParseStatus status = HeaderParseStatus.HAVE_MORE_HEADERS;
@@ -654,6 +658,7 @@ public class InternalNioInputBuffer extends AbstractInputBuffer {
      * 
      * @return false if at end of stream
      */
+    @Override
     protected boolean fill(boolean block) throws IOException, EOFException {
         return fill(true,block);
     }
index ac49a0d..a55974b 100644 (file)
@@ -182,6 +182,7 @@ public class InternalNioOutputBuffer extends AbstractOutputBuffer {
     /** 
      * Send an acknoledgement.
      */
+    @Override
     public void sendAck() throws IOException {
 
         if (!committed) {
@@ -237,6 +238,7 @@ public class InternalNioOutputBuffer extends AbstractOutputBuffer {
      * 
      * @throws IOException an undelying I/O error occured
      */
+    @Override
     protected void commit()
         throws IOException {
 
index 4c1e4bf..c858c90 100644 (file)
@@ -135,6 +135,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
      * 
      * @throws IOException an underlying I/O error occurred
      */
+    @Override
     public void flush()
         throws IOException {
 
@@ -155,6 +156,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
      * Recycle the output buffer. This should be called when closing the 
      * connection.
      */
+    @Override
     public void recycle() {
         super.recycle();
         socketBuffer.recycle();
@@ -168,6 +170,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
      * consumed. This method only resets all the pointers so that we are ready
      * to parse the next HTTP request.
      */
+    @Override
     public void nextRequest() {
         super.nextRequest();
         socketBuffer.recycle();
@@ -179,6 +182,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
      * 
      * @throws IOException an underlying I/O error occurred
      */
+    @Override
     public void endRequest()
         throws IOException {
         super.endRequest();
@@ -194,6 +198,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
     /**
      * Send an acknoledgement.
      */
+    @Override
     public void sendAck()
         throws IOException {
 
@@ -212,6 +217,7 @@ public class InternalOutputBuffer extends AbstractOutputBuffer
      * 
      * @throws IOException an undelying I/O error occured
      */
+    @Override
     protected void commit()
         throws IOException {
 
index f430b08..9006662 100644 (file)
@@ -150,6 +150,7 @@ public class GzipOutputFilter implements OutputFilter {
         extends OutputStream {
         protected ByteChunk outputChunk = new ByteChunk();
         protected byte[] singleByteBuffer = new byte[1];
+        @Override
         public void write(int b)
             throws IOException {
             // Shouldn't get used for good performance, but is needed for 
@@ -158,12 +159,15 @@ public class GzipOutputFilter implements OutputFilter {
             outputChunk.setBytes(singleByteBuffer, 0, 1);
             buffer.doWrite(outputChunk, null);
         }
+        @Override
         public void write(byte[] b, int off, int len)
             throws IOException {
             outputChunk.setBytes(b, off, len);
             buffer.doWrite(outputChunk, null);
         }
+        @Override
         public void flush() throws IOException {}
+        @Override
         public void close() throws IOException {}
     }