Changed tcp_pcb->snd_queuelen from u8_t to u16_t to prevent overflowing when sending many small packets with big send buffer, added assertions and oveflow checks for snd_queuelen.

This commit is contained in:
goldsimon
2007-07-01 15:56:04 +00:00
parent d7c50f56d7
commit 9abbb581c5
3 changed files with 12 additions and 9 deletions

View File

@@ -118,8 +118,8 @@ void tcp_rexmit_rto (struct tcp_pcb *pcb);
* unacknowledged.
*/
#define tcp_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
((tpcb)->flags & TF_NODELAY) || \
(((tpcb)->unsent != NULL) && ((tpcb)->unsent->next != NULL))) ? \
((tpcb)->flags & TF_NODELAY) || \
(((tpcb)->unsent != NULL) && ((tpcb)->unsent->next != NULL))) ? \
tcp_output(tpcb) : ERR_OK)
@@ -302,7 +302,8 @@ struct tcp_pcb {
u16_t acked;
u16_t snd_buf; /* Available buffer space for sending (in bytes). */
u8_t snd_queuelen; /* Available buffer space for sending (in tcp_segs). */
#define TCP_SNDQUEUELEN_OVERFLOW (0xffff-3)
u16_t snd_queuelen; /* Available buffer space for sending (in tcp_segs). */
/* These are ordered by sequence number: */