正在显示
2 个修改的文件
包含
11 行增加
和
5 行删除
| @@ -406,12 +406,17 @@ int SrsApiSummaries::do_process_request(SrsSocket* skt, SrsHttpMessage* req) | @@ -406,12 +406,17 @@ int SrsApiSummaries::do_process_request(SrsSocket* skt, SrsHttpMessage* req) | ||
| 406 | int nb_n = srs_get_network_devices_count(); | 406 | int nb_n = srs_get_network_devices_count(); |
| 407 | for (int i = 0; i < nb_n; i++) { | 407 | for (int i = 0; i < nb_n; i++) { |
| 408 | SrsNetworkDevices& o = n[i]; | 408 | SrsNetworkDevices& o = n[i]; |
| 409 | - if (o.ok) { | ||
| 410 | - n_ok = true; | ||
| 411 | - nr_bytes += o.rbytes; | ||
| 412 | - ns_bytes += o.sbytes; | ||
| 413 | - n_sample_time = o.sample_time; | 409 | + |
| 410 | + // ignore the lo interface. | ||
| 411 | + std::string inter = o.name; | ||
| 412 | + if (!o.ok || inter == "lo") { | ||
| 413 | + continue; | ||
| 414 | } | 414 | } |
| 415 | + | ||
| 416 | + n_ok = true; | ||
| 417 | + nr_bytes += o.rbytes; | ||
| 418 | + ns_bytes += o.sbytes; | ||
| 419 | + n_sample_time = o.sample_time; | ||
| 415 | } | 420 | } |
| 416 | 421 | ||
| 417 | ss << JOBJECT_START | 422 | ss << JOBJECT_START |
| @@ -509,6 +509,7 @@ void srs_update_network_devices() | @@ -509,6 +509,7 @@ void srs_update_network_devices() | ||
| 509 | 509 | ||
| 510 | if (ret == 17) { | 510 | if (ret == 17) { |
| 511 | r.ok = true; | 511 | r.ok = true; |
| 512 | + r.name[sizeof(r.name) - 1] = 0; | ||
| 512 | _nb_srs_system_network_devices = i + 1; | 513 | _nb_srs_system_network_devices = i + 1; |
| 513 | r.sample_time = srs_get_system_time_ms(); | 514 | r.sample_time = srs_get_system_time_ms(); |
| 514 | } | 515 | } |
-
请 注册 或 登录 后发表评论