mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Squash: SRS 4.0, Stat the oc(origin cluster).
This commit is contained in:
parent
e127880ec2
commit
cd7e5a131e
6 changed files with 24 additions and 20 deletions
|
@ -4903,10 +4903,16 @@ string SrsConfig::get_vhost_edge_transform_vhost(string vhost)
|
|||
}
|
||||
|
||||
bool SrsConfig::get_vhost_origin_cluster(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
return get_vhost_origin_cluster(conf);
|
||||
}
|
||||
|
||||
bool SrsConfig::get_vhost_origin_cluster(SrsConfDirective* vhost)
|
||||
{
|
||||
static bool DEFAULT = false;
|
||||
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
SrsConfDirective* conf = vhost;
|
||||
if (!conf) {
|
||||
return DEFAULT;
|
||||
}
|
||||
|
|
|
@ -717,6 +717,7 @@ public:
|
|||
// Whether enable the origin cluster.
|
||||
// @see https://github.com/ossrs/srs/wiki/v3_EN_OriginCluster
|
||||
virtual bool get_vhost_origin_cluster(std::string vhost);
|
||||
virtual bool get_vhost_origin_cluster(SrsConfDirective* conf);
|
||||
// Get the co-workers of origin cluster.
|
||||
// @see https://github.com/ossrs/srs/wiki/v3_EN_OriginCluster
|
||||
virtual std::vector<std::string> get_vhost_coworkers(std::string vhost);
|
||||
|
|
|
@ -51,7 +51,7 @@ void srs_build_features(stringstream& ss)
|
|||
int nn_vhosts = 0;
|
||||
bool rtsp = false, forward = false, ingest = false, edge = false, hls = false, dvr = false, flv = false;
|
||||
bool hooks = false, dash = false, hds = false, exec = false, transcode = false, security = false;
|
||||
bool flv2 = false;
|
||||
bool flv2 = false, oc = false;
|
||||
|
||||
SrsConfDirective* root = _srs_config->get_root();
|
||||
// Note that we limit the loop, never detect all configs.
|
||||
|
@ -76,6 +76,9 @@ void srs_build_features(stringstream& ss)
|
|||
if (!edge && _srs_config->get_vhost_is_edge(conf)) {
|
||||
edge = true;
|
||||
}
|
||||
if (!oc && _srs_config->get_vhost_origin_cluster(conf)) {
|
||||
oc = true;
|
||||
}
|
||||
if (!hls && _srs_config->get_hls_enabled(conf)) {
|
||||
hls = true;
|
||||
}
|
||||
|
@ -124,6 +127,7 @@ void srs_build_features(stringstream& ss)
|
|||
SRS_CHECK_FEATURE(forward, ss);
|
||||
SRS_CHECK_FEATURE(ingest, ss);
|
||||
SRS_CHECK_FEATURE(edge, ss);
|
||||
SRS_CHECK_FEATURE(oc, ss);
|
||||
SRS_CHECK_FEATURE(hls, ss);
|
||||
SRS_CHECK_FEATURE(dvr, ss);
|
||||
SRS_CHECK_FEATURE(flv, ss);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue