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

For #906, #902, use connection manager to remove connection

This commit is contained in:
winlin 2017-05-29 18:34:41 +08:00
parent 44f542f77f
commit 3ffb0980f5
6 changed files with 108 additions and 9 deletions

View file

@ -51,10 +51,13 @@ SrsAppCasterFlv::SrsAppCasterFlv(SrsConfDirective* c)
{
http_mux = new SrsHttpServeMux();
output = _srs_config->get_stream_caster_output(c);
manager = new SrsCoroutineManager();
}
SrsAppCasterFlv::~SrsAppCasterFlv()
{
srs_freep(http_mux);
srs_freep(manager);
}
int SrsAppCasterFlv::initialize()
@ -65,6 +68,10 @@ int SrsAppCasterFlv::initialize()
return ret;
}
if ((ret = manager->start()) != ERROR_SUCCESS) {
return ret;
}
return ret;
}
@ -95,7 +102,7 @@ void SrsAppCasterFlv::remove(ISrsConnection* c)
// fixbug: SrsHttpConn for CasterFlv is not freed, which could cause memory leak
// so, free conn which is not managed by SrsServer->conns;
// @see: https://github.com/ossrs/srs/issues/826
srs_freep(c);
manager->remove(c);
}
int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)