mirror of https://github.com/apache/cassandra
Merge 5b36bdd6e7 into bdbdf8d710
This commit is contained in:
commit
2a814b076d
|
|
@ -257,7 +257,8 @@ public class EncryptionUtils
|
|||
{
|
||||
int readLength = dst.remaining();
|
||||
// we should only be performing encrypt/decrypt operations with on-heap buffers, so calling BB.array() should be legit here
|
||||
fileDataInput.readFully(dst.array(), dst.position(), readLength);
|
||||
fileDataInput.readFully(dst.array(), dst.arrayOffset() + dst.position(), readLength);
|
||||
dst.position(dst.position() + readLength);
|
||||
return readLength;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,6 +233,7 @@ public final class SSLFactory
|
|||
*/
|
||||
public static void clearSslContextCache()
|
||||
{
|
||||
cachedSslContexts.values().forEach(ReferenceCountUtil::release);
|
||||
cachedSslContexts.clear();
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +245,11 @@ public final class SSLFactory
|
|||
cachedSslContexts.forEachKey(1, cacheKey -> {
|
||||
if (Objects.equals(options, cacheKey.encryptionOptions))
|
||||
{
|
||||
cachedSslContexts.remove(cacheKey);
|
||||
SslContext ctx = cachedSslContexts.remove(cacheKey);
|
||||
if (ctx != null)
|
||||
{
|
||||
ReferenceCountUtil.release(ctx);
|
||||
}
|
||||
keysToCheck.remove(cacheKey);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue