mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor: Use compositor for ISrsKbpsDelta. v5.0.51
This commit is contained in:
parent
29ae29c693
commit
1630918b0f
24 changed files with 225 additions and 213 deletions
|
@ -68,9 +68,9 @@ srs_error_t SrsAppCasterFlv::on_tcp_client(srs_netfd_t stfd)
|
|||
srs_warn("empty ip for fd=%d", srs_netfd_fileno(stfd));
|
||||
}
|
||||
|
||||
ISrsStartableConneciton* conn = new SrsDynamicHttpConn(this, stfd, http_mux, ip, port);
|
||||
SrsDynamicHttpConn* conn = new SrsDynamicHttpConn(this, stfd, http_mux, ip, port);
|
||||
conns.push_back(conn);
|
||||
|
||||
|
||||
if ((err = conn->start()) != srs_success) {
|
||||
return srs_error_wrap(err, "start tcp listener");
|
||||
}
|
||||
|
@ -80,14 +80,14 @@ srs_error_t SrsAppCasterFlv::on_tcp_client(srs_netfd_t stfd)
|
|||
|
||||
void SrsAppCasterFlv::remove(ISrsResource* c)
|
||||
{
|
||||
ISrsStartableConneciton* conn = dynamic_cast<ISrsStartableConneciton*>(c);
|
||||
ISrsConnection* conn = dynamic_cast<ISrsConnection*>(c);
|
||||
|
||||
std::vector<ISrsStartableConneciton*>::iterator it;
|
||||
std::vector<ISrsConnection*>::iterator it;
|
||||
if ((it = std::find(conns.begin(), conns.end(), conn)) != conns.end()) {
|
||||
conns.erase(it);
|
||||
}
|
||||
|
||||
// fixbug: ISrsStartableConneciton for CasterFlv is not freed, which could cause memory leak
|
||||
// fixbug: ISrsConnection 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
|
||||
manager->remove(c);
|
||||
|
@ -297,11 +297,6 @@ srs_error_t SrsDynamicHttpConn::start()
|
|||
return conn->start();
|
||||
}
|
||||
|
||||
void SrsDynamicHttpConn::remark(int64_t* in, int64_t* out)
|
||||
{
|
||||
conn->remark(in, out);
|
||||
}
|
||||
|
||||
SrsHttpFileReader::SrsHttpFileReader(ISrsHttpResponseReader* h)
|
||||
{
|
||||
http = h;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue