ossrs / srs

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

Config: Add more utest for env config. v6.0.147 v7.0.4 #4142

Closed suzp1984 closed 3 months ago

suzp1984 commented 3 months ago
  1. don't use static variable to store the result;
  2. add more UT to handle the multi value and values with whitespaces;

related to #4092

https://github.com/ossrs/srs/blob/16e569d82357757ddac6ef91d7a5fe7837319909/trunk/src/app/srs_app_config.cpp#L71-L82

static SrsConfDirective* dir removed, this static var here is to avoid the memory leak, I add the SrsConfDirective instance to the env_dirs directive container, which will destroy itself inside SrsConfig destructor.