Skip to content

Commit

Permalink
for #405, improve the http flv to 3k. 2.0.170
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed May 24, 2015
1 parent 8a9dbae commit 4df19ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.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.170 | 3.0k(3000) | players | 89% | 96MB | [code][p19] |

### Latency benchmark

Expand Down
11 changes: 9 additions & 2 deletions trunk/src/app/srs_app_http_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 ) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/src/app/srs_app_http_conn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 85,10 @@ class SrsHttpResponseWriter : public ISrsHttpResponseWriter
private:
SrsStSocket* skt;
SrsHttpHeader* hdr;
private:
char header_cache[SRS_HTTP_HEADER_CACHE_SIZE];
iovec* iovss_cache;
int nb_iovss_cache;
private:
// reply header has been (logically) written
bool header_wrote;
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 169
#define VERSION_REVISION 170

// server info.
#define RTMP_SIG_SRS_KEY "SRS"
Expand Down

0 comments on commit 4df19ba

Please sign in to comment.