lwip-users
[Top][All Lists]
Advanced

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

AW: AW: [lwip-users] Still a Bug with memory wasting after PPP reconnect


From: Letschi
Subject: AW: AW: [lwip-users] Still a Bug with memory wasting after PPP reconnect?
Date: Mon, 9 Mar 2009 21:38:50 +0100

It wasn't a Bug - It was my own mistake: I called PPPInit several times but
you have to call it only once!

-----Ursprüngliche Nachricht-----
Von: address@hidden
[mailto:address@hidden Im Auftrag
von Alain M.
Gesendet: Montag, 9. März 2009 18:23
An: Mailing list for lwIP users
Betreff: Re: AW: [lwip-users] Still a Bug with memory wasting after PPP
reconnect?

Could you please describe the bug a little more and how you fixed or 
worked around that?

We are starting to use lwip for GPRS modem too, and any information will 
be wellcomed :)

thanks,
Alain

Letschi escreveu:
> I found it! It isn't a lwip-Bug! With every reconnect I called pppInit and
> this function calls mem_malloc!
> 
> -----Ursprüngliche Nachricht-----
> Von: address@hidden
> [mailto:address@hidden Im
Auftrag
> von address@hidden
> Gesendet: Samstag, 7. März 2009 19:21
> An: Mailing list for lwIP users
> Betreff: Re: [lwip-users] Still a Bug with memory wasting after PPP
> reconnect?
> 
> I know this is not the answer you'd expect, but I have to warn you that 
> there is currently no active developer using the PPP part of lwIP, so 
> you might have to rely on answers of other users on this list. As 
> always, new developers caring about PPP are welcome to take part and 
> improve it!
> 
> Simon
> 
> 
> Letschi wrote:
>> Hello!
>>
>> I am using PPP over a serial interface to communicate with a 
>> GSM-Modem. This works fine, but I have the following problem: After 
>> closing the PPP connection and reestablishing the connection, my 
>> application crashes because pbuf_alloc returns NULL. The number of 
>> reconnects the application “survives” depends on the define MEM_SIZE 
>> (size of reserved heap memory). My application only uses one 
>> pbuf_malloc-call:
>>
>> Int SendUdpMsg (udp_pcb *pUdpConn, void *pBuff, int nLength )
>>
>> {
>>
>> struct pbuf* packet;
>>
>> char * data;
>>
>> packet=(struct pbuf *)pbuf_alloc(PBUF_TRANSPORT, nLength, PBUF_RAM);
>>
>> Assert( packet != NULL );
>>
>> data=(char*)packet->payload;
>>
>> memcpy(data, pBuff, nLength );
>>
>> udp_send(pUdpConn, packet);
>>
>> pbuf_free( packet );
>>
>> return nLength;
>>
>> }
>>
>> As you can see I free the allocated memory directly after sending, so 
>> I don’t really know who is wasting my mem? Anyone an idea?`
>>
>> Best regards,
>>
>> Letschi
>>
>> ------------------------------------------------------------------------


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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