public boolean failed(Throwable x) { synchronized (_inputQ) { // Errors may be reported multiple times, for example // a local idle timeout and a remote I/O failure. if (isError()) { if (LOG.isDebugEnabled()) { // Log both the original and current failure // without modifying the original failure. Throwable failure = new Throwable(_state.getError()); failure.addSuppressed(x); LOG.debug(failure); } } else { // Add a suppressed throwable to capture this stack // trace without wrapping/hiding the original failure. x.addSuppressed(new Throwable("HttpInput failure")); _state = new ErrorState(x); } return wakeup(); } }
error = _state instanceof ErrorState?((ErrorState)_state).getError():null;
public boolean consumeAll() { synchronized (_inputQ) { try { while (true) { Content item = nextContent(); if (item == null) break; // Let's not bother blocking skip(item, item.remaining()); } if (isFinished()) return !isError(); _state = EARLY_EOF; return false; } catch (Throwable e) { LOG.debug(e); _state = new ErrorState(e); return false; } } }
public boolean failed(Throwable x) { boolean woken=false; synchronized (_inputQ) { if (_state instanceof ErrorState) LOG.warn(x); else _state = new ErrorState(x); if (_listener==null) _inputQ.notify(); else woken=_channelState.onReadPossible(); } return woken; }
public boolean onIdleTimeout(Throwable x) { synchronized (_inputQ) { boolean neverDispatched = getHttpChannelState().isIdle(); if ((_waitingForContent || neverDispatched) && !isError()) { x.addSuppressed(new Throwable("HttpInput idle timeout")); _state = new ErrorState(x); return wakeup(); } return false; } }