RTC: Refine blackhole for session

pull/1809/head
winlin 5 years ago
parent fccbe98f70
commit db43faa848

@ -462,8 +462,8 @@ rtc_server {
black_hole {
# Whether enable the black-hole.
enabled off;
# The black-hole address for publisher, or SRS as receiver.
publisher 127.0.0.1:10000;
# The black-hole address for session.
addr 127.0.0.1:10000;
}
}

@ -4884,7 +4884,7 @@ bool SrsConfig::get_rtc_server_black_hole()
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
std::string SrsConfig::get_rtc_server_black_hole_publisher()
std::string SrsConfig::get_rtc_server_black_hole_addr()
{
static string DEFAULT = "";
@ -4898,7 +4898,7 @@ std::string SrsConfig::get_rtc_server_black_hole_publisher()
return DEFAULT;
}
conf = conf->get("publisher");
conf = conf->get("addr");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}

@ -532,7 +532,7 @@ public:
virtual bool get_rtc_server_merge_nalus();
virtual bool get_rtc_server_perf_stat();
virtual bool get_rtc_server_black_hole();
virtual std::string get_rtc_server_black_hole_publisher();
virtual std::string get_rtc_server_black_hole_addr();
private:
virtual int get_rtc_server_reuseport2();

@ -2061,7 +2061,7 @@ srs_error_t SrsRtcSession::initialize(SrsRtcSource* source, SrsRequest* r, bool
srs_trace("RTC init session, timeout=%dms, blackhole=%d", srsu2msi(sessionStunTimeout), blackhole);
if (blackhole) {
string blackhole_ep = _srs_config->get_rtc_server_black_hole_publisher();
string blackhole_ep = _srs_config->get_rtc_server_black_hole_addr();
if (!blackhole_ep.empty()) {
string host; int port;
srs_parse_hostport(blackhole_ep, host, port);

Loading…
Cancel
Save