|
|
|
@ -3726,7 +3726,8 @@ srs_error_t SrsConfig::check_normal_config()
|
|
|
|
|
} else if (n == "cluster") {
|
|
|
|
|
for (int j = 0; j < (int)conf->directives.size(); j++) {
|
|
|
|
|
string m = conf->at(j)->name;
|
|
|
|
|
if (m != "mode" && m != "origin" && m != "token_traverse" && m != "vhost" && m != "debug_srs_upnode" && m != "coworkers") {
|
|
|
|
|
if (m != "mode" && m != "origin" && m != "token_traverse" && m != "vhost" && m != "debug_srs_upnode" && m != "coworkers"
|
|
|
|
|
&& m != "origin_cluster") {
|
|
|
|
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.cluster.%s of %s", m.c_str(), vhost->arg0().c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -5157,6 +5158,28 @@ string SrsConfig::get_vhost_edge_transform_vhost(string vhost)
|
|
|
|
|
return conf->arg0();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SrsConfig::get_vhost_origin_cluster(string vhost)
|
|
|
|
|
{
|
|
|
|
|
static bool DEFAULT = false;
|
|
|
|
|
|
|
|
|
|
SrsConfDirective* conf = get_vhost(vhost);
|
|
|
|
|
if (!conf) {
|
|
|
|
|
return DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conf = conf->get("cluster");
|
|
|
|
|
if (!conf) {
|
|
|
|
|
return DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conf = conf->get("origin_cluster");
|
|
|
|
|
if (!conf || conf->arg0().empty()) {
|
|
|
|
|
return DEFAULT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SRS_CONF_PERFER_FALSE(conf->arg0());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vector<string> SrsConfig::get_vhost_coworkers(string vhost)
|
|
|
|
|
{
|
|
|
|
|
vector<string> coworkers;
|
|
|
|
|