Nah. Consider this situation:

1. callback is invoked.
2. callback calls shttpd_copy()
3. not enough space, so shttpd_copy() yeilds to call_user()
4. __after some time__, when there is a space,  call_user() jumps to
shttpd_copy()
5. shttpd_copy() *returns* to user callback
6. and now - environment in  user_callback is junk.

Third  function needed to save/restore the stack of the callback.
Which essentially turns into coroutine.
I was naive thinking that setjmp/longjmp will be enough :-(
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
shttpd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shttpd-general

Reply via email to