lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] crash on a lot of outgoing packets


From: Christiaan Simons
Subject: Re: [lwip-users] crash on a lot of outgoing packets
Date: Fri, 16 Dec 2005 09:09:46 +0100

Note: I'm posting this to the lwip-ussers list again,
there were some mail problems earlier...

Kyle Treleaven wrote:

> I have a few questions though.  First, it seems to me that the new
> echo server will only keep a connection open that is constantly
> active.  Is that correct?

Yes, otherwise clients could eat up the server resources
if connections stay open infinitely.

> Second, as far as the transmit goes I've
> noticed two major changes:  1) it blocks on pbuf_free to make
> absolutely sure it gets freed,

Yes, this is to ensure it really gets freed. The return value must be 0.

> and 2) there's a pbuf_ref call on the
> new state chain, es->p.  First, what would cause a pbuf not to free?

The ref count not being 1.

> And I guess my real question is, what is the pbuf_ref doing?

If there are multiple references (pointers) to the pbuf,
and you call pbuf_free, the ref counter is decremented.
A pbuf_free on the last reference may actually perform the
deallocation.

This is explained a bit further in the comments in lwip/src/core/pbuf.c

Actually I "abuse" the pbuf_ref increment to chop pbufs at
the head of the chain.

Regards,

Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.





reply via email to

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