mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
rename network_device_index to network
This commit is contained in:
parent
b8ae5c63fc
commit
f4ea48adcb
6 changed files with 19 additions and 19 deletions
|
@ -1249,7 +1249,7 @@ int SrsConfig::check_config()
|
|||
SrsConfDirective* conf = get_stats();
|
||||
for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
|
||||
string n = conf->at(i)->name;
|
||||
if (n != "network_device_index" && n != "disk_device_name") {
|
||||
if (n != "network" && n != "disk_device_name") {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported stats directive %s, ret=%d", n.c_str(), ret);
|
||||
return ret;
|
||||
|
@ -1442,10 +1442,10 @@ int SrsConfig::check_config()
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
// check stats
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
if (get_stats_network_device_index() < 0) {
|
||||
if (get_stats_network() < 0) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("directive stats network_device_index invalid, network_device_index=%d, ret=%d",
|
||||
get_stats_network_device_index(), ret);
|
||||
srs_error("directive stats network invalid, network=%d, ret=%d",
|
||||
get_stats_network(), ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3178,7 +3178,7 @@ SrsConfDirective* SrsConfig::get_stats()
|
|||
return root->get("stats");
|
||||
}
|
||||
|
||||
int SrsConfig::get_stats_network_device_index()
|
||||
int SrsConfig::get_stats_network()
|
||||
{
|
||||
SrsConfDirective* conf = get_stats();
|
||||
|
||||
|
@ -3186,7 +3186,7 @@ int SrsConfig::get_stats_network_device_index()
|
|||
return SRS_CONF_DEFAULT_STATS_NETWORK_DEVICE_INDEX;
|
||||
}
|
||||
|
||||
conf = conf->get("network_device_index");
|
||||
conf = conf->get("network");
|
||||
if (!conf || conf->arg0().empty()) {
|
||||
return SRS_CONF_DEFAULT_STATS_NETWORK_DEVICE_INDEX;
|
||||
}
|
||||
|
|
|
@ -942,7 +942,7 @@ public:
|
|||
* for heartbeat to report to server, or to get the local ip.
|
||||
* for example, 0 means the eth0 maybe.
|
||||
*/
|
||||
virtual int get_stats_network_device_index();
|
||||
virtual int get_stats_network();
|
||||
/**
|
||||
* get the disk stat device name list.
|
||||
* the device name configed in args of directive.
|
||||
|
|
|
@ -61,7 +61,7 @@ void SrsHttpHeartbeat::heartbeat()
|
|||
|
||||
vector<string>& ips = srs_get_local_ipv4_ips();
|
||||
if (!ips.empty()) {
|
||||
ip = ips[_srs_config->get_stats_network_device_index() % (int)ips.size()];
|
||||
ip = ips[_srs_config->get_stats_network() % (int)ips.size()];
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue