Issue #4411 - Jetty server spins on incomplete request.
Updated FastCGI code to pass the test. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
6bbec7f3b0
commit
8e875ab7a4
|
@ -125,6 +125,14 @@ public class HttpChannelOverFCGI extends HttpChannel
|
||||||
dispatcher.dispatch();
|
dispatcher.dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean onIdleTimeout(Throwable timeout)
|
||||||
|
{
|
||||||
|
boolean handle = getRequest().getHttpInput().onIdleTimeout(timeout);
|
||||||
|
if (handle)
|
||||||
|
execute(this);
|
||||||
|
return !handle;
|
||||||
|
}
|
||||||
|
|
||||||
private static class Dispatcher implements Runnable
|
private static class Dispatcher implements Runnable
|
||||||
{
|
{
|
||||||
private final AtomicReference<State> state = new AtomicReference<>(State.IDLE);
|
private final AtomicReference<State> state = new AtomicReference<>(State.IDLE);
|
||||||
|
|
|
@ -105,6 +105,14 @@ public class ServerFCGIConnection extends AbstractConnection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean onReadTimeout(Throwable timeout)
|
||||||
|
{
|
||||||
|
return channels.values().stream()
|
||||||
|
.mapToInt(channel -> channel.onIdleTimeout(timeout) ? 0 : 1)
|
||||||
|
.sum() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void parse(ByteBuffer buffer)
|
private void parse(ByteBuffer buffer)
|
||||||
{
|
{
|
||||||
while (buffer.hasRemaining())
|
while (buffer.hasRemaining())
|
||||||
|
|
|
@ -66,7 +66,6 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||||
import org.eclipse.jetty.util.BufferUtil;
|
import org.eclipse.jetty.util.BufferUtil;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.IO;
|
import org.eclipse.jetty.util.IO;
|
||||||
import org.junit.jupiter.api.Assumptions;
|
|
||||||
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
|
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.ArgumentsSource;
|
import org.junit.jupiter.params.provider.ArgumentsSource;
|
||||||
|
@ -1273,9 +1272,6 @@ public class HttpClientStreamTest extends AbstractTest<TransportScenario>
|
||||||
@ArgumentsSource(TransportProvider.class)
|
@ArgumentsSource(TransportProvider.class)
|
||||||
public void testClientDefersContentServerIdleTimeout(Transport transport) throws Exception
|
public void testClientDefersContentServerIdleTimeout(Transport transport) throws Exception
|
||||||
{
|
{
|
||||||
// TODO: fix FCGI that is failing this test.
|
|
||||||
Assumptions.assumeTrue(transport != Transport.FCGI);
|
|
||||||
|
|
||||||
init(transport);
|
init(transport);
|
||||||
CountDownLatch dataLatch = new CountDownLatch(1);
|
CountDownLatch dataLatch = new CountDownLatch(1);
|
||||||
CountDownLatch errorLatch = new CountDownLatch(1);
|
CountDownLatch errorLatch = new CountDownLatch(1);
|
||||||
|
|
Loading…
Reference in New Issue