1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00
srs/trunk
Winlin aa5ec87fcb
Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779)
## Reload Error Ignore

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 $?
#0
```

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.

## Reload Fetch API

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 <495810242@qq.com>
2023-08-30 19:11:57 +08:00
..
3rdparty Incorrect use of two "int i" instances. (#3759) 2023-08-09 19:54:26 +08:00
auto HLS: Ignore empty NALU to avoid error. v6.0.65 (#3750) 2023-08-02 22:49:49 +08:00
conf Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2023-08-30 19:11:57 +08:00
doc Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2023-08-30 19:11:57 +08:00
etc/init.d Squash: Fix bugs 2022-01-13 18:26:28 +08:00
gdb The identifier "ShowCouroutines" needs to be modified to "ShowCoroutines" in order to rectify the typographical error. v6.0.63 (#3703) 2023-07-27 08:12:39 +08:00
ide/srs_clion Merge branch v5.0.103 into develop 2022-12-03 21:15:22 +08:00
modules Moduels: Refine the description 2021-04-21 11:18:35 +08:00
packaging Windows: Refine cygwin pipeline (#3260) 2022-11-21 14:32:26 +08:00
research Upgrade jquery from 1.10.2 to 1.12.2 (#3571) 2023-06-30 06:28:10 +08:00
scripts Package script support extra options. v5.0.102 2022-12-03 18:56:21 +08:00
src Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2023-08-30 19:11:57 +08:00
usr/lib/systemd/system Squash: Support RPM. Fix bugs. 2021-11-04 07:37:17 +08:00
.gitignore For #2136: API: Cleanup no active streams for statistics. v5.0.42 2022-08-19 19:45:19 +08:00
AUTHORS.md TOC: Welcome to the new TOC member, ZhangJunqin. (#3579) 2023-06-13 10:24:40 +08:00
AUTHORS.txt Update AUTHORS 2021-08-25 07:43:35 +08:00
configure Support include empty config file. v5.0.173 v6.0.68 (#3768) 2023-08-28 10:53:27 +08:00
Dockerfile.builds Merge branch v5.0.103 into develop 2022-12-03 21:15:22 +08:00
Dockerfile.cov Asan: Refine asan warning message for macOS. 2022-12-31 21:20:51 +08:00
Dockerfile.pkg Merge branch v5.0.103 into develop 2022-12-03 21:15:22 +08:00
Dockerfile.test GB28181: Enable regression test for gb28181. v5.0.122 2022-12-31 19:47:54 +08:00