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

fix #324, support hstrs(http stream trigger rtmp source) edge mode. 2.0.140.

This commit is contained in:
winlin 2015-03-14 20:07:56 +08:00
parent 27cb62b7aa
commit 320f45c6f4
3 changed files with 15 additions and 2 deletions

View file

@ -1180,7 +1180,19 @@ int SrsHttpServer::hijack(SrsHttpMessage* request, ISrsHttpHandler** ph)
if (sflvs.find(sid) != sflvs.end()) {
entry = sflvs[sid];
*ph = entry->stream;
srs_trace("hstrs sid=%s", sid.c_str());
}
}
// trigger edge to fetch from origin.
bool vhost_is_edge = _srs_config->get_vhost_is_edge(r->vhost);
srs_trace("hstrs: source url=%s, is_edge=%d, source_id=%d[%d]",
r->get_stream_url().c_str(), vhost_is_edge, s->source_id(), s->source_id());
if (vhost_is_edge) {
// notice edge to start for the first client.
if ((ret = s->on_edge_start_play()) != ERROR_SUCCESS) {
srs_error("notice edge start play stream failed. ret=%d", ret);
return ret;
}
}