Ejemplo n.º 1
0
  /**
   * Flush bytes or chars contained in the buffer.
   *
   * @throws IOException An underlying IOException occurred
   */
  protected void doFlush(boolean realFlush) throws IOException {

    if (suspended) return;

    doFlush = true;
    if (initial) {
      coyoteResponse.sendHeaders();
      initial = false;
    }
    if (bb.getLength() > 0) {
      bb.flushBuffer();
    }
    doFlush = false;

    if (realFlush) {
      coyoteResponse.action(ActionCode.CLIENT_FLUSH, coyoteResponse);
      // If some exception occurred earlier, or if some IOE occurred
      // here, notify the servlet with an IOE
      if (coyoteResponse.isExceptionPresent()) {
        throw new ClientAbortException(coyoteResponse.getErrorException());
      }
    }
  }