Revert workaround in Jetty connector

The workaround was removed in the 5.3 milestone phase and in master
only because the referenced Jetty issue is marked fixed. However,
what we need to replace it with should be a little more involved
and also it's not entirely clear if the fixes in Jetty aligns with
our release and retain semantics so that needs to be investigated
more thoroughly.
This commit is contained in:
Rossen Stoyanchev 2020-10-06 18:18:26 +01:00
parent 30c7940483
commit 1c5b95db0b
1 changed files with 10 additions and 1 deletions

View File

@ -131,7 +131,16 @@ public class JettyClientHttpConnector implements ClientHttpConnector {
}
private DataBuffer toDataBuffer(ContentChunk chunk) {
DataBuffer buffer = this.bufferFactory.wrap(chunk.buffer);
// Originally we copy due to do:
// https://github.com/eclipse/jetty.project/issues/2429
// Now that the issue is marked fixed we need to replace the below with a
// PooledDataBuffer that adapts "release()" to "succeeded()", and also
// evaluate if the concern here is addressed.
DataBuffer buffer = this.bufferFactory.allocateBuffer(chunk.buffer.capacity());
buffer.write(chunk.buffer);
chunk.callback.succeeded();
return buffer;
}