Cleanup
This commit is contained in:
parent
3d715a4967
commit
7018b8453f
@ -17,8 +17,6 @@ package io.netty.handler.ssl;
|
|||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import javax.net.ssl.SSLEngine;
|
|
||||||
|
|
||||||
public class DefaultSslBufferPool implements SslBufferPool {
|
public class DefaultSslBufferPool implements SslBufferPool {
|
||||||
|
|
||||||
private static final int DEFAULT_POOL_SIZE = MAX_PACKET_SIZE * 1024;
|
private static final int DEFAULT_POOL_SIZE = MAX_PACKET_SIZE * 1024;
|
||||||
@ -73,6 +71,7 @@ public class DefaultSslBufferPool implements SslBufferPool {
|
|||||||
return index * MAX_PACKET_SIZE;
|
return index * MAX_PACKET_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized ByteBuffer acquireBuffer() {
|
public synchronized ByteBuffer acquireBuffer() {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return ByteBuffer.allocate(MAX_PACKET_SIZE);
|
return ByteBuffer.allocate(MAX_PACKET_SIZE);
|
||||||
@ -81,6 +80,7 @@ public class DefaultSslBufferPool implements SslBufferPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void releaseBuffer(ByteBuffer buffer) {
|
public synchronized void releaseBuffer(ByteBuffer buffer) {
|
||||||
if (index < maxBufferCount) {
|
if (index < maxBufferCount) {
|
||||||
pool[index ++] = buffer;
|
pool[index ++] = buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user