1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

support gmd. change work_dir. hourglass. add utilies.

This commit is contained in:
winlin 2016-01-08 13:58:19 +08:00
parent c9b977d337
commit f1e7e9d933
33 changed files with 702 additions and 73 deletions

View file

@ -1905,11 +1905,6 @@ int SrsConfig::parse_options(int argc, char** argv)
}
}
// cwd
char cwd[256];
getcwd(cwd, sizeof(cwd));
_cwd = cwd;
// config
show_help = true;
for (int i = 1; i < argc; i++) {
@ -1987,6 +1982,18 @@ int SrsConfig::parse_options(int argc, char** argv)
return ret;
}
int SrsConfig::initialize_cwd()
{
int ret = ERROR_SUCCESS;
// cwd
char cwd[256];
getcwd(cwd, sizeof(cwd));
_cwd = cwd;
return ret;
}
int SrsConfig::persistence()
{
int ret = ERROR_SUCCESS;
@ -3529,7 +3536,7 @@ int SrsConfig::check_config()
&& n != "max_connections" && n != "daemon" && n != "heartbeat"
&& n != "http_api" && n != "stats" && n != "vhost" && n != "pithy_print_ms"
&& n != "http_server" && n != "stream_caster" && n != "kafka"
&& n != "utc_time"
&& n != "utc_time" && n != "work_dir"
) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("unsupported directive %s, ret=%d", n.c_str(), ret);
@ -4179,6 +4186,17 @@ bool SrsConfig::get_utc_time()
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
string SrsConfig::get_work_dir() {
static string DEFAULT = "";
SrsConfDirective* conf = root->get("work_dir");
if( !conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0();
}
vector<SrsConfDirective*> SrsConfig::get_stream_casters()
{
srs_assert(root);