winlin

refine reload, rename some vhost specified to add vhost prefix

... ... @@ -793,7 +793,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
if (!srs_directive_equals(new_vhost->get("atc"), old_vhost->get("atc"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_atc(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_atc(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes atc failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ... @@ -804,7 +804,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
if (!srs_directive_equals(new_vhost->get("gop_cache"), old_vhost->get("gop_cache"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_gop_cache(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_gop_cache(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes gop_cache failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ... @@ -815,7 +815,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
if (!srs_directive_equals(new_vhost->get("queue_length"), old_vhost->get("queue_length"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_queue_length(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_queue_length(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes queue_length failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ... @@ -826,7 +826,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
if (!srs_directive_equals(new_vhost->get("forward"), old_vhost->get("forward"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_forward(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_forward(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes forward failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ... @@ -837,7 +837,7 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
if (!srs_directive_equals(new_vhost->get("hls"), old_vhost->get("hls"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_hls(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_hls(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes hls failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ... @@ -945,7 +945,7 @@ int SrsConfig::reload_transcode(SrsConfDirective* new_vhost, SrsConfDirective* o
if (changed) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_transcode(vhost)) != ERROR_SUCCESS) {
if ((ret = subscribe->on_reload_vhost_transcode(vhost)) != ERROR_SUCCESS) {
srs_error("vhost %s notify subscribes transcode failed. ret=%d", vhost.c_str(), ret);
return ret;
}
... ...
... ... @@ -105,32 +105,32 @@ int ISrsReloadHandler::on_reload_vhost_removed(string /*vhost*/)
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_atc(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_atc(string /*vhost*/)
{
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_gop_cache(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_gop_cache(string /*vhost*/)
{
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_queue_length(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_queue_length(string /*vhost*/)
{
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_forward(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_forward(string /*vhost*/)
{
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_hls(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_hls(string /*vhost*/)
{
return ERROR_SUCCESS;
}
int ISrsReloadHandler::on_reload_transcode(string /*vhost*/)
int ISrsReloadHandler::on_reload_vhost_transcode(string /*vhost*/)
{
return ERROR_SUCCESS;
}
... ...
... ... @@ -55,12 +55,12 @@ public:
virtual int on_reload_vhost_http_updated();
virtual int on_reload_vhost_added(std::string vhost);
virtual int on_reload_vhost_removed(std::string vhost);
virtual int on_reload_atc(std::string vhost);
virtual int on_reload_gop_cache(std::string vhost);
virtual int on_reload_queue_length(std::string vhost);
virtual int on_reload_forward(std::string vhost);
virtual int on_reload_hls(std::string vhost);
virtual int on_reload_transcode(std::string vhost);
virtual int on_reload_vhost_atc(std::string vhost);
virtual int on_reload_vhost_gop_cache(std::string vhost);
virtual int on_reload_vhost_queue_length(std::string vhost);
virtual int on_reload_vhost_forward(std::string vhost);
virtual int on_reload_vhost_hls(std::string vhost);
virtual int on_reload_vhost_transcode(std::string vhost);
virtual int on_reload_ingest_removed(std::string vhost, std::string ingest_id);
virtual int on_reload_ingest_added(std::string vhost, std::string ingest_id);
virtual int on_reload_ingest_updated(std::string vhost, std::string ingest_id);
... ...
... ... @@ -484,7 +484,7 @@ SrsSource::~SrsSource()
srs_freep(req);
}
int SrsSource::on_reload_atc(string vhost)
int SrsSource::on_reload_vhost_atc(string vhost)
{
int ret = ERROR_SUCCESS;
... ... @@ -503,7 +503,7 @@ int SrsSource::on_reload_atc(string vhost)
return ret;
}
int SrsSource::on_reload_gop_cache(string vhost)
int SrsSource::on_reload_vhost_gop_cache(string vhost)
{
int ret = ERROR_SUCCESS;
... ... @@ -522,7 +522,7 @@ int SrsSource::on_reload_gop_cache(string vhost)
return ret;
}
int SrsSource::on_reload_queue_length(string vhost)
int SrsSource::on_reload_vhost_queue_length(string vhost)
{
int ret = ERROR_SUCCESS;
... ... @@ -557,7 +557,7 @@ int SrsSource::on_reload_queue_length(string vhost)
return ret;
}
int SrsSource::on_reload_forward(string vhost)
int SrsSource::on_reload_vhost_forward(string vhost)
{
int ret = ERROR_SUCCESS;
... ... @@ -577,7 +577,7 @@ int SrsSource::on_reload_forward(string vhost)
return ret;
}
int SrsSource::on_reload_hls(string vhost)
int SrsSource::on_reload_vhost_hls(string vhost)
{
int ret = ERROR_SUCCESS;
... ... @@ -597,7 +597,7 @@ int SrsSource::on_reload_hls(string vhost)
return ret;
}
int SrsSource::on_reload_transcode(string vhost)
int SrsSource::on_reload_vhost_transcode(string vhost)
{
int ret = ERROR_SUCCESS;
... ...
... ... @@ -266,12 +266,12 @@ public:
virtual ~SrsSource();
// interface ISrsReloadHandler
public:
virtual int on_reload_atc(std::string vhost);
virtual int on_reload_gop_cache(std::string vhost);
virtual int on_reload_queue_length(std::string vhost);
virtual int on_reload_forward(std::string vhost);
virtual int on_reload_hls(std::string vhost);
virtual int on_reload_transcode(std::string vhost);
virtual int on_reload_vhost_atc(std::string vhost);
virtual int on_reload_vhost_gop_cache(std::string vhost);
virtual int on_reload_vhost_queue_length(std::string vhost);
virtual int on_reload_vhost_forward(std::string vhost);
virtual int on_reload_vhost_hls(std::string vhost);
virtual int on_reload_vhost_transcode(std::string vhost);
public:
// for the SrsForwarder to callback to request the sequence headers.
virtual int on_forwarder_start(SrsForwarder* forwarder);
... ...