mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #913, reload use complex error
This commit is contained in:
parent
3744606c9b
commit
fd91df9411
28 changed files with 642 additions and 630 deletions
|
@ -813,29 +813,30 @@ void SrsHttpStreamServer::http_unmount(SrsSource* s, SrsRequest* r)
|
|||
entry->stream->entry->enabled = false;
|
||||
}
|
||||
|
||||
int SrsHttpStreamServer::on_reload_vhost_added(string vhost)
|
||||
srs_error_t SrsHttpStreamServer::on_reload_vhost_added(string vhost)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if ((ret = on_reload_vhost_http_remux_updated(vhost)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
if ((err = on_reload_vhost_http_remux_updated(vhost)) != srs_success) {
|
||||
return srs_error_wrap(err, "reload vhost added");
|
||||
}
|
||||
|
||||
return ret;
|
||||
return err;
|
||||
}
|
||||
|
||||
int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
|
||||
srs_error_t SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if (tflvs.find(vhost) == tflvs.end()) {
|
||||
if ((ret = initialize_flv_entry(vhost)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
return srs_error_new(ret, "init flv entry");
|
||||
}
|
||||
|
||||
// http mount need SrsRequest and SrsSource param, only create a mapping template entry
|
||||
// and do mount automatically on playing http flv if this stream is a new http_remux stream.
|
||||
return ret;
|
||||
return err;
|
||||
}
|
||||
|
||||
SrsLiveEntry* tmpl = tflvs[vhost];
|
||||
|
@ -848,7 +849,7 @@ int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
|
|||
}
|
||||
|
||||
if (!_srs_config->get_vhost_http_remux_enabled(vhost)) {
|
||||
return ret;
|
||||
return err;
|
||||
}
|
||||
|
||||
string old_tmpl_mount = tmpl->mount;
|
||||
|
@ -867,8 +868,7 @@ int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
|
|||
|
||||
// remount stream.
|
||||
if ((ret = http_mount(source, req)) != ERROR_SUCCESS) {
|
||||
srs_trace("vhost %s http_remux reload failed", vhost.c_str());
|
||||
return ret;
|
||||
return srs_error_new(ret, "vhost %s http_remux reload failed", vhost.c_str());
|
||||
}
|
||||
} else {
|
||||
// for without SrsRequest and SrsSource if stream is not played yet, do http mount automatically
|
||||
|
@ -877,7 +877,7 @@ int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
|
|||
|
||||
srs_trace("vhost %s http_remux reload success", vhost.c_str());
|
||||
|
||||
return ret;
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue