484683 - FastCGI request idle timeout is handled incorrectly.
Added required calls to notIdle() in request/response events, and fixed the semantic of isOpen().
This commit is contained in:
parent
4eef2a347f
commit
0713c17cfa
|
@ -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)
|
||||
{
|
||||
|
@ -159,6 +164,21 @@ public class HttpChannelOverFCGI extends HttpChannel
|
|||
setIdleTimeout(idleTimeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen()
|
||||
{
|
||||
open = true;
|
||||
notIdle();
|
||||
super.onOpen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose()
|
||||
{
|
||||
super.onClose();
|
||||
open = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onIdleExpired(TimeoutException timeout)
|
||||
{
|
||||
|
@ -170,7 +190,7 @@ public class HttpChannelOverFCGI extends HttpChannel
|
|||
@Override
|
||||
public boolean isOpen()
|
||||
{
|
||||
return connection.getEndPoint().isOpen();
|
||||
return open;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue