[Top][All Lists]

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

Re: [lwip-users] smtp app & tcp_connect vs lwip_connect

From: address@hidden
Subject: Re: [lwip-users] smtp app & tcp_connect vs lwip_connect
Date: Sat, 07 Feb 2015 21:07:26 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Newman, Adam wrote:
The comments for the smtp app state that the smtp_send_request should be created somewhere safe for interrupt context. Is this at all related to the above unsafe-ness

Yes. That is, if I understood you correctly. You should use smtp_send_mail_int (see below) when not calling from tcip_thread.

or a seperate issue? I'm not certain when an object that never gets deleted would ever be unsafe for interrupt context but that probably just reflects my level of knowledge on the topic.

Yes, it is.

I did try creating each smtp_send_request object using a heap_malloc but it still crashes in tcp_input.

You did not do that from within tcpip_thread, did you?

Is this an issue folks are familiar with i.e. is there a silver bullet?

Yes: obey lwIP's threading requirements!!!

Or, is it better (and safer) to avoid tcp_connect directly from the application

If you mean 'application thread' by 'application', then: yes!

and write my own smtp implementation using lwip_connect?

There's no need to do that, just use smtp_send_mail_int() , like this:
tcpip_callback(smtp_send_mail_int, your_mail_req)
where your_mail_req is a pointer to a struct smtp_send_request. I probably should have added a big ATTENTION/EXAMPLE not for this somewhere...


reply via email to

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