|
From: | David Haas |
Subject: | Re: [lwip-users] udp |
Date: | Sun, 16 Mar 2003 09:59:48 -0500 |
User-agent: | Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4a) Gecko/20030315 |
Hi Leon,The problem is that the pbuf which the reference count is incremented in is a ROM type pbuf. The actual data buffer was passed in using the sendto() function call and freeing the pbuf which is pointing to it will not free the original data buffer. So although the ARP queue does increment the reference count and does properly free the pbuf afterwards, this particular pbuf is of type ROM and actually only points to the data buffer. Nothing is done to free the original data buffer and no signal is received by the application to know when it can free the data buffer.
I cannot beleive that anyone is using UDP with the sockets interface and not running into this problem (unless I really missed something here).
David. Leon Woestenberg wrote:
Hello David,default to this kind of operation. After all, how do you know when you can free the application buffer? Especially if your packet winds up on the ARP queue.The ARP queue will increase the pbuf reference counter for you, and decrease it once the packet is sent. (thereby effectively free'ing it if it reaches 0). So, you can safely free the pbuf after sending it. Regards, Leon. _______________________________________________ lwip-users mailing list address@hidden http://mail.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |