From b3607a6d7d14b23369275188eebd93e8949b1a4c Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Fri, 15 May 2026 21:40:30 +0800 Subject: [PATCH] fix: on_pkt_sent lacks xmit information --- ikcp.c | 3 ++- ikcp.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ikcp.c b/ikcp.c index c18b688..6e625b6 100644 --- a/ikcp.c +++ b/ikcp.c @@ -1086,7 +1086,8 @@ void ikcp_flush(ikcpcb *kcp) newseg->xmit = 0; if (kcp->ccops && kcp->ccops->on_pkt_sent) { - kcp->ccops->on_pkt_sent(kcp, newseg->sn, current, newseg->len, kcp->nsnd_buf - 1); + kcp->ccops->on_pkt_sent(kcp, newseg->sn, current, + newseg->len, kcp->nsnd_buf - 1, 0); } } diff --git a/ikcp.h b/ikcp.h index 6cf5a5f..9d90b8b 100644 --- a/ikcp.h +++ b/ikcp.h @@ -306,7 +306,7 @@ struct IKCPOPS void (*on_app_limited)(ikcpcb *kcp, IUINT32 inflight); void (*on_rtt)(ikcpcb *kcp, IINT32 rtt); void (*on_pkt_sent)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts, - IUINT32 len, IUINT32 inflight); + IUINT32 len, IUINT32 inflight, IUINT32 xmit); void (*on_pkt_acked)(ikcpcb *kcp, IUINT32 sn, IUINT32 ts, IUINT32 len, IINT32 rtt, IUINT32 xmit); IUINT32 (*get_info)(ikcpcb *kcp, void *buf, IUINT32 bufsize);