Closed
Description
when merging the code of fix#464 on SRS3.0, origin_cluster with multiple coworkers doesn't work.
when multiple coworkers, in the loop it tries the first coworker and if not active origin, it breaks.
if (!info->edge && _srs_config->get_vhost_origin_cluster(req->vhost) && source->inactive()) {
vector<string> coworkers = _srs_config->get_vhost_coworkers(req->vhost);
for (int i = 0; i < (int)coworkers.size(); i++) {
int port;
string host;
string url = "http://" + coworkers.at(i) + "/api/v1/clusters?"
+ "vhost=" + req->vhost + "&ip=" + req->host + "&app=" + req->app + "&stream=" + req->stream;
if ((err = SrsHttpHooks::discover_co_workers(url, host, port)) != srs_success) {
return srs_error_wrap(err, "discover coworkers, url=%s", url.c_str());
}
// when the coworker didn't work, it returns, never try other coworkers.
// should be continue??