srs/trunk/src/core
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
..
srs_core_autofree.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_autofree.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_performance.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_performance.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_platform.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_platform.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_time.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_time.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version3.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version3.hpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version4.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version4.hpp HLS: Ignore empty NALU to avoid error. v6.0.65 (#3750) 2023-08-02 22:49:49 +08:00
srs_core_version5.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version5.hpp Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2023-08-30 19:11:57 +08:00
srs_core_version6.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core_version6.hpp Support HTTP-API for fetching reload result. v5.0.176 v6.0.71 (#3779) 2023-08-30 19:11:57 +08:00
srs_core.cpp SRS5: Update license date to 2023. v5.0.123 2023-01-01 08:56:20 +08:00
srs_core.hpp Bugfix: Eliminate the redundant declaration of the _srs_rtc_manager variable. v5.0.169 v6.0.62 (#3699) 2023-07-26 20:14:30 +08:00