41 |
*/ |
*/ |
42 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
43 |
|
|
|
#include "lwip/debug.h" |
|
44 |
|
|
45 |
#include "lwip/def.h" |
#include "lwip/def.h" |
46 |
#include "lwip/opt.h" |
#include "lwip/opt.h" |
386 |
tcp_parseopt(npcb); |
tcp_parseopt(npcb); |
387 |
|
|
388 |
/* Build an MSS option. */ |
/* Build an MSS option. */ |
389 |
optdata = HTONL(((u32_t)2 << 24) | |
optdata = htonl(((u32_t)2 << 24) | |
390 |
((u32_t)4 << 16) | |
((u32_t)4 << 16) | |
391 |
(((u32_t)npcb->mss / 256) << 8) | |
(((u32_t)npcb->mss / 256) << 8) | |
392 |
(npcb->mss & 255)); |
(npcb->mss & 255)); |
724 |
tcp_seg_free(next); |
tcp_seg_free(next); |
725 |
|
|
726 |
DEBUGF(TCP_QLEN_DEBUG, ("%d (after freeing unacked)\n", pcb->snd_queuelen)); |
DEBUGF(TCP_QLEN_DEBUG, ("%d (after freeing unacked)\n", pcb->snd_queuelen)); |
|
#ifdef LWIP_DEBUG |
|
727 |
if(pcb->snd_queuelen != 0) { |
if(pcb->snd_queuelen != 0) { |
728 |
LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL || |
LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL || |
729 |
pcb->unsent != NULL); |
pcb->unsent != NULL); |
730 |
} |
} |
|
#endif /* LWIP_DEBUG */ |
|
731 |
} |
} |
732 |
pcb->polltmr = 0; |
pcb->polltmr = 0; |
733 |
} |
} |
753 |
pcb->snd_queuelen -= pbuf_clen(next->p); |
pcb->snd_queuelen -= pbuf_clen(next->p); |
754 |
tcp_seg_free(next); |
tcp_seg_free(next); |
755 |
DEBUGF(TCP_QLEN_DEBUG, ("%d (after freeing unsent)\n", pcb->snd_queuelen)); |
DEBUGF(TCP_QLEN_DEBUG, ("%d (after freeing unsent)\n", pcb->snd_queuelen)); |
|
#ifdef LWIP_DEBUG |
|
756 |
if(pcb->snd_queuelen != 0) { |
if(pcb->snd_queuelen != 0) { |
757 |
LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL || |
LWIP_ASSERT("tcp_receive: valid queue length", pcb->unacked != NULL || |
758 |
pcb->unsent != NULL); |
pcb->unsent != NULL); |
759 |
} |
} |
|
#endif /* LWIP_DEBUG */ |
|
760 |
|
|
761 |
if(pcb->unsent != NULL) { |
if(pcb->unsent != NULL) { |
762 |
pcb->snd_nxt = htonl(pcb->unsent->tcphdr->seqno); |
pcb->snd_nxt = htonl(pcb->unsent->tcphdr->seqno); |