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

Method writeData

java/org/apache/coyote/ajp/AjpProcessor.java:1207–1230  ·  view source on GitHub ↗
(ByteBuffer chunk)

Source from the content-addressed store, hash-verified

1205
1206
1207 private void writeData(ByteBuffer chunk) throws IOException {
1208 boolean blocking = (response.getWriteListener() == null);
1209
1210 int len = chunk.remaining();
1211 int off = 0;
1212
1213 // Write this chunk
1214 while (len > 0) {
1215 int thisTime = Math.min(len, outputMaxChunkSize);
1216
1217 responseMessage.reset();
1218 responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
1219 chunk.limit(chunk.position() + thisTime);
1220 responseMessage.appendBytes(chunk);
1221 responseMessage.end();
1222 socketWrapper.write(blocking, responseMessage.getBuffer(), 0, responseMessage.getLen());
1223 socketWrapper.flush(blocking);
1224
1225 len -= thisTime;
1226 off += thisTime;
1227 }
1228
1229 bytesWritten += off;
1230 }
1231
1232
1233 private boolean hasDataToWrite() {

Callers 1

doWriteMethod · 0.45

Calls 13

getWriteListenerMethod · 0.80
remainingMethod · 0.80
appendByteMethod · 0.80
positionMethod · 0.80
appendBytesMethod · 0.80
getLenMethod · 0.80
resetMethod · 0.65
endMethod · 0.65
writeMethod · 0.65
getBufferMethod · 0.65
flushMethod · 0.65
minMethod · 0.45

Tested by

no test coverage detected