Review Board 1.7.22


Offer possible resolution of StringIndexOutOfBoundsException in Request.updateCounters when AJP packetSize is too small.

Review Request #595 - Created April 13, 2011 and updated

Erik Meade
Reviewers
tomcat
tomcat-6.0.x
Could we improve the error message If the AJP packetSize is not large enough?  As is we get:

org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler process                                                                                                                 
SEVERE: Error reading request, ignored                                                                                                                                            
java.lang.StringIndexOutOfBoundsException: String index out of range: 13628                                                                                                       
        at java.lang.String.checkBounds(String.java:401)                                                                                                                          
        at java.lang.String.<init>(String.java:442)                                                                                                                               
        at org.apache.tomcat.util.buf.ByteChunk.toStringInternal(ByteChunk.java:497)                                                                                              
        at org.apache.tomcat.util.buf.StringCache.toString(StringCache.java:216)                                                                                                  
        at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:490)                                                                                                      
        at org.apache.tomcat.util.buf.MessageBytes.toString(MessageBytes.java:213)                                                                                                
        at org.apache.coyote.RequestInfo.updateCounters(RequestInfo.java:156)                                                                                                     
        at org.apache.coyote.Request.updateCounters(Request.java:518)                                                                                                             
        at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:455)                                                                                                
        at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:384)                                                                             
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)                                                                                               
        at java.lang.Thread.run(Thread.java:662)                                                                                                                                  
                                                                                                                                                                                  
                                                                                                                                     
[Fri Apr 08 17:23:44 2011] [error] ajp_read_header: ajp_ilink_receive failed                                                                                                      
[Fri Apr 08 17:23:44 2011] [error] (120006)APR does not understand                                                                                                                
this error code: proxy: read response failed from 127.0.0.1:8003                                                                                                                  
(127.0.0.1)                                                                                                                                                                       
[Fri Apr 08 17:23:44 2011] [error] (104)Connection reset by peer:                                                                                                                 
ajp_ilink_receive() can't receive header