1
0
Fork 0
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:
Chengdong Zhang 2017-03-11 16:21:33 +08:00 committed by winlin
parent 1b26536253
commit a6eebacc99

View file

@ -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)