1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +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);

View file

@ -171,7 +171,7 @@ private:
virtual int service_cycle();
// stream(play/publish) service cycle, identify client first.
virtual int stream_service_cycle();
virtual int check_vhost();
virtual int check_vhost(bool try_default_vhost);
virtual int playing(SrsSource* source);
virtual int do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRecvThread* trd);
virtual int publishing(SrsSource* source);