@Override public void succeeded() { // This means that a write of encrypted data has completed. Writes are done // only if there is a pending writeflusher or a read needed to write // data. In either case the appropriate callback is passed on. synchronized (DecryptedEndPoint.this) { if (DEBUG) LOG.debug("write.complete {}", SslConnection.this.getEndPoint()); releaseEncryptedOutputBuffer(); _cannotAcceptMoreAppDataToFlush = false; if (_fillRequiresFlushToProgress) { _fillRequiresFlushToProgress = false; getFillInterest().fillable(); } getExecutor().execute(_runCompletWrite); } }
@Override public void succeeded() { // This means that a write of encrypted data has completed. Writes are done // only if there is a pending writeflusher or a read needed to write // data. In either case the appropriate callback is passed on. synchronized (DecryptedEndPoint.this) { if (DEBUG) LOG.debug("write.complete {}", SslConnection.this.getEndPoint()); releaseEncryptedOutputBuffer(); _cannotAcceptMoreAppDataToFlush = false; if (_fillRequiresFlushToProgress) { _fillRequiresFlushToProgress = false; getFillInterest().fillable(); } getExecutor().execute(_runCompletWrite); } }
@Override public void succeeded() { // This means that a write of encrypted data has completed. Writes are done // only if there is a pending writeflusher or a read needed to write // data. In either case the appropriate callback is passed on. boolean fillable = false; synchronized (DecryptedEndPoint.this) { if (DEBUG) LOG.debug("write.complete {}", SslConnection.this.getEndPoint()); releaseEncryptedOutputBuffer(); _cannotAcceptMoreAppDataToFlush = false; if (_fillRequiresFlushToProgress) { _fillRequiresFlushToProgress = false; fillable = true; } } if (fillable) getFillInterest().fillable(); getExecutor().execute(_runCompletWrite); }
protected void onFillableFail(Throwable failure) { // If we are handshaking, then wake up any waiting write as well as it may have been blocked on the read boolean fail = false; synchronized(_decryptedEndPoint) { if (LOG.isDebugEnabled()) LOG.debug("onFillableFail {}", SslConnection.this, failure); _fillState = FillState.IDLE; switch(_flushState) { case WAIT_FOR_FILL: _flushState = FlushState.IDLE; fail = true; break; default: break; } } // wake up whoever is doing the fill getFillInterest().onFail(failure); // Try to complete the write if (fail) { if (!getWriteFlusher().onFail(failure)) close(failure); } }
@Override public void onFillable() { // onFillable means that there are encrypted bytes ready to be filled. // however we do not fill them here on this callback, but instead wakeup // the decrypted readInterest and/or writeFlusher so that they will attempt // to do the fill and/or flush again and these calls will do the actually // filling. if (DEBUG) LOG.debug("onFillable enter {}", getEndPoint()); // wake up whoever is doing the fill or the flush so they can // do all the filling, unwrapping, wrapping and flushing _decryptedEndPoint.getFillInterest().fillable(); // If we are handshaking, then wake up any waiting write as well as it may have been blocked on the read synchronized(_decryptedEndPoint) { if (_decryptedEndPoint._flushRequiresFillToProgress) { _decryptedEndPoint._flushRequiresFillToProgress = false; getExecutor().execute(_runCompletWrite); } } if (DEBUG) LOG.debug("onFillable exit {}", getEndPoint()); }
@Override public void onFillInterestedFailed(Throwable cause) { // this means that the fill interest in encrypted bytes has failed. // However we do not handle that here on this callback, but instead wakeup // the decrypted readInterest and/or writeFlusher so that they will attempt // to do the fill and/or flush again and these calls will do the actually // handle the cause. _decryptedEndPoint.getFillInterest().onFail(cause); boolean failFlusher = false; synchronized(_decryptedEndPoint) { if (_decryptedEndPoint._flushRequiresFillToProgress) { _decryptedEndPoint._flushRequiresFillToProgress = false; failFlusher = true; } } if (failFlusher) _decryptedEndPoint.getWriteFlusher().onFail(cause); }
@Override public void failed(final Throwable x) { boolean fail_fill_interest; synchronized(_decryptedEndPoint) { if (LOG.isDebugEnabled()) LOG.debug("IncompleteWriteCB failed {}", SslConnection.this, x); BufferUtil.clear(_encryptedOutput); releaseEncryptedOutputBuffer(); _flushState = FlushState.IDLE; fail_fill_interest = _fillState==FillState.WAIT_FOR_FLUSH; if (fail_fill_interest) _fillState = FillState.IDLE; } getExecutor().execute(()-> { if (fail_fill_interest) _decryptedEndPoint.getFillInterest().onFail(x); _decryptedEndPoint.getWriteFlusher().onFail(x); }); }
@Override public void onFillInterestedFailed(Throwable cause) { // this means that the fill interest in encrypted bytes has failed. // However we do not handle that here on this callback, but instead wakeup // the decrypted readInterest and/or writeFlusher so that they will attempt // to do the fill and/or flush again and these calls will do the actually // handle the cause. _decryptedEndPoint.getFillInterest().onFail(cause); boolean failFlusher = false; synchronized(_decryptedEndPoint) { if (_decryptedEndPoint._flushRequiresFillToProgress) { _decryptedEndPoint._flushRequiresFillToProgress = false; failFlusher = true; } } if (failFlusher) _decryptedEndPoint.getWriteFlusher().onFail(cause); }
@Override public void failed(final Throwable x) { boolean fail_fill_interest; synchronized(_decryptedEndPoint) { if (LOG.isDebugEnabled()) LOG.debug("IncompleteWriteCB failed {}", SslConnection.this, x); BufferUtil.clear(_encryptedOutput); releaseEncryptedOutputBuffer(); _flushState = FlushState.IDLE; fail_fill_interest = _fillState==FillState.WAIT_FOR_FLUSH; if (fail_fill_interest) _fillState = FillState.IDLE; } getExecutor().execute(()-> { if (fail_fill_interest) _decryptedEndPoint.getFillInterest().onFail(x); _decryptedEndPoint.getWriteFlusher().onFail(x); }); }
@Override public void succeeded() { boolean fillable; synchronized(_decryptedEndPoint) { if (LOG.isDebugEnabled()) LOG.debug("IncompleteWriteCB succeeded {}", SslConnection.this); releaseEncryptedOutputBuffer(); _flushState = FlushState.IDLE; fillable = _fillState==FillState.WAIT_FOR_FLUSH; if (fillable) _fillState = FillState.IDLE; } if (fillable) _decryptedEndPoint.getFillInterest().fillable(); _decryptedEndPoint.getWriteFlusher().completeWrite(); }
@Override public void onFillInterestedFailed(Throwable cause) { // this means that the fill interest in encrypted bytes has failed. // However we do not handle that here on this callback, but instead wakeup // the decrypted readInterest and/or writeFlusher so that they will attempt // to do the fill and/or flush again and these calls will do the actually // handle the cause. synchronized(_decryptedEndPoint) { _decryptedEndPoint.getFillInterest().onFail(cause); if (_decryptedEndPoint._flushRequiresFillToProgress) { _decryptedEndPoint._flushRequiresFillToProgress = false; _decryptedEndPoint.getWriteFlusher().onFail(cause); } } }
@Override public void onFillInterestedFailed(Throwable cause) { // this means that the fill interest in encrypted bytes has failed. // However we do not handle that here on this callback, but instead wakeup // the decrypted readInterest and/or writeFlusher so that they will attempt // to do the fill and/or flush again and these calls will do the actually // handle the cause. synchronized(_decryptedEndPoint) { _decryptedEndPoint.getFillInterest().onFail(cause); if (_decryptedEndPoint._flushRequiresFillToProgress) { _decryptedEndPoint._flushRequiresFillToProgress = false; _decryptedEndPoint.getWriteFlusher().onFail(cause); } } }
@Override public void succeeded() { boolean fillable; synchronized(_decryptedEndPoint) { if (LOG.isDebugEnabled()) LOG.debug("IncompleteWriteCB succeeded {}", SslConnection.this); releaseEncryptedOutputBuffer(); _flushState = FlushState.IDLE; fillable = _fillState==FillState.WAIT_FOR_FLUSH; if (fillable) _fillState = FillState.IDLE; } if (fillable) _decryptedEndPoint.getFillInterest().fillable(); _decryptedEndPoint.getWriteFlusher().completeWrite(); }
@Override public void run() { _decryptedEndPoint.getFillInterest().fillable(); }
@Override public InvocationType getInvocationType() { return getDecryptedEndPoint().getFillInterest().getCallbackInvocationType(); } };
@Override public void run() { _decryptedEndPoint.getFillInterest().fillable(); } };
@Override public InvocationType getInvocationType() { return getDecryptedEndPoint().getFillInterest().getCallbackInvocationType(); }
@Override public InvocationType getInvocationType() { return getDecryptedEndPoint().getFillInterest().getCallbackInvocationType(); } };
@Override public void run() { _decryptedEndPoint.getFillInterest().fillable(); }
@Override public InvocationType getInvocationType() { return getDecryptedEndPoint().getFillInterest().getCallbackInvocationType(); }