/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
private void writeData(ByteBuffer chunk) throws IOException { boolean blocking = (response.getWriteListener() == null); int len = chunk.remaining(); int off = 0; // Write this chunk while (len > 0) { int thisTime = Math.min(len, outputMaxChunkSize); responseMessage.reset(); responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK); chunk.limit(chunk.position() + thisTime); responseMessage.appendBytes(chunk); responseMessage.end(); socketWrapper.write(blocking, responseMessage.getBuffer(), 0, responseMessage.getLen()); socketWrapper.flush(blocking); len -= thisTime; off += thisTime; } bytesWritten += off; }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. A null ByteChunk is * encoded as a string with length 0. * * @param bc The data to write */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { log.error(sm.getString("ajpmessage.null"), new NullPointerException()); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
/** * Write a ByteChunk out at the current write position. * A null ByteChunk is encoded as a string with length 0. */ public void appendByteChunk(ByteChunk bc) { if (bc == null) { CoyoteLogger.AJP_LOGGER.cannotAppendNull(); appendInt(0); appendByte(0); return; } appendBytes(bc.getBytes(), bc.getStart(), bc.getLength()); }
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());
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());
responseHeaderMessage.appendBytes(tmpMB); responseHeaderMessage.appendBytes(hN); responseHeaderMessage.appendBytes(hV);
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());
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());
responseHeaderMessage.appendBytes(tmpMB); responseHeaderMessage.appendBytes(hN); responseHeaderMessage.appendBytes(hV);
responseHeaderMessage.appendBytes(tmpMB); responseHeaderMessage.appendBytes(hN); responseHeaderMessage.appendBytes(hV);
responseHeaderMessage.appendBytes(tmpMB); responseHeaderMessage.appendBytes(hN); responseHeaderMessage.appendBytes(hV);
responseMessage.appendBytes(tmpMB); responseMessage.appendBytes(hN); responseMessage.appendBytes(hV);
responseMessage.appendBytes(tmpMB); responseMessage.appendBytes(hN); responseMessage.appendBytes(hV);
private void writeData(ByteChunk chunk) throws IOException { // Prevent timeout socketWrapper.access(); boolean blocking = (response.getWriteListener() == null); if (!blocking) { flushBufferedData(); } int len = chunk.getLength(); int off = 0; // Write this chunk while (responseMsgPos == -1 && len > 0) { int thisTime = len; if (thisTime > outputMaxChunkSize) { thisTime = outputMaxChunkSize; } responseMessage.reset(); responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK); responseMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime); responseMessage.end(); writeResponseMessage(blocking); len -= thisTime; off += thisTime; } bytesWritten += off; if (len > 0) { // Add this chunk to the buffer addToBuffers(chunk.getBuffer(), off, len); } }