MCPcopy Create free account
hub / github.com/apache/tomcat / doFlush

Method doFlush

java/org/apache/catalina/connector/OutputBuffer.java:266–297  ·  view source on GitHub ↗

Flush bytes or chars contained in the buffer. @param realFlush true if this should also cause a real network flush @throws IOException An underlying IOException occurred

(boolean realFlush)

Source from the content-addressed store, hash-verified

264 * @throws IOException An underlying IOException occurred
265 */
266 protected void doFlush(boolean realFlush) throws IOException {
267
268 if (suspended) {
269 return;
270 }
271
272 try {
273 doFlush = true;
274 if (initial) {
275 coyoteResponse.commit();
276 initial = false;
277 }
278 if (cb.remaining() > 0) {
279 flushCharBuffer();
280 }
281 if (bb.remaining() > 0) {
282 flushByteBuffer();
283 }
284 } finally {
285 doFlush = false;
286 }
287
288 if (realFlush) {
289 coyoteResponse.action(ActionCode.CLIENT_FLUSH, null);
290 // If some exception occurred earlier, or if some IOE occurred
291 // here, notify the servlet with an IOE
292 if (coyoteResponse.isExceptionPresent()) {
293 throw new ClientAbortException(coyoteResponse.getErrorException());
294 }
295 }
296
297 }
298
299
300 // ------------------------------------------------- Bytes Handling Methods

Callers 2

closeMethod · 0.95
flushMethod · 0.95

Calls 7

flushCharBufferMethod · 0.95
flushByteBufferMethod · 0.95
remainingMethod · 0.80
commitMethod · 0.65
actionMethod · 0.65
isExceptionPresentMethod · 0.45
getErrorExceptionMethod · 0.45

Tested by

no test coverage detected