On 10/24/2016 04:51 PM, Tom Cornell wrote:
> Quick question, probably: Should I be able to send replies from a
> different thread from the one that runs the access handler callback,
> using internal select? (Using suspend/resume. Also this is 0.9.50, in
> case that matters.)

You may call resume from a different thread, but you must then queue the
reply from the MHD thread.

> I am getting a panic from the very end of build_header_response (I
> think line 1123 in 0.9.50). From my own logs (and custom panic
> function), it looks like mhd_panic is called by the main listener
> thread, pretty much right after my worker thread has sent the
> response. Usually, things (appear to) work fine for a few minutes
> before the panic, but I am assuming that is more a matter of luck
> than design.
> 
> I know I could be doing this with external select. This is mainly out
> of curiosity to know whether I really am going against the grain of
> MHD's design here, or if instead I've  just overlooked something I
> should/should not be doing. If this is something that should work,
> then I can go into more detail about what I am doing/trying to do.

I'm not 100% sure of what you are doing, but the key rule is that
MHD_queue_response has to be called from within the main handler callback.

I hope this helps!

Happy hacking!

Christian

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to