diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index 99bc90870ce..b7a74231641 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -291,7 +291,7 @@ public class HttpChannelState protected Action unhandle() { Action action; - boolean schedule_timeout=false; + AsyncContextEvent schedule_event=null; boolean read_interested=false; if(DEBUG) @@ -344,9 +344,9 @@ public class HttpChannelState _state=State.ASYNC_IO; action = Action.WRITE_CALLBACK; } - else + else { - schedule_timeout=true; + schedule_event=_event; read_interested=_asyncReadUnready; _state=State.ASYNC_WAIT; action = Action.WAIT; @@ -354,7 +354,7 @@ public class HttpChannelState break; case EXPIRING: - schedule_timeout=true; + schedule_event=_event; _state=State.ASYNC_WAIT; action = Action.WAIT; break; @@ -372,8 +372,8 @@ public class HttpChannelState } } - if (schedule_timeout) - scheduleTimeout(); + if (schedule_event!=null) + scheduleTimeout(schedule_event); if (read_interested) _channel.asyncReadFillInterested(); return action; @@ -611,11 +611,11 @@ public class HttpChannelState _channel.execute(_channel); } - protected void scheduleTimeout() + protected void scheduleTimeout(AsyncContextEvent event) { Scheduler scheduler = _channel.getScheduler(); if (scheduler!=null && _timeoutMs>0) - _event.setTimeoutTask(scheduler.schedule(_event,_timeoutMs,TimeUnit.MILLISECONDS)); + event.setTimeoutTask(scheduler.schedule(event,_timeoutMs,TimeUnit.MILLISECONDS)); } protected void cancelTimeout() diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 874f094339e..800cd098328 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.server; import java.io.IOException; -import java.lang.ref.Reference; import java.nio.ByteBuffer; import java.nio.channels.WritePendingException; import java.util.concurrent.RejectedExecutionException; @@ -70,7 +69,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http private final BlockingReadCallback _blockingReadCallback = new BlockingReadCallback(); private final AsyncReadCallback _asyncReadCallback = new AsyncReadCallback(); private final SendCallback _sendCallback = new SendCallback(); - + /** * Get the current connection that this thread is dispatched to. * Note that a thread may be processing a request asynchronously and @@ -200,7 +199,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http { if (_requestBuffer == null) _requestBuffer = _bufferPool.acquire(getInputBufferSize(), REQUEST_BUFFER_DIRECT); - return _requestBuffer; + return _requestBuffer; } public boolean isRequestBufferEmpty() @@ -221,10 +220,10 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http { // Fill the request buffer (if needed) int filled = fillRequestBuffer(); - + // Parse the request buffer boolean handle = parseRequestBuffer(); - + // Handle close parser if (_parser.isClose()) { @@ -258,7 +257,6 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http LOG.debug("{} onFillable exit {}", this, _channel.getState()); } } - /* ------------------------------------------------------------ */ /** Fill and parse data looking for content diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java index 2eaadcfda3a..52f53d9c014 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/HttpInputIntegrationTest.java @@ -126,7 +126,6 @@ public class HttpInputIntegrationTest // HTTP/2 Connector ServerConnector http2Connector = new ServerConnector(__server,ssl,/*TODO alpn,h2,*/ h1); - http2Connector.setPort(8443); __server.addConnector(http2Connector);