mirror of
https://github.com/ossrs/srs.git
synced 2025-02-14 20:31:56 +00:00
fix the http flv mount bug.
This commit is contained in:
parent
9743e02541
commit
d995726fee
1 changed files with 10 additions and 3 deletions
|
@ -805,7 +805,14 @@ int SrsHttpStreamServer::http_mount(SrsSource* s, SrsRequest* r)
|
|||
entry->cache = new SrsStreamCache(s, r);
|
||||
entry->stream = new SrsLiveStream(s, r, entry->cache);
|
||||
|
||||
srs_assert(!tmpl->req);
|
||||
// TODO: FIXME: maybe refine the logic of http remux service.
|
||||
// if user push streams followed:
|
||||
// rtmp://test.com/live/stream1
|
||||
// rtmp://test.com/live/stream2
|
||||
// and they will using the same template, such as: [vhost]/[app]/[stream].flv
|
||||
// so, need to free last request object, otherwise, it will cause memory leak.
|
||||
srs_freep(tmpl->req);
|
||||
|
||||
tmpl->source = s;
|
||||
tmpl->req = r->copy();
|
||||
|
||||
|
@ -1170,8 +1177,8 @@ int SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
|
|||
std::string sid = r->get_stream_url();
|
||||
// check if the stream is enabled.
|
||||
if (sflvs.find(sid) != sflvs.end()) {
|
||||
SrsLiveEntry* entry = sflvs[sid];
|
||||
if (!entry->stream->entry->enabled) {
|
||||
SrsLiveEntry* s_entry = sflvs[sid];
|
||||
if (!s_entry->stream->entry->enabled) {
|
||||
srs_error("stream is disabled, hijack failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue