private void invokeFinishListener() { state |= FLAG_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } }
private void invokeFinishListener() { state |= FLAG_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } }
@Override protected void finished() { if (finishListener != null) { finishListener.handleEvent(this); } }
private void invokeFinishListener() { this.state |= FLAG_FINISHED; finishListener.handleEvent(this); }
/** * Exit a read method. * * @param consumed the number of bytes consumed by this call (may be 0) */ private void exitRead(long consumed) { if (consumed == -1) { if (!finishCalled) { finishCalled = true; finishListener.handleEvent(this); } } } }
@Override public void truncateWrites() throws IOException { next.truncateWrites(); if (shutdownState != 2) { shutdownState = 2; finishListener.handleEvent(this); } }
public boolean flush() throws IOException { final boolean val = next.flush(); if (val && shutdownState == 1) { shutdownState = 2; finishListener.handleEvent(this); } return val; } }
private void exitFlush(int oldVal, boolean flushed) { int newVal = oldVal; boolean callFinish = false; if (anyAreSet(oldVal, FLAG_CLOSE_REQUESTED) && flushed) { newVal |= FLAG_CLOSE_COMPLETE; if (!anyAreSet(oldVal, FLAG_FINISHED_CALLED)) { newVal |= FLAG_FINISHED_CALLED; callFinish = true; } state = newVal; if (callFinish) { if (finishListener != null) { finishListener.handleEvent(this); } } } }
this.state = STATE_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); this.state = STATE_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); finishListener.handleEvent(this); finishListener.handleEvent(this); finishListener.handleEvent(this);
if(invokeFinishListener) { finishListenerInvoked = true; finishListener.handleEvent(this);
private void updateRemainingAllowed(final int written) throws IOException { if (remainingAllowed == Long.MIN_VALUE) { if (exchange == null) { return; } else { long maxEntitySize = exchange.getMaxEntitySize(); if (maxEntitySize <= 0) { return; } remainingAllowed = maxEntitySize; } } remainingAllowed -= written; if (remainingAllowed < 0) { //max entity size is exceeded Connectors.terminateRequest(exchange); closed = true; exchange.setPersistent(false); finishListener.handleEvent(this); throw UndertowMessages.MESSAGES.requestEntityWasTooLarge(exchange.getMaxEntitySize()); } }
private void checkMaxSize(long state) throws IOException { if (anyAreClear(state, FLAG_LENGTH_CHECKED)) { HttpServerExchange exchange = this.exchange; if (exchange != null) { if (exchange.getMaxEntitySize() > 0 && exchange.getMaxEntitySize() < (state & MASK_COUNT)) { //max entity size is exceeded //we need to forcibly close the read side Connectors.terminateRequest(exchange); exchange.setPersistent(false); finishListener.handleEvent(this); this.state |= FLAG_FINISHED | FLAG_CLOSED; throw UndertowMessages.MESSAGES.requestEntityWasTooLarge(exchange.getMaxEntitySize()); } } this.state |= FLAG_LENGTH_CHECKED; } }
@Override public int read(ByteBuffer dst) throws IOException { try { long state = this.state; if (anyAreSet(state, STATE_FINISHED)) { return -1; } else if (anyAreSet(state, STATE_SEND_REQUIRED)) { state = this.state = (state & STATE_MASK) | STATE_READING; if (ajpResponseConduit.isWriteShutdown()) { this.state = STATE_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } return -1; } if (!ajpResponseConduit.doGetRequestBodyChunk(READ_BODY_CHUNK.duplicate(), this)) { return 0; } } //we might have gone into state_reading above if (anyAreSet(state, STATE_READING)) { return doRead(dst, state); } assert STATE_FINISHED == state; return -1; } catch (IOException | RuntimeException e) { IoUtils.safeClose(exchange.getConnection()); throw e; } }
@Override protected void finished() { if (finishListener != null) { finishListener.handleEvent(this); } }
private void invokeFinishListener() { this.state |= FLAG_FINISHED; finishListener.handleEvent(this); }
private void invokeFinishListener() { state |= FLAG_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } }
private void invokeFinishListener() { state |= FLAG_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } }
@Override protected void finished() { if (finishListener != null) { finishListener.handleEvent(this); } }
/** * Exit a read method. * * @param consumed the number of bytes consumed by this call (may be 0) */ private void exitRead(long consumed) { if (consumed == -1) { if (!finishCalled) { finishCalled = true; finishListener.handleEvent(this); } } } }
private void invokeFinishListener() { state |= FLAG_FINISHED; if (finishListener != null) { finishListener.handleEvent(this); } }