1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

specifies the try default vhost

This commit is contained in:
winlin 2015-12-24 19:14:23 +08:00
parent d267b8fa19
commit 11e11005ac
2 changed files with 5 additions and 5 deletions

View file

@ -418,8 +418,8 @@ int SrsRtmpConn::do_cycle()
return ret;
}
// check vhost
if ((ret = check_vhost()) != ERROR_SUCCESS) {
// check vhost, allow default vhost.
if ((ret = check_vhost(true)) != ERROR_SUCCESS) {
srs_error("check vhost failed. ret=%d", ret);
return ret;
}
@ -787,13 +787,13 @@ int SrsRtmpConn::stream_service_cycle()
return ret;
}
int SrsRtmpConn::check_vhost()
int SrsRtmpConn::check_vhost(bool try_default_vhost)
{
int ret = ERROR_SUCCESS;
srs_assert(req != NULL);
SrsConfDirective* vhost = _srs_config->get_vhost(req->vhost);
SrsConfDirective* vhost = _srs_config->get_vhost(req->vhost, try_default_vhost);
if (vhost == NULL) {
ret = ERROR_RTMP_VHOST_NOT_FOUND;
srs_error("vhost %s not found. ret=%d", req->vhost.c_str(), ret);