mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refactor bandwidth test, refactor the interface of bandwidth server object.
This commit is contained in:
parent
7f21520e9f
commit
b1dd0218be
4 changed files with 45 additions and 37 deletions
|
@ -211,12 +211,14 @@ int SrsRtmpConn::service_cycle()
|
|||
}
|
||||
srs_verbose("set peer bandwidth success");
|
||||
|
||||
// get the ip which client connected.
|
||||
std::string local_ip = srs_get_local_ip(st_netfd_fileno(stfd));
|
||||
|
||||
// do bandwidth test if connect to the vhost which is for bandwidth check.
|
||||
if (_srs_config->get_bw_check_enabled(req->vhost)) {
|
||||
return bandwidth->bandwidth_test(req, stfd, rtmp);
|
||||
return bandwidth->bandwidth_check(rtmp, req, local_ip);
|
||||
}
|
||||
|
||||
std::string local_ip = srs_get_local_ip(st_netfd_fileno(stfd));
|
||||
if ((ret = rtmp->response_connect_app(req, local_ip.c_str())) != ERROR_SUCCESS) {
|
||||
srs_error("response connect app failed. ret=%d", ret);
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue