review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
parent
6ed64e1e65
commit
1d5d8071ba
|
@ -55,7 +55,8 @@ public class HttpInput extends ServletInputStream implements Runnable
|
|||
|
||||
public void recycle()
|
||||
{
|
||||
reopen();
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("recycle {}", this);
|
||||
}
|
||||
|
||||
public void reopen()
|
||||
|
@ -63,7 +64,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
|||
try (AutoLock lock = _contentProducer.lock())
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("recycle/reopen {}", this);
|
||||
LOG.debug("reopen {}", this);
|
||||
_blockingContentProducer.recycle();
|
||||
_contentProducer = _blockingContentProducer;
|
||||
_consumedEof = false;
|
||||
|
|
|
@ -56,12 +56,13 @@ public class RequestReaderTest extends AbstractTest<TransportScenario>
|
|||
if (b == -1)
|
||||
break;
|
||||
}
|
||||
// Paranoid check.
|
||||
assertThat(br.read(), is(-1));
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
}, client -> {});
|
||||
|
||||
ContentResponse response1 = scenario.client.newRequest("localhost", scenario.server.getURI().getPort())
|
||||
.scheme(scenario.server.getURI().getScheme())
|
||||
ContentResponse response1 = scenario.client.newRequest(scenario.newURI())
|
||||
.method("POST")
|
||||
.timeout(5, TimeUnit.SECONDS)
|
||||
.body(new BytesRequestContent(new byte[512]))
|
||||
|
@ -69,8 +70,7 @@ public class RequestReaderTest extends AbstractTest<TransportScenario>
|
|||
assertThat(response1.getStatus(), is(HttpStatus.OK_200));
|
||||
|
||||
// Send a 2nd request to make sure recycling works.
|
||||
ContentResponse response2 = scenario.client.newRequest("localhost", scenario.server.getURI().getPort())
|
||||
.scheme(scenario.server.getURI().getScheme())
|
||||
ContentResponse response2 = scenario.client.newRequest(scenario.newURI())
|
||||
.method("POST")
|
||||
.timeout(5, TimeUnit.SECONDS)
|
||||
.body(new BytesRequestContent(new byte[512]))
|
||||
|
|
Loading…
Reference in New Issue