ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.86k stars 5.29k forks source link

Support include empty config file. v5.0.173 v6.0.68 #3768

Closed winlinvip closed 10 months ago

winlinvip commented 11 months ago

Include Empty Config File

SRS supports including another configuration in the include package. When generating configurations, we can only generate the changed configurations, while the unchanged configurations are in the fixed files, for example:

listen 1935;
include server.conf;

In server.conf, we can manage the changing configurations with the program:

http_api { enabled on; }

However, during system initialization, we often create an empty server.conf, and the content is generated only after the program starts, so server.conf might be an empty file. This also makes it convenient to use a script to confirm the existence of this file:

touch server.conf

Currently, SRS does not support empty configurations and will report an error. This PR is to solve this problem, making it more convenient to use include.

TRANS_BY_GPT4


Co-authored-by: Haibo Chen 495810242@qq.com