boolean onIdleTimeout(Throwable timeout) { if (_delayedForContent) { _delayedForContent = false; getRequest().getHttpInput().onIdleTimeout(timeout); execute(this); return false; } return true; }
/** Fill and parse data looking for content * @return true if an {@link RequestHandler} method was called and it returned true; */ protected boolean fillAndParseForContent() { boolean handled=false; while (_parser.inContentState()) { int filled = fillRequestBuffer(); boolean handle = parseRequestBuffer(); handled|=handle; if (handle || filled<=0 || _channel.getRequest().getHttpInput().hasContent()) break; } return handled; }
@Override public void badMessage(BadMessageException failure) { _httpConnection.getGenerator().setPersistent(false); try { // Need to call onRequest, so RequestLog can reports as much as possible onRequest(_metadata); getRequest().getHttpInput().earlyEOF(); } catch (Exception e) { LOG.ignore(e); } onBadMessage(failure); }
@Override public void badMessage(int status, String reason) { _httpConnection.getGenerator().setPersistent(false); try { // Need to call onRequest, so RequestLog can reports as much as possible onRequest(_metadata); getRequest().getHttpInput().earlyEOF(); } catch (Exception e) { LOG.ignore(e); } onBadMessage(status,reason); }
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint, HttpCompliance compliance, boolean recordComplianceViolations) { super(endPoint, connector.getExecutor()); _config = config; _connector = connector; _bufferPool = _connector.getByteBufferPool(); _generator = newHttpGenerator(); _channel = newHttpChannel(); _input = _channel.getRequest().getHttpInput(); _parser = newHttpParser(compliance); _recordHttpComplianceViolations = recordComplianceViolations; if (LOG.isDebugEnabled()) LOG.debug("New HTTP Connection {}", this); }
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint, HttpCompliance compliance, boolean recordComplianceViolations) { super(endPoint, connector.getExecutor()); _config = config; _connector = connector; _bufferPool = _connector.getByteBufferPool(); _generator = newHttpGenerator(); _channel = newHttpChannel(); _input = _channel.getRequest().getHttpInput(); _parser = newHttpParser(compliance); _recordHttpComplianceViolations=recordComplianceViolations; if (LOG.isDebugEnabled()) LOG.debug("New HTTP Connection {}", this); }
Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE); if (connection != null) if (_channel.getRequest().getHttpInput().isAsync()) LOG.debug("unconsumed input {}", this); if (!_channel.getRequest().getHttpInput().consumeAll()) _channel.abort(new IOException("unconsumed input"));
Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE); if (connection != null)
getRequest().setAttribute(HttpConnection.UPGRADE_CONNECTION_ATTRIBUTE,upgrade_connection); getResponse().setStatus(101); getHttpTransport().onCompleted();
getRequest().setAttribute(HttpConnection.UPGRADE_CONNECTION_ATTRIBUTE, upgrade_connection); getResponse().setStatus(101); getHttpTransport().onCompleted();
this.getRequest().setAttribute(HttpCompliance.VIOLATIONS_ATTR, _complianceViolations); _complianceViolations=null;
this.getRequest().setAttribute(ATTR_COMPLIANCE_VIOLATIONS, _complianceViolations);