lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] f'up: Leaking tcp_ucbs in raw api


From: address@hidden
Subject: Re: [lwip-users] f'up: Leaking tcp_ucbs in raw api
Date: Mon, 4 Sep 2017 20:31:05 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Steinberg Michael wrote:
Hello,

Here's a bit more context to my problem. When I call tcp_close in reaction to being handed a NULL 
pbuf ptr in the receive-callback, this is what happens inside file  "tcp.c": Eventually 
tcp_close_shutdown is called with the tcp_pcb in state CLOSE_WAIT. The "Not all data received 
by application ... " branch is taken and then on line 279 the pcb is removed from the active 
pcb list. At this point ALL lists (eg. tcp_bound_pcbs, tcp_listen_pcbs, tcp_active_pcbs, 
tcp_tw_pcbs) are empty. Then since I called tcp_close from within the recv handler, the branch on 
ln. 288 is taken, which merely sets a flag so the pcb is deleted later-on. But since the pcb is in 
no list of lwip anymore that I'm aware of, how would that deferred delete even work?

Maybe you can spot my misconception better with these details?

Sorry it took so long to read this. Seems you're right: the check for "recv_flags & TF_CLOSED" must be moved down in tcp_input() so that delayed close works from the TCP_EVENT_CLOSED() callback, too. I'll file a bug.


Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]