mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
Refine the RTMP iovs cache increasing to much faster.
This commit is contained in:
parent
49c737f996
commit
fc9855bc7a
2 changed files with 5 additions and 4 deletions
|
@ -145,6 +145,7 @@ For previous versions, please read:
|
|||
|
||||
## V3 changes
|
||||
|
||||
* v3.0, 2019-12-19, Refine the RTMP iovs cache increasing to much faster.
|
||||
* v3.0, 2019-12-19, Fix [#1524][bug #1524], memory leak for amf0 strict array. 3.0.75
|
||||
* v3.0, 2019-12-19, Fix random build failed bug for modules.
|
||||
* v3.0, 2019-12-19, Fix [#1520][bug #1520] and [#1223][bug #1223], bug for origin cluster 3+ servers. 3.0.74
|
||||
|
|
|
@ -231,7 +231,7 @@ SrsProtocol::SrsProtocol(ISrsProtocolReadWriter* io)
|
|||
in_chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
||||
out_chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
||||
|
||||
nb_out_iovs = SRS_CONSTS_IOVS_MAX;
|
||||
nb_out_iovs = 8 * SRS_CONSTS_IOVS_MAX;
|
||||
out_iovs = (iovec*)malloc(sizeof(iovec) * nb_out_iovs);
|
||||
// each chunk consumers atleast 2 iovs
|
||||
srs_assert(nb_out_iovs >= 2);
|
||||
|
@ -486,11 +486,11 @@ srs_error_t SrsProtocol::do_send_messages(SrsSharedPtrMessage** msgs, int nb_msg
|
|||
// for we donot know how many messges maybe to send entirely,
|
||||
// we just alloc the iovs, it's ok.
|
||||
if (iov_index >= nb_out_iovs - 2) {
|
||||
srs_warn("resize iovs %d => %d, max_msgs=%d", nb_out_iovs, nb_out_iovs + SRS_CONSTS_IOVS_MAX, SRS_PERF_MW_MSGS);
|
||||
|
||||
nb_out_iovs += SRS_CONSTS_IOVS_MAX;
|
||||
int ov = nb_out_iovs;
|
||||
nb_out_iovs = 2 * nb_out_iovs;
|
||||
int realloc_size = sizeof(iovec) * nb_out_iovs;
|
||||
out_iovs = (iovec*)realloc(out_iovs, realloc_size);
|
||||
srs_warn("resize iovs %d => %d, max_msgs=%d", ov, nb_out_iovs, SRS_PERF_MW_MSGS);
|
||||
}
|
||||
|
||||
// to next pair of iovs
|
||||
|
|
Loading…
Reference in a new issue