Skip to content

Commit

Permalink
Return the correct pointer from ReferenceCountedOpenSslContext.contex…
Browse files Browse the repository at this point in the history
…t() and sslCtxPointer() (netty#8562)

Motivation:

We did not return the pointer to SSL_CTX put to the internal datastructure of tcnative.

Modifications:

Return the correct pointer.

Result:

Methods work as documented in the javadocs.
  • Loading branch information
normanmaurer authored Nov 16, 2018
1 parent 7667361 commit 20d4fda
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,7 @@ public final SSLEngine newEngine(ByteBufAllocator alloc) {
*/
@Deprecated
public final long context() {
Lock readerLock = ctxLock.readLock();
readerLock.lock();
try {
return ctx;
} finally {
readerLock.unlock();
}
return sslCtxPointer();
}

/**
Expand Down Expand Up @@ -502,7 +496,7 @@ public final long sslCtxPointer() {
Lock readerLock = ctxLock.readLock();
readerLock.lock();
try {
return ctx;
return SSLContext.getSslCtx(ctx);
} finally {
readerLock.unlock();
}
Expand Down

0 comments on commit 20d4fda

Please sign in to comment.