mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
token bug
多级origin-edge模式,edge上功能不生效
This commit is contained in:
parent
0c132e9781
commit
3d0d43c5dc
1 changed files with 10 additions and 8 deletions
|
@ -244,6 +244,16 @@ int SrsRtmpConn::service_cycle()
|
||||||
return bandwidth->bandwidth_check(rtmp, skt, req, local_ip);
|
return bandwidth->bandwidth_check(rtmp, skt, req, local_ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do token traverse before serve it.
|
||||||
|
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||||
|
bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost);
|
||||||
|
if (vhost_is_edge && edge_traverse) {
|
||||||
|
if ((ret = check_edge_token_traverse_auth()) != ERROR_SUCCESS) {
|
||||||
|
srs_warn("token auth failed, ret=%d", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = rtmp->response_connect_app(req, local_ip.c_str())) != ERROR_SUCCESS) {
|
if ((ret = rtmp->response_connect_app(req, local_ip.c_str())) != ERROR_SUCCESS) {
|
||||||
srs_error("response connect app failed. ret=%d", ret);
|
srs_error("response connect app failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -326,15 +336,7 @@ int SrsRtmpConn::stream_service_cycle()
|
||||||
}
|
}
|
||||||
srs_info("set chunk_size=%d success", chunk_size);
|
srs_info("set chunk_size=%d success", chunk_size);
|
||||||
|
|
||||||
// do token traverse before serve it.
|
|
||||||
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||||
bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost);
|
|
||||||
if (vhost_is_edge && edge_traverse) {
|
|
||||||
if ((ret = check_edge_token_traverse_auth()) != ERROR_SUCCESS) {
|
|
||||||
srs_warn("token auth failed, ret=%d", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// find a source to serve.
|
// find a source to serve.
|
||||||
SrsSource* source = NULL;
|
SrsSource* source = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue