Changeset 13646
- Timestamp:
- Dec 11, 2012, 4:08:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/third-party/libutp/utp.cpp
r13620 r13646 1488 1488 } 1489 1489 1490 enum { MAX_EACK = 128 }; 1491 1490 1492 void UTPSocket::selective_ack(uint base, const byte *mask, byte len) 1491 1493 { … … 1500 1502 // iterate in reverse over the acked packets, at the end, the top packets 1501 1503 // are the ones we want to resend 1502 int resends[ 32];1504 int resends[MAX_EACK]; 1503 1505 int nr = 0; 1504 1506 … … 1573 1575 count >= DUPLICATE_ACKS_BEFORE_RESEND && 1574 1576 duplicate_ack < DUPLICATE_ACKS_BEFORE_RESEND) { 1577 // resends is a stack, and we're mostly interested in the top of it 1578 // if we're full, just throw away the lower half 1579 if (nr >= MAX_EACK - 2) { 1580 memmove(resends, &resends[MAX_EACK/2], MAX_EACK/2 * sizeof(resends[0])); 1581 nr -= MAX_EACK / 2; 1582 } 1575 1583 resends[nr++] = v; 1576 1584 LOG_UTPV("0x%08x: no ack for %u", this, v); … … 1581 1589 } while (--bits >= -1); 1582 1590 1583 if (((base - 1 - fast_resend_seq_nr) & ACK_NR_MASK) < 256 && 1584 count >= DUPLICATE_ACKS_BEFORE_RESEND && 1585 duplicate_ack < DUPLICATE_ACKS_BEFORE_RESEND) { 1591 if (((base - 1 - fast_resend_seq_nr) & ACK_NR_MASK) <= OUTGOING_BUFFER_MAX_SIZE && 1592 count >= DUPLICATE_ACKS_BEFORE_RESEND) { 1586 1593 // if we get enough duplicate acks to start 1587 1594 // resending, the first packet we should resend 1588 1595 // is base-1 1589 resends[nr++] = base - 1;1596 resends[nr++] = (base - 1) & ACK_NR_MASK; 1590 1597 } else { 1591 1598 LOG_UTPV("0x%08x: not resending %u count:%d dup_ack:%u fast_resend_seq_nr:%u",
Note: See TracChangeset
for help on using the changeset viewer.