fixed memory leak of ssl session reuse in dyups and session sticky module#1708
Merged
Conversation
Member
Author
Member
Author
|
It reuses ssl session reuse of round robin module now, and removes duplicated codes in session sticky module.
chobits
commented
Nov 26, 2022
| sspd->sscf = sscf; | ||
| sspd->get_rr_peer = ngx_http_upstream_get_round_robin_peer; | ||
|
|
||
| r->upstream->peer.data = sspd; |
Member
Author
There was a problem hiding this comment.
We make sure that (sspd == &sspd->rr). See:
typedef struct {
/* the round robin data must be first */
ngx_http_upstream_rr_peer_data_t rrp; <- &sspd->rrp
...
ngx_http_upstream_ss_peer_data_t; <- sspd
(refer to nginx core module: ngx_http_upstream_ip_hash_module.c)
chobits
commented
Nov 26, 2022
| ngx_http_upstream_session_sticky_set_peer_session; | ||
| r->upstream->peer.save_session = | ||
| ngx_http_upstream_session_sticky_save_peer_session; | ||
| #endif |
Member
Author
There was a problem hiding this comment.
Dont need to re-write set_session() and save_session() function when u->peer.data is pointer of ngx_http_upstream_rr_peer_data_t, see ngx_http_upstream_ip_hash_module.c.
Only when u->peer.data is changed to module private data, it needs to re-write these two callbacks. For example, see ngx_http_upstream_keepalive_module.c or dyups module.
nandsky
reviewed
Nov 28, 2022
nandsky
left a comment
Collaborator
There was a problem hiding this comment.
这个module里有不少code style问题,本次pr要不一起调整了?
wangfakang
approved these changes
Nov 29, 2022
Member
Author
has been merged. May next time |
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.
try to fix #1016
todo: added test case for session reuse into dyups.ttodo: added test case for session reuse into session_sticky.t