mirror of
https://github.com/skywind3000/kcp.git
synced 2025-03-14 09:00:06 +08:00
Cleanup
This commit is contained in:
parent
d6829263fe
commit
c5a17fb8b5
13
ikcp.c
13
ikcp.c
@ -35,8 +35,8 @@ const IUINT32 IKCP_ASK_TELL = 2; // need to send IKCP_CMD_WINS
|
||||
const IUINT32 IKCP_WND_SND = 32;
|
||||
const IUINT32 IKCP_WND_RCV = 128; // must >= max fragment size
|
||||
const IUINT32 IKCP_MTU_DEF = 1400;
|
||||
const IUINT32 IKCP_ACK_FAST = 3;
|
||||
const IUINT32 IKCP_INTERVAL = 100;
|
||||
const IUINT32 IKCP_ACK_FAST = 3;
|
||||
const IUINT32 IKCP_INTERVAL = 100;
|
||||
const IUINT32 IKCP_OVERHEAD = 24;
|
||||
const IUINT32 IKCP_DEADLINK = 20;
|
||||
const IUINT32 IKCP_THRESH_INIT = 2;
|
||||
@ -296,7 +296,7 @@ ikcpcb* ikcp_create(IUINT32 conv, void *user)
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// release a new kcpcb
|
||||
// release a kcpcb
|
||||
//---------------------------------------------------------------------
|
||||
void ikcp_release(ikcpcb *kcp)
|
||||
{
|
||||
@ -718,7 +718,7 @@ void ikcp_parse_data(ikcpcb *kcp, IKCPSEG *newseg)
|
||||
#endif
|
||||
|
||||
// move available data from rcv_buf -> rcv_queue
|
||||
while (! iqueue_is_empty(&kcp->rcv_buf)) {
|
||||
while (!iqueue_is_empty(&kcp->rcv_buf)) {
|
||||
IKCPSEG *seg = iqueue_entry(kcp->rcv_buf.next, IKCPSEG, node);
|
||||
if (seg->sn == kcp->rcv_nxt && kcp->nrcv_que < kcp->rcv_wnd) {
|
||||
iqueue_del(&seg->node);
|
||||
@ -1175,7 +1175,7 @@ void ikcp_update(ikcpcb *kcp, IUINT32 current)
|
||||
// Determine when should you invoke ikcp_update:
|
||||
// returns when you should invoke ikcp_update in millisec, if there
|
||||
// is no ikcp_input/_send calling. you can call ikcp_update in that
|
||||
// time, instead of call update repeatly.
|
||||
// time, instead of call update repeatedly.
|
||||
// Important to reduce unnacessary ikcp_update invoking. use it to
|
||||
// schedule ikcp_update (eg. implementing an epoll-like mechanism,
|
||||
// or optimize ikcp_update when handling massive kcp connections)
|
||||
@ -1218,8 +1218,6 @@ IUINT32 ikcp_check(const ikcpcb *kcp, IUINT32 current)
|
||||
return current + minimal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ikcp_setmtu(ikcpcb *kcp, int mtu)
|
||||
{
|
||||
char *buffer;
|
||||
@ -1268,7 +1266,6 @@ int ikcp_nodelay(ikcpcb *kcp, int nodelay, int interval, int resend, int nc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ikcp_wndsize(ikcpcb *kcp, int sndwnd, int rcvwnd)
|
||||
{
|
||||
if (kcp) {
|
||||
|
Loading…
Reference in New Issue
Block a user