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
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(                                                                                                                          
        at java.lang.String.<init>(                                                                                                                               
        at org.apache.tomcat.util.buf.ByteChunk.toStringInternal(                                                                                              
        at org.apache.tomcat.util.buf.StringCache.toString(                                                                                                  
        at org.apache.tomcat.util.buf.ByteChunk.toString(                                                                                                      
        at org.apache.tomcat.util.buf.MessageBytes.toString(                                                                                                
        at org.apache.coyote.RequestInfo.updateCounters(                                                                                                     
        at org.apache.coyote.Request.updateCounters(                                                                                                             
        at org.apache.coyote.ajp.AjpAprProcessor.process(                                                                                                
        at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(                                                                             
[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                                                                                                                  
[Fri Apr 08 17:23:44 2011] [error] (104)Connection reset by peer:                                                                                                                 
ajp_ilink_receive() can't receive header