libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Clarification on receiving on one thread, replying o


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Clarification on receiving on one thread, replying on another
Date: Mon, 24 Oct 2016 20:22:03 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

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

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