Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2015-12-18 09:48:25 -0500
committerSimone Bordet2015-12-18 09:56:31 -0500
commit0713c17cfa9eb09078fcf497faea282bbfb952a4 (patch)
tree86868c90e1592008bf5fb72e161e99fc78a93e2d
parent4eef2a347fc28f70b8fae1a8b4ba34669eeaa63c (diff)
downloadorg.eclipse.jetty.project-0713c17cfa9eb09078fcf497faea282bbfb952a4.tar.gz
org.eclipse.jetty.project-0713c17cfa9eb09078fcf497faea282bbfb952a4.tar.xz
org.eclipse.jetty.project-0713c17cfa9eb09078fcf497faea282bbfb952a4.zip
484683 - FastCGI request idle timeout is handled incorrectly.
Added required calls to notIdle() in request/response events, and fixed the semantic of isOpen().
-rw-r--r--jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpChannelOverFCGI.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpChannelOverFCGI.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpChannelOverFCGI.java
index fb47ec7ef4..3704ce80b3 100644
--- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpChannelOverFCGI.java
+++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/client/http/HttpChannelOverFCGI.java
@@ -79,6 +79,7 @@ public class HttpChannelOverFCGI extends HttpChannel
if (exchange != null)
{
version = exchange.getRequest().getVersion();
+ idle.onOpen();
sender.send(exchange);
}
}
@@ -91,6 +92,7 @@ public class HttpChannelOverFCGI extends HttpChannel
protected boolean responseBegin(int code, String reason)
{
+ idle.notIdle();
HttpExchange exchange = getHttpExchange();
if (exchange == null)
return false;
@@ -106,12 +108,14 @@ public class HttpChannelOverFCGI extends HttpChannel
protected boolean responseHeaders()
{
+ idle.notIdle();
HttpExchange exchange = getHttpExchange();
return exchange != null && receiver.responseHeaders(exchange);
}
protected boolean content(ByteBuffer buffer, Callback callback)
{
+ idle.notIdle();
HttpExchange exchange = getHttpExchange();
if (exchange != null)
return receiver.responseContent(exchange, buffer, callback);
@@ -151,6 +155,7 @@ public class HttpChannelOverFCGI extends HttpChannel
private class FCGIIdleTimeout extends IdleTimeout
{
private final HttpConnectionOverFCGI connection;
+ private boolean open;
public FCGIIdleTimeout(HttpConnectionOverFCGI connection, long idleTimeout)
{
@@ -160,6 +165,21 @@ public class HttpChannelOverFCGI extends HttpChannel
}
@Override
+ public void onOpen()
+ {
+ open = true;
+ notIdle();
+ super.onOpen();
+ }
+
+ @Override
+ public void onClose()
+ {
+ super.onClose();
+ open = false;
+ }
+
+ @Override
protected void onIdleExpired(TimeoutException timeout)
{
if (LOG.isDebugEnabled())
@@ -170,7 +190,7 @@ public class HttpChannelOverFCGI extends HttpChannel
@Override
public boolean isOpen()
{
- return connection.getEndPoint().isOpen();
+ return open;
}
}
}

Back to the top