update http stream. change to 0.9.49

pull/133/head
winlin 11 years ago
parent 3c63cf0a86
commit c5d3b11a6e

@ -52,9 +52,8 @@ SrsHttpRoot::~SrsHttpRoot()
int SrsHttpRoot::initialize() int SrsHttpRoot::initialize()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
// add root bool default_root_exists = false;
handlers.push_back(new SrsHttpVhost("__http__", "/", _srs_config->get_http_stream_dir()));
// add other virtual path // add other virtual path
SrsConfDirective* root = _srs_config->get_root(); SrsConfDirective* root = _srs_config->get_root();
@ -74,6 +73,16 @@ int SrsHttpRoot::initialize()
std::string dir = _srs_config->get_vhost_http_dir(vhost); std::string dir = _srs_config->get_vhost_http_dir(vhost);
handlers.push_back(new SrsHttpVhost(vhost, mount, dir)); 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; return ret;
@ -86,7 +95,7 @@ bool SrsHttpRoot::can_handle(const char* path, int length, const char** pchild)
*pchild = path; *pchild = path;
// never handle request for root. // never handle request for root.
return false; return true;
} }
bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase) bool SrsHttpRoot::is_handler_valid(SrsHttpMessage* req, int& status_code, std::string& reason_phrase)

Loading…
Cancel
Save