From 18a155bf310b056c72d4e964d71fe53d55d89f51 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 13 Oct 2021 08:13:00 +0800 Subject: [PATCH] API: Stat the oc(origin cluster). --- trunk/src/app/srs_app_config.cpp | 8 +++++++- trunk/src/app/srs_app_config.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index fae390c39..4873bdda5 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -4859,10 +4859,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; } diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp index a59962325..c62351c87 100644 --- a/trunk/src/app/srs_app_config.hpp +++ b/trunk/src/app/srs_app_config.hpp @@ -713,6 +713,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 get_vhost_coworkers(std::string vhost);