You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
2 years ago
..
3rdparty Incorrect use of two "int i" instances. (#3759) 2 years ago
auto HLS: Ignore empty NALU to avoid error. v6.0.65 (#3750) 2 years ago
conf Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2 years ago
doc Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2 years ago
etc/init.d Squash: Fix bugs 3 years ago
gdb The identifier "ShowCouroutines" needs to be modified to "ShowCoroutines" in order to rectify the typographical error. v6.0.63 (#3703) 2 years ago
ide/srs_clion Merge branch v5.0.103 into develop 2 years ago
modules Moduels: Refine the description 4 years ago
packaging Windows: Refine cygwin pipeline (#3260) 2 years ago
research Upgrade jquery from 1.10.2 to 1.12.2 (#3571) 2 years ago
scripts Package script support extra options. v5.0.102 2 years ago
src Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2 years ago
usr/lib/systemd/system Squash: Support RPM. Fix bugs. 3 years ago
.gitignore For #2136: API: Cleanup no active streams for statistics. v5.0.42 3 years ago
AUTHORS.md TOC: Welcome to the new TOC member, ZhangJunqin. (#3579) 2 years ago
AUTHORS.txt Update AUTHORS 4 years ago
Dockerfile.builds Merge branch v5.0.103 into develop 2 years ago
Dockerfile.cov Asan: Refine asan warning message for macOS. 2 years ago
Dockerfile.pkg Merge branch v5.0.103 into develop 2 years ago
Dockerfile.test GB28181: Enable regression test for gb28181. v5.0.122 2 years ago
configure Support include empty config file. v5.0.173 v6.0.68 (#3768) 2 years ago