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;
|
||||
struct tcp_seg *next;
|
||||
again:
|
||||
if (seg != NULL) {
|
||||
while (seg != NULL) {
|
||||
next = seg->next;
|
||||
count += tcp_seg_free(seg);
|
||||
seg = next;
|
||||
goto again;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@ -791,15 +789,13 @@ tcp_seg_free(struct tcp_seg *seg)
|
||||
u8_t count = 0;
|
||||
|
||||
if (seg != NULL) {
|
||||
if (seg->p == NULL) {
|
||||
memp_free(MEMP_TCP_SEG, seg);
|
||||
} else {
|
||||
if (seg->p != NULL) {
|
||||
count = pbuf_free(seg->p);
|
||||
#if TCP_DEBUG
|
||||
seg->p = NULL;
|
||||
#endif /* TCP_DEBUG */
|
||||
memp_free(MEMP_TCP_SEG, seg);
|
||||
}
|
||||
memp_free(MEMP_TCP_SEG, seg);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user