remove unnecessary xmit in the callback

This commit is contained in:
skywind3000
2026-05-15 22:50:50 +08:00
parent b3607a6d7d
commit b6953419c9
2 changed files with 4 additions and 3 deletions

5
ikcp.c
View File

@@ -1087,7 +1087,7 @@ void ikcp_flush(ikcpcb *kcp)
if (kcp->ccops && kcp->ccops->on_pkt_sent) { if (kcp->ccops && kcp->ccops->on_pkt_sent) {
kcp->ccops->on_pkt_sent(kcp, newseg->sn, current, kcp->ccops->on_pkt_sent(kcp, newseg->sn, current,
newseg->len, kcp->nsnd_buf - 1, 0); newseg->len, kcp->nsnd_buf - 1);
} }
} }
@@ -1178,7 +1178,8 @@ void ikcp_flush(ikcpcb *kcp)
// update ssthresh // update ssthresh
if (change) { if (change) {
if (kcp->ccops && kcp->ccops->on_fast_retransmit) { if (kcp->ccops && kcp->ccops->on_fast_retransmit) {
kcp->ccops->on_fast_retransmit(kcp, (IUINT32)change, kcp->nsnd_buf, prior_cwnd); kcp->ccops->on_fast_retransmit(kcp, (IUINT32)change,
kcp->nsnd_buf, prior_cwnd);
} }
else { else {
IUINT32 inflight = kcp->snd_nxt - kcp->snd_una; IUINT32 inflight = kcp->snd_nxt - kcp->snd_una;

2
ikcp.h
View File

@@ -306,7 +306,7 @@ struct IKCPOPS
void (*on_app_limited)(ikcpcb *kcp, IUINT32 inflight); void (*on_app_limited)(ikcpcb *kcp, IUINT32 inflight);
void (*on_rtt)(ikcpcb *kcp, IINT32 rtt); void (*on_rtt)(ikcpcb *kcp, IINT32 rtt);
void (*on_pkt_sent)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts, void (*on_pkt_sent)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts,
IUINT32 len, IUINT32 inflight, IUINT32 xmit); IUINT32 len, IUINT32 inflight);
void (*on_pkt_acked)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts, void (*on_pkt_acked)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts,
IUINT32 len, IINT32 rtt, IUINT32 xmit); IUINT32 len, IINT32 rtt, IUINT32 xmit);
IUINT32 (*get_info)(ikcpcb *kcp, void *buf, IUINT32 bufsize); IUINT32 (*get_info)(ikcpcb *kcp, void *buf, IUINT32 bufsize);