Apply target_cwnd during slow-start only
@@ -95,12 +95,11 @@ void ngtcp2_cc_reno_cc_on_pkt_acked(ngtcp2_cc *ccx, ngtcp2_conn_stat *cstat,
return;
}
- /* If sending rate is too small, it interferes cwnd growth badly. */
- if (cc->target_cwnd > 256 * 1024 && cstat->cwnd >= cc->target_cwnd) {
+ if (cstat->cwnd < cstat->ssthresh) {
+ if (cc->target_cwnd && cstat->cwnd >= cc->target_cwnd) {
return;
}
- if (cstat->cwnd < cstat->ssthresh) {
cstat->cwnd += pkt->pktlen;
ngtcp2_log_info(cc->ccb.log, NGTCP2_LOG_EVENT_RCV,
"pkn=%" PRId64 " acked, slow start cwnd=%" PRIu64,
@@ -238,12 +237,11 @@ void ngtcp2_cc_cubic_cc_on_pkt_acked(ngtcp2_cc *ccx, ngtcp2_conn_stat *cstat,
return;
}
- /* If sending rate is too small, it interferes cwnd growth badly. */
- if (cc->target_cwnd > 256 * 1024 && cstat->cwnd >= cc->target_cwnd) {
+ if (cstat->cwnd < cstat->ssthresh) {
+ if (cc->target_cwnd && cstat->cwnd >= cc->target_cwnd) {
return;
}
- if (cstat->cwnd < cstat->ssthresh) {
/* slow-start */
cstat->cwnd += pkt->pktlen;
ngtcp2_log_info(cc->ccb.log, NGTCP2_LOG_EVENT_RCV,
