Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2011-12-21 13:48:25 +0000
committerGreg Wilkins2011-12-21 13:48:25 +0000
commitb99e03c465e14160cc693e86f5d68c3dbbb9e3cf (patch)
tree83abf583a7ab9789c3166f44beaad072b35c424f
parentef23bf11b8418dc94ad9c3315c4fc112a50fb3d1 (diff)
downloadorg.eclipse.jetty.project-b99e03c465e14160cc693e86f5d68c3dbbb9e3cf.tar.gz
org.eclipse.jetty.project-b99e03c465e14160cc693e86f5d68c3dbbb9e3cf.tar.xz
org.eclipse.jetty.project-b99e03c465e14160cc693e86f5d68c3dbbb9e3cf.zip
364921 moved setCheckForIdle handling to AsyncHttpConnection
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesServerTest.java5
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java12
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java1
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/AsyncHttpConnection.java10
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java1
5 files changed, 14 insertions, 15 deletions
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesServerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesServerTest.java
index 99b22b0308..0bb5b22f35 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesServerTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslBytesServerTest.java
@@ -1241,7 +1241,6 @@ public class SslBytesServerTest extends SslBytesTest
closeClient(client);
}
- @Ignore // TODO: currently not passing
@Test
public void testServerShutdownOutputClientDoesNotCloseServerCloses() throws Exception
{
@@ -1291,11 +1290,9 @@ public class SslBytesServerTest extends SslBytesTest
// The server has shutdown the output since the client sent a Connection: close
// but the client does not close, so the server must idle timeout the endPoint.
- TimeUnit.MILLISECONDS.sleep(idleTimeout + idleTimeout / 2);
+ TimeUnit.MILLISECONDS.sleep(idleTimeout + idleTimeout/2);
Assert.assertFalse(serverEndPoint.get().isOpen());
-
- closeClient(client);
}
private void assumeJavaVersionSupportsTLSRenegotiations()
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java
index 1f10532588..ab5d9ff75c 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java
@@ -257,15 +257,6 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
getSelectSet().scheduleTimeout(task,timeoutMs);
}
-
- /* ------------------------------------------------------------ */
- @Override
- public boolean isOutputShutdown()
- {
- setCheckForIdle(true);
- return super.isOutputShutdown();
- }
-
/* ------------------------------------------------------------ */
public void setCheckForIdle(boolean check)
{
@@ -289,10 +280,11 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
public void checkIdleTimestamp(long now)
{
long idleTimestamp=_idleTimestamp;
-
+
if (idleTimestamp!=0 && _maxIdleTime>0)
{
long idleForMs=now-idleTimestamp;
+
if (idleForMs>_maxIdleTime)
{
onIdleExpired(idleForMs);
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java
index d9af5953ca..1668e511ff 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslConnection.java
@@ -599,6 +599,7 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
public void shutdownOutput() throws IOException
{
+ System.err.println("OSHUT SSL");
synchronized (SslConnection.this)
{
LOG.debug("{} ssl endp.oshut {}",_session,this);
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncHttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncHttpConnection.java
index 8ec0737e5a..1ddedf015a 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncHttpConnection.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncHttpConnection.java
@@ -54,6 +54,10 @@ public class AsyncHttpConnection extends AbstractHttpConnection implements Async
try
{
setCurrentConnection(this);
+
+ // don't check for idle while dispatched (unless blocking IO is done).
+ _asyncEndp.setCheckForIdle(false);
+
// While progress and the connection has not changed
while (progress && connection==this)
@@ -133,10 +137,16 @@ public class AsyncHttpConnection extends AbstractHttpConnection implements Async
finally
{
setCurrentConnection(null);
+
+ // If we are not suspended
if (!_request.isAsyncStarted())
{
+ // return buffers
_parser.returnBuffers();
_generator.returnBuffers();
+
+ // resuming checking for idle
+ _asyncEndp.setCheckForIdle(true);
}
// Safety net to catch spinning
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
index 998dc76638..b6165d45fd 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java
@@ -122,7 +122,6 @@ public class SelectChannelConnector extends AbstractNIOConnector
public void customize(EndPoint endpoint, Request request) throws IOException
{
AsyncEndPoint aEndp = ((AsyncEndPoint)endpoint);
- aEndp.setCheckForIdle(false);
request.setTimeStamp(System.currentTimeMillis());
endpoint.setMaxIdleTime(_maxIdleTime);
super.customize(endpoint, request);

Back to the top