Vinicius Bernardi wrote:
I'm calling sigHUP from the same thread that
manage all PPP stuff.
That doesn't mean it's correct. Please have a close look at the
current PPP code (versions before 1.4.0 had threading bugs in the
ppp input path, so please ensure you take at least 1.4.0 as a
reference!). You will find that only the unescaping is done in a
separate ppp input thread (plus receiving bytes, but your sio
implementation has to be thread safe then, to allow RX and TX to
happen from different threads!).
Once a packet is unescaped, it is passed into the tcpip_thread by
calling pppInput() via tcpip_callback(). Note that pppSigHup() (if
that's what you mean by 'sigHUP') is *not* called from this thread
in the original lwIP sources (in fact, it's not called from
anywhere).
Now I don't
know if the commented code it's necessary or not, but
following the same way, there is no reason to depend's on
that code, if the callback functions are optional.
The callback function where you removed code from is *not* optional,
it is a vital part of TCP netconns/sockets to work. I'm guessing you
mean the callback function that can be passed to
netconn_new_with_callback(), but that's a totally different
callback. Believe me when I assure you the code you removed *is*
necessary and if an ACK can come in while a write is being
processed, your threading is messed up!
Simon
|