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

for #405, improve the http flv to 3k. 2.0.170

This commit is contained in:
winlin 2015-05-24 23:29:17 +08:00
parent 8a9dbaefb7
commit 4df19ba99a
4 changed files with 14 additions and 3 deletions

View file

@ -66,11 +66,14 @@ SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
content_length = -1;
written = 0;
header_sent = false;
nb_iovss_cache = 0;
iovss_cache = NULL;
}
SrsHttpResponseWriter::~SrsHttpResponseWriter()
{
srs_freep(hdr);
srs_freep(iovss_cache);
}
int SrsHttpResponseWriter::final_request()
@ -173,8 +176,12 @@ int SrsHttpResponseWriter::writev(iovec* iov, int iovcnt, ssize_t* pnwrite)
// send in chunked encoding.
int nb_iovss = iovcnt * 4;
iovec* iovss = new iovec[nb_iovss];
SrsAutoFree(iovec, iovss);
iovec* iovss = iovss_cache;
if (nb_iovss_cache < nb_iovss) {
srs_freep(iovss_cache);
nb_iovss_cache = nb_iovss;
iovss = iovss_cache = new iovec[nb_iovss];
}
char* pheader_cache = header_cache;
for (int i = 0; i < iovcnt; i++) {