mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Streams API is not correct. (#800)
HTTP API for streams is not correct. When stream stopped, API does not remove it.
This commit is contained in:
parent
1b26536253
commit
a6eebacc99
1 changed files with 12 additions and 1 deletions
|
@ -358,8 +358,19 @@ void SrsStatistic::on_stream_close(SrsRequest* req)
|
|||
{
|
||||
SrsStatisticVhost* vhost = create_vhost(req);
|
||||
SrsStatisticStream* stream = create_stream(vhost, req);
|
||||
|
||||
stream->close();
|
||||
|
||||
//TODO Is this correct? Something is not released?
|
||||
std::map<int64_t, SrsStatisticStream*>::iterator it;
|
||||
if ((it=streams.find(stream->id)) != streams.end()) {
|
||||
streams.erase(it);
|
||||
}
|
||||
|
||||
std::map<std::string, SrsStatisticStream*>::iterator sit;
|
||||
if ((sit=rstreams.find(stream->url)) != rstreams.end()) {
|
||||
rstreams.erase(sit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int SrsStatistic::on_client(int id, SrsRequest* req, SrsConnection* conn, SrsRtmpConnType type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue