Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x

This commit is contained in:
gregw 2024-08-31 07:53:43 +10:00
commit b4232317c7
2 changed files with 12 additions and 14 deletions

View File

@ -371,11 +371,11 @@ public class HttpConnection extends AbstractMetaDataConnection implements Runnab
{
while (getEndPoint().isOpen())
{
if (LOG.isDebugEnabled())
LOG.debug("onFillable fill and parse {} {} {}", this, _httpChannel, _retainableByteBuffer);
// Fill the request buffer (if needed).
int filled = fillRequestBuffer();
if (LOG.isDebugEnabled())
LOG.debug("onFillable filled {} {} {} {}", filled, this, _httpChannel, _retainableByteBuffer);
if (filled < 0 && getEndPoint().isOutputShutdown())
close();
@ -1536,12 +1536,17 @@ public class HttpConnection extends AbstractMetaDataConnection implements Runnab
return;
}
// As this is not an upgrade, we can shutdown the output if we know we are not persistent
if (_sendCallback._shutdownOut)
getEndPoint().shutdownOutput();
_httpChannel.recycle();
// If a 100 Continue is still expected to be sent, but no content was read, then
// close the parser so that seeks EOF below, not the next request.
if (_expects100Continue)
{
// No content was read, and no 100 Continue response was sent.
// Close the parser so that below it seeks EOF, not the next request.
_expects100Continue = false;
_parser.close();
}
@ -1554,7 +1559,6 @@ public class HttpConnection extends AbstractMetaDataConnection implements Runnab
else
_parser.close();
}
_generator.reset();
// Can the onFillable thread continue processing
@ -1565,9 +1569,6 @@ public class HttpConnection extends AbstractMetaDataConnection implements Runnab
if (LOG.isDebugEnabled())
LOG.debug("non-current completion {}", this);
if (_sendCallback._shutdownOut)
getEndPoint().shutdownOutput();
// If we are looking for the next request
if (_parser.isStart())
{

View File

@ -200,7 +200,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
}
});
try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()))
try (StacklessLogging ignored = new StacklessLogging(Response.class); Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()))
{
OutputStream os = client.getOutputStream();
@ -233,7 +233,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
}
});
try (Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()))
try (StacklessLogging ignored = new StacklessLogging(Response.class); Socket client = newSocket(_serverURI.getHost(), _serverURI.getPort()))
{
OutputStream os = client.getOutputStream();
@ -1669,12 +1669,10 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String line = in.readLine();
System.err.println(line);
assertThat(line, containsString(" 304 "));
while (true)
{
line = in.readLine();
System.err.println(line);
if (line == null)
throw new EOFException();
if (line.length() == 0)
@ -1685,7 +1683,6 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
assertThat(line, not(containsString("Transfer-Encoding")));
}
System.err.println("---");
line = in.readLine();
assertThat(line, containsString(" 304 "));
while (true)