-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support HTTP-API for fetching reload result. v5.0.176 (#3779)
During a Reload, several stages will be passed through: 1. Parsing new configurations: Parse. 2. Transforming configurations: Transform. 3. Applying configurations: Apply. Previously, any error at any stage would result in a direct exit, making the system completely dependent on configuration checks: ```bash ./objs/srs -c conf/srs.conf -t echo $? ``` Optimized to: If an error occurs before applying the configuration, it can be ignored. If an error occurs during the application of the configuration, some of the configuration may have already taken effect, leading to unpredictable behavior, so SRS will exit directly. Added a new HTTP API to query the result of the reload. ```nginx http_api { enabled on; raw_api { enabled on; allow_reload on; } } ``` ```bash curl http://localhost:1985/api/v1/raw?rpc=reload-fetch ``` ```json { "code": 0, "data": { "err": 0, "msg": "Success", "state": 0, "rid": "0s6y0n9" } } { "code": 0, "data": { "err": 1023, "msg": "code=1023(ConfigInvalid) : parse file : parse buffer containers/conf/srs.release-local.conf : root parse : parse dir : parse include buffer containers/data/config/srs.vhost.conf : read token, line=0, state=0 : line 3: unexpected end of file, expecting ; or \"}\"", "state": 1, "rid": "0g4z471" } } ``` This way, you can know if the last reload of the system was successful. --------- Co-authored-by: Haibo Chen <[email protected]>
- Loading branch information
1 parent
cbb5edc
commit 0df81c3
Showing
9 changed files
with
83 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
|
||
#define VERSION_MAJOR 5 | ||
#define VERSION_MINOR 0 | ||
#define VERSION_REVISION 175 | ||
#define VERSION_REVISION 176 | ||
|
||
#endif |