* Fix all uses of pbuf_header to check the return value. In some

cases just assert if it fails as I'm not sure how to fix them, but
    this is no worse than before when they would carry on regardless
    of the failure.
This commit is contained in:
kieranm
2007-03-21 12:55:00 +00:00
parent b422864d5d
commit 7294cb080b
12 changed files with 106 additions and 34 deletions

View File

@@ -312,7 +312,12 @@ tcp_enqueue(struct tcp_pcb *pcb, void *arg, u16_t len,
/* fit within max seg size */
useg->len + queue->len <= pcb->mss) {
/* Remove TCP header from first segment of our to-be-queued list */
pbuf_header(queue->p, -TCP_HLEN);
if(pbuf_header(queue->p, -TCP_HLEN)) {
/* Can we cope with this failing? Just assert for now */
LWIP_ASSERT("pbuf_header failed\n", 0);
TCP_STATS_INC(tcp.err);
goto memerr;
}
pbuf_cat(useg->p, queue->p);
useg->len += queue->len;
useg->next = queue->next;