mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-12-10 08:46:40 +08:00
Simplify
This commit is contained in:
parent
2e6d032691
commit
18417fe7e6
@ -768,12 +768,10 @@ tcp_segs_free(struct tcp_seg *seg)
|
|||||||
{
|
{
|
||||||
u8_t count = 0;
|
u8_t count = 0;
|
||||||
struct tcp_seg *next;
|
struct tcp_seg *next;
|
||||||
again:
|
while (seg != NULL) {
|
||||||
if (seg != NULL) {
|
|
||||||
next = seg->next;
|
next = seg->next;
|
||||||
count += tcp_seg_free(seg);
|
count += tcp_seg_free(seg);
|
||||||
seg = next;
|
seg = next;
|
||||||
goto again;
|
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@ -791,15 +789,13 @@ tcp_seg_free(struct tcp_seg *seg)
|
|||||||
u8_t count = 0;
|
u8_t count = 0;
|
||||||
|
|
||||||
if (seg != NULL) {
|
if (seg != NULL) {
|
||||||
if (seg->p == NULL) {
|
if (seg->p != NULL) {
|
||||||
memp_free(MEMP_TCP_SEG, seg);
|
|
||||||
} else {
|
|
||||||
count = pbuf_free(seg->p);
|
count = pbuf_free(seg->p);
|
||||||
#if TCP_DEBUG
|
#if TCP_DEBUG
|
||||||
seg->p = NULL;
|
seg->p = NULL;
|
||||||
#endif /* TCP_DEBUG */
|
#endif /* TCP_DEBUG */
|
||||||
memp_free(MEMP_TCP_SEG, seg);
|
|
||||||
}
|
}
|
||||||
|
memp_free(MEMP_TCP_SEG, seg);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user