Author: remm Date: Fri Oct 13 04:39:30 2006 New Revision: 463652 URL: http://svn.apache.org/viewvc?view=rev&rev=463652 Log: - Packet must be ended before sending. - Fix off by one check bug in AjpMessage. - Fix recycling bug (setting streams to null when doing keepalive is not a good idea).
Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpMessage.java tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpMessage.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpMessage.java?view=diff&rev=463652&r1=463651&r2=463652 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpMessage.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpMessage.java Fri Oct 13 04:39:30 2006 @@ -275,7 +275,7 @@ * @param numBytes The number of bytes to copy. */ public void appendBytes(byte[] b, int off, int numBytes) { - if (pos + numBytes + 3 >= buf.length) { + if (pos + numBytes + 3 > buf.length) { log.error(sm.getString("ajpmessage.overflow", "" + numBytes, "" + pos), new ArrayIndexOutOfBoundsException()); if (log.isDebugEnabled()) { @@ -381,6 +381,11 @@ return 4; } + + public int getPacketSize() { + return buf.length; + } + public int processHeader() { pos = 0; Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?view=diff&rev=463652&r1=463651&r2=463652 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Fri Oct 13 04:39:30 2006 @@ -428,7 +428,9 @@ rp.setStage(org.apache.coyote.Constants.STAGE_ENDED); recycle(); - + input = null; + output = null; + return true; } @@ -1062,9 +1064,6 @@ response.recycle(); certificates.recycle(); - input = null; - output = null; - } @@ -1157,7 +1156,9 @@ responseHeaderMessage.reset(); responseHeaderMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK); responseHeaderMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime); + responseHeaderMessage.end(); output.write(responseHeaderMessage.getBuffer(), 0, responseHeaderMessage.getLen()); + off += thisTime; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]