Support for OpenSslEngine with no finalizer#1695
Open
johnou wants to merge 1 commit intoAsyncHttpClient:mainfrom
Open
Support for OpenSslEngine with no finalizer#1695johnou wants to merge 1 commit intoAsyncHttpClient:mainfrom
johnou wants to merge 1 commit intoAsyncHttpClient:mainfrom
Conversation
Motivation: Custom SslContext should be retained on init. Modification: Retain custom SslContext. Result: Externally managed SslContext refcount is managed correctly.
Contributor
Author
|
Follow up for #1669 @normanmaurer ptal |
Contributor
|
Why? In this case, SslContext is provided by the user so he has control over ref count. Moreover, isn’t it created with a refcount of 1? |
Contributor
Author
|
@slandelle yep but then it is decreased in destroy. point is user should know if they haven't cleaned up any resources, so in the case we are dealing with an SslContext provided by the user, refcount will be incremented to 2, then decremented back to 1 once destroy is invoked on the SslEngineFactory. |
Contributor
Author
|
I don't think the test failures are related.. |
Contributor
Author
|
The other possible solution is something like this.. https://gist.github.com/johnou/4c699909ef9be3c030eaee29432c1ce3#file-defaultsslenginefactory-java-L34 |
6ea11f4 to
f8fab66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
Custom SslContext should be retained on init.
Modification:
Retain custom SslContext.
Result:
Externally managed SslContext refcount is managed correctly.