mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
update http stream. change to 0.9.49
This commit is contained in:
parent
3c63cf0a86
commit
c5d3b11a6e
1 changed files with 13 additions and 4 deletions
|
@ -53,8 +53,7 @@ int SrsHttpRoot::initialize()
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// add root
|
||||
handlers.push_back(new SrsHttpVhost("__http__", "/", _srs_config->get_http_stream_dir()));
|
||||
bool default_root_exists = false;
|
||||
|
||||
// add other virtual path
|
||||
SrsConfDirective* root = _srs_config->get_root();
|
||||
|
@ -74,6 +73,16 @@ int SrsHttpRoot::initialize()
|
|||
std::string dir = _srs_config->get_vhost_http_dir(vhost);
|
||||
|
||||
handlers.push_back(new SrsHttpVhost(vhost, mount, dir));
|
||||
|
||||
if (mount == "/") {
|
||||
default_root_exists = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!default_root_exists) {
|
||||
// add root
|
||||
handlers.push_back(new SrsHttpVhost(
|
||||
"__http__", "/", _srs_config->get_http_stream_dir()));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -86,7 +95,7 @@ bool SrsHttpRoot::can_handle(const char* path, int length, const char** pchild)
|
|||
*pchild = path;
|
||||
|
||||
// never handle request for root.
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue