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

For #1657, refine api for http

This commit is contained in:
winlin 2020-11-06 09:51:04 +08:00
parent 5782b45978
commit 7916214e27
7 changed files with 45 additions and 47 deletions

View file

@ -146,7 +146,8 @@ SrsDynamicHttpConn::SrsDynamicHttpConn(ISrsResourceManager* cm, srs_netfd_t fd,
manager = cm;
sdk = NULL;
pprint = SrsPithyPrint::create_caster();
conn = new SrsHttpConn(this, fd, m, cip, cport);
skt = new SrsTcpConnection(fd);
conn = new SrsHttpConn(this, skt, m, cip, cport);
ip = cip;
port = cport;
@ -158,6 +159,7 @@ SrsDynamicHttpConn::~SrsDynamicHttpConn()
_srs_config->unsubscribe(this);
srs_freep(conn);
srs_freep(skt);
srs_freep(sdk);
srs_freep(pprint);
}
@ -307,6 +309,10 @@ srs_error_t SrsDynamicHttpConn::start()
return srs_error_wrap(err, "set cors=%d", v);
}
if ((err = skt->initialize()) != srs_success) {
return srs_error_wrap(err, "init socket");
}
return conn->start();
}