Config: Improve env config to support multi values. v7.0.2#4092
Merged
winlinvip merged 3 commits intoossrs:developfrom Aug 13, 2024
Merged
Config: Improve env config to support multi values. v7.0.2#4092winlinvip merged 3 commits intoossrs:developfrom
winlinvip merged 3 commits intoossrs:developfrom
Conversation
5f6f0a9 to
5ba500c
Compare
5ba500c to
f33f1ad
Compare
winlinvip
reviewed
Aug 12, 2024
0bb9637 to
2e211f6
Compare
let http_hooks env overwrite support multi values; e.g. SRS_VHOST_HTTP_HOOKS_ON_CONNECT="http://127.0.0.1/api/connect http://localhost/api/connect"
f33f1ad to
b49ed17
Compare
winlinvip
approved these changes
Aug 13, 2024
winlinvip
added a commit
that referenced
this pull request
Aug 13, 2024
1. add on_connect & on_close directives to conf/full.conf; 2. let http_hooks env overwrite support multi values; e.g. SRS_VHOST_HTTP_HOOKS_ON_CONNECT="http://127.0.0.1/api/connect http://localhost/api/connect" related to #1222 (comment) Above comments said `http_hook` env may not works as expected, as I found there are still has some issue in `http_hooks` env configuration, but this PR may not target above problem. --------- Co-authored-by: winlin <winlinvip@gmail.com>
winlinvip
added a commit
that referenced
this pull request
Aug 15, 2024
1. don't use static variable to store the result; 2. add more UT to handle the multi value and values with whitespaces; related to #4092 https://github.com/ossrs/srs/blob/16e569d82357757ddac6ef91d7a5fe7837319909/trunk/src/app/srs_app_config.cpp#L71-L82 `static SrsConfDirective* dir` removed, this static var here is to avoid the memory leak, I add the `SrsConfDirective` instance to the `env_dirs` directive container, which will destroy itself inside `SrsConfig` destructor. --------- Co-authored-by: winlin <winlinvip@gmail.com>
winlinvip
added a commit
that referenced
this pull request
Aug 15, 2024
1. don't use static variable to store the result; 2. add more UT to handle the multi value and values with whitespaces; related to #4092 https://github.com/ossrs/srs/blob/16e569d82357757ddac6ef91d7a5fe7837319909/trunk/src/app/srs_app_config.cpp#L71-L82 `static SrsConfDirective* dir` removed, this static var here is to avoid the memory leak, I add the `SrsConfDirective` instance to the `env_dirs` directive container, which will destroy itself inside `SrsConfig` destructor. --------- Co-authored-by: winlin <winlinvip@gmail.com>
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.
related to #1222 (comment)
Above comments said
http_hookenv may not works as expected, as I found there are still has some issue inhttp_hooksenv configuration, but this PR may not target above problem.