mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
d21ef106a0
commit
51af2b4779
10 changed files with 68 additions and 227 deletions
|
@ -1227,3 +1227,23 @@ string dump_string_hex(const char* buf, const int nb_buf, const int& max_len)
|
|||
return ret;
|
||||
|
||||
}
|
||||
|
||||
string srs_getenv(string key)
|
||||
{
|
||||
string ekey = key;
|
||||
if (srs_string_starts_with(key, "$")) {
|
||||
ekey = key.substr(1);
|
||||
}
|
||||
|
||||
if (ekey.empty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
char* value = ::getenv(ekey.c_str());
|
||||
if (value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue