mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine blackhole for session
This commit is contained in:
parent
fccbe98f70
commit
db43faa848
4 changed files with 6 additions and 6 deletions
|
@ -462,8 +462,8 @@ rtc_server {
|
||||||
black_hole {
|
black_hole {
|
||||||
# Whether enable the black-hole.
|
# Whether enable the black-hole.
|
||||||
enabled off;
|
enabled off;
|
||||||
# The black-hole address for publisher, or SRS as receiver.
|
# The black-hole address for session.
|
||||||
publisher 127.0.0.1:10000;
|
addr 127.0.0.1:10000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4884,7 +4884,7 @@ bool SrsConfig::get_rtc_server_black_hole()
|
||||||
return SRS_CONF_PERFER_FALSE(conf->arg0());
|
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 = "";
|
static string DEFAULT = "";
|
||||||
|
|
||||||
|
@ -4898,7 +4898,7 @@ std::string SrsConfig::get_rtc_server_black_hole_publisher()
|
||||||
return DEFAULT;
|
return DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf = conf->get("publisher");
|
conf = conf->get("addr");
|
||||||
if (!conf || conf->arg0().empty()) {
|
if (!conf || conf->arg0().empty()) {
|
||||||
return DEFAULT;
|
return DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,7 +532,7 @@ public:
|
||||||
virtual bool get_rtc_server_merge_nalus();
|
virtual bool get_rtc_server_merge_nalus();
|
||||||
virtual bool get_rtc_server_perf_stat();
|
virtual bool get_rtc_server_perf_stat();
|
||||||
virtual bool get_rtc_server_black_hole();
|
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:
|
private:
|
||||||
virtual int get_rtc_server_reuseport2();
|
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);
|
srs_trace("RTC init session, timeout=%dms, blackhole=%d", srsu2msi(sessionStunTimeout), blackhole);
|
||||||
|
|
||||||
if (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()) {
|
if (!blackhole_ep.empty()) {
|
||||||
string host; int port;
|
string host; int port;
|
||||||
srs_parse_hostport(blackhole_ep, host, port);
|
srs_parse_hostport(blackhole_ep, host, port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue