- Fix off by one check bug in AjpMessage.
- Fix recycling bug (setting streams to null when doing keepalive is not a good idea).
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@463652
13f79535-47bb-0310-9956-
ffa450edef68
* @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()) {
}
+ public int getPacketSize() {
+ return buf.length;
+ }
+
+
public int processHeader() {
pos = 0;
int mark = getInt();
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
recycle();
-
+ input = null;
+ output = null;
+
return true;
}
response.recycle();
certificates.recycle();
- input = null;
- output = null;
-
}
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;
}