MCPcopy Index your code
hub / github.com/apache/tomcat / AjpProcessor

Method AjpProcessor

java/org/apache/coyote/ajp/AjpProcessor.java:267–293  ·  view source on GitHub ↗

Constructs a new AjpProcessor. @param protocol The AJP protocol @param adapter The adapter for this processor

(AbstractAjpProtocol<?> protocol, Adapter adapter)

Source from the content-addressed store, hash-verified

265 * @param adapter The adapter for this processor
266 */
267 public AjpProcessor(AbstractAjpProtocol<?> protocol, Adapter adapter) {
268 super(adapter);
269 this.protocol = protocol;
270
271 int packetSize = protocol.getPacketSize();
272 // Calculate maximum chunk size as packetSize may have been changed from
273 // the default (Constants.MAX_PACKET_SIZE)
274 this.outputMaxChunkSize = packetSize - Constants.SEND_HEAD_LEN;
275
276 request.setInputBuffer(new SocketInputBuffer());
277
278 requestHeaderMessage = new AjpMessage(packetSize);
279 responseMessage = new AjpMessage(packetSize);
280 bodyMessage = new AjpMessage(packetSize);
281
282 // Set the getBody message buffer
283 AjpMessage getBodyMessage = new AjpMessage(16);
284 getBodyMessage.reset();
285 getBodyMessage.appendByte(Constants.JK_AJP13_GET_BODY_CHUNK);
286 // Adjust read size if packetSize != default (Constants.MAX_PACKET_SIZE)
287 getBodyMessage.appendInt(Constants.MAX_READ_SIZE + packetSize - Constants.MAX_PACKET_SIZE);
288 getBodyMessage.end();
289 getBodyMessageArray = new byte[getBodyMessage.getLen()];
290 System.arraycopy(getBodyMessage.getBuffer(), 0, getBodyMessageArray, 0, getBodyMessage.getLen());
291
292 response.setOutputBuffer(new SocketOutputBuffer());
293 }
294
295
296 // --------------------------------------------------------- Public Methods

Callers

nothing calls this directly

Calls 9

resetMethod · 0.95
appendByteMethod · 0.95
appendIntMethod · 0.95
endMethod · 0.95
getLenMethod · 0.95
getBufferMethod · 0.95
getPacketSizeMethod · 0.80
setInputBufferMethod · 0.80
setOutputBufferMethod · 0.80

Tested by

no test coverage detected