This commit is contained in:
@@ -453,10 +453,10 @@ public class HttpServer extends Server<String, HttpContext, HttpRequest, HttpRes
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ObjectPool<ByteBuffer> createBufferPool(AtomicLong createCounter, AtomicLong cycleCounter, int bufferPoolSize) {
|
protected ObjectPool<ByteBuffer> createBufferPool(AtomicLong createCounter, AtomicLong cycleCounter, int bufferPoolSize) {
|
||||||
AtomicLong createBufferCounter = new AtomicLong();
|
if (createCounter == null) createCounter = new AtomicLong();
|
||||||
AtomicLong cycleBufferCounter = new AtomicLong();
|
if (cycleCounter == null) cycleCounter = new AtomicLong();
|
||||||
final int rcapacity = this.bufferCapacity;
|
final int rcapacity = this.bufferCapacity;
|
||||||
ObjectPool<ByteBuffer> bufferPool = new ObjectPool<>(createBufferCounter, cycleBufferCounter, bufferPoolSize,
|
ObjectPool<ByteBuffer> bufferPool = new ObjectPool<>(createCounter, cycleCounter, bufferPoolSize,
|
||||||
(Object... params) -> ByteBuffer.allocateDirect(rcapacity), null, (e) -> {
|
(Object... params) -> ByteBuffer.allocateDirect(rcapacity), null, (e) -> {
|
||||||
if (e == null || e.isReadOnly() || e.capacity() != rcapacity) return false;
|
if (e == null || e.isReadOnly() || e.capacity() != rcapacity) return false;
|
||||||
e.clear();
|
e.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user