1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #79, fix the reload remove edge assert bug. 0.9.189.

This commit is contained in:
winlin 2014-08-03 21:50:48 +08:00
parent ade2376da0
commit 67403bdbf1
4 changed files with 12 additions and 2 deletions

View file

@ -279,7 +279,15 @@ int SrsEdgeIngester::connect_server()
close_underlayer_socket();
SrsConfDirective* conf = _srs_config->get_vhost_edge_origin(_req->vhost);
srs_assert(conf);
// @see https://github.com/winlinvip/simple-rtmp-server/issues/79
// when origin is error, for instance, server is shutdown,
// then user remove the vhost then reload, the conf is empty.
if (!conf) {
ret = ERROR_EDGE_VHOST_REMOVED;
srs_warn("vhost %s removed. ret=%d", _req->vhost.c_str(), ret);
return ret;
}
// select the origin.
std::string server = conf->args.at(origin_index % conf->args.size());