(ByteBuffer chunk)
| 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() { |
no test coverage detected