Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

chrisvest
Copy link
Member

Motivation:
Loop was adding nativeSslSession to the toBeRemoved list, instead of the loop variable sslSession.

Modification:
Add the loop variable instead, because the nativeSslSession can very likely be null at that point, and is specifically also not the session we want to remove.

Result:
Fewer bugs in SSL session caching

Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very likely be null at that point, and is specifically also not the session we want to remove.

Result:
Fewer bugs in SSL session caching
@chrisvest chrisvest added this to the 4.1.114.Final milestone Sep 23, 2024
@@ -99,7 +99,7 @@ boolean setSession(long ssl, OpenSslSession session, String host, int port) {
if (toBeRemoved == null) {
toBeRemoved = new ArrayList<NativeSslSession>(2);
}
toBeRemoved.add(nativeSslSession);
toBeRemoved.add(sslSession);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a good way to test for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in #14358 catch it. I'll add a more focused test there.

@chrisvest chrisvest merged commit bbd3a4a into netty:4.1 Sep 24, 2024
17 checks passed
@chrisvest chrisvest deleted the 4.1-ssl-session-remove branch September 24, 2024 04:00
@normanmaurer
Copy link
Member

🤦 Thanks for fixing

normanmaurer pushed a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching
normanmaurer added a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching

Co-authored-by: Chris Vest <[email protected]>
normanmaurer pushed a commit that referenced this pull request Sep 24, 2024
Motivation:
Loop was adding `nativeSslSession` to the `toBeRemoved` list, instead of
the loop variable `sslSession`.

Modification:
Add the loop variable instead, because the `nativeSslSession` can very
likely be null at that point, and is specifically also not the session
we want to remove.

Result:
Fewer bugs in SSL session caching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants