mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 19:31:53 +00:00
for #405, improve the http flv to 3k. 2.0.170
This commit is contained in:
parent
8a9dbaefb7
commit
4df19ba99a
4 changed files with 14 additions and 3 deletions
|
@ -718,6 +718,7 @@ The play HTTP FLV benchmark by [SB](https://github.com/simple-rtmp-server/srs-be
|
||||||
| 2014-05-24 | 2.0.167 | 1.0k(1000) | players | 82% | 86MB | - |
|
| 2014-05-24 | 2.0.167 | 1.0k(1000) | players | 82% | 86MB | - |
|
||||||
| 2014-05-24 | 2.0.168 | 2.3k(2300) | players | 92% | 276MB | [code][p17] |
|
| 2014-05-24 | 2.0.168 | 2.3k(2300) | players | 92% | 276MB | [code][p17] |
|
||||||
| 2014-05-24 | 2.0.169 | 3.0k(3000) | players | 94% | 188MB | [code][p18] |
|
| 2014-05-24 | 2.0.169 | 3.0k(3000) | players | 94% | 188MB | [code][p18] |
|
||||||
|
| 2014-05-24 | 2.0.170 | 3.0k(3000) | players | 89% | 96MB | [code][p19] |
|
||||||
|
|
||||||
### Latency benchmark
|
### Latency benchmark
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,14 @@ SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
|
||||||
content_length = -1;
|
content_length = -1;
|
||||||
written = 0;
|
written = 0;
|
||||||
header_sent = false;
|
header_sent = false;
|
||||||
|
nb_iovss_cache = 0;
|
||||||
|
iovss_cache = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsHttpResponseWriter::~SrsHttpResponseWriter()
|
SrsHttpResponseWriter::~SrsHttpResponseWriter()
|
||||||
{
|
{
|
||||||
srs_freep(hdr);
|
srs_freep(hdr);
|
||||||
|
srs_freep(iovss_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsHttpResponseWriter::final_request()
|
int SrsHttpResponseWriter::final_request()
|
||||||
|
@ -173,8 +176,12 @@ int SrsHttpResponseWriter::writev(iovec* iov, int iovcnt, ssize_t* pnwrite)
|
||||||
|
|
||||||
// send in chunked encoding.
|
// send in chunked encoding.
|
||||||
int nb_iovss = iovcnt * 4;
|
int nb_iovss = iovcnt * 4;
|
||||||
iovec* iovss = new iovec[nb_iovss];
|
iovec* iovss = iovss_cache;
|
||||||
SrsAutoFree(iovec, iovss);
|
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;
|
char* pheader_cache = header_cache;
|
||||||
for (int i = 0; i < iovcnt; i++) {
|
for (int i = 0; i < iovcnt; i++) {
|
||||||
|
|
|
@ -85,7 +85,10 @@ class SrsHttpResponseWriter : public ISrsHttpResponseWriter
|
||||||
private:
|
private:
|
||||||
SrsStSocket* skt;
|
SrsStSocket* skt;
|
||||||
SrsHttpHeader* hdr;
|
SrsHttpHeader* hdr;
|
||||||
|
private:
|
||||||
char header_cache[SRS_HTTP_HEADER_CACHE_SIZE];
|
char header_cache[SRS_HTTP_HEADER_CACHE_SIZE];
|
||||||
|
iovec* iovss_cache;
|
||||||
|
int nb_iovss_cache;
|
||||||
private:
|
private:
|
||||||
// reply header has been (logically) written
|
// reply header has been (logically) written
|
||||||
bool header_wrote;
|
bool header_wrote;
|
||||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// current release version
|
// current release version
|
||||||
#define VERSION_MAJOR 2
|
#define VERSION_MAJOR 2
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 169
|
#define VERSION_REVISION 170
|
||||||
|
|
||||||
// server info.
|
// server info.
|
||||||
#define RTMP_SIG_SRS_KEY "SRS"
|
#define RTMP_SIG_SRS_KEY "SRS"
|
||||||
|
|
Loading…
Reference in a new issue