Re: [libmicrohttpd] Complete request on fd becoming ready

2017-03-27 Thread Kenneth Mastro
On the MHD side, it may depend on connection volume and your hardware. You could use the 'thread per connection' mode, which would allow the thread to wait for a response without blocking other connections. Alternatively, you could use MHD's 'suspend/resume' functionality to reduce the number of

Re: [libmicrohttpd] Complete request on fd becoming ready

2017-03-27 Thread Hein-Pieter van Braam
Hi! Thank you for your reply, I think my original question wasn't very well posed. Let me try to rephrase it. In the epoll + threadpool configuration of MHD, MHD itself uses an epoll() type loop to service fds that are ready to send or receive traffic from clients. I/O is non-blocking and when MH

Re: [libmicrohttpd] Complete request on fd becoming ready

2017-03-27 Thread Kenneth Mastro
See inline comments, below. Ken On Mon, Mar 27, 2017 at 9:04 AM, Hein-Pieter van Braam wrote: > Hi! > > Thank you for your reply, I think my original question wasn't very well > posed. Let me try to rephrase it. > In the epoll + threadpool configuration of MHD, MHD itself uses an > epoll() t

[libmicrohttpd] why does not libmicrohttpd support for resume from break-point??

2017-03-27 Thread ??**??
why does not libmicrohttpd support for resume from break-point?? how do?? Please give some suggestions??

[libmicrohttpd] feature request: give a possibility to re-assign callbacks

2017-03-27 Thread Vitaliy T
Hello, 1. Subj. 2. Why is this should be useful? 2.1. When you're actively using suspend/resume functionality and later trying to shutdown the MHD daemon, then last one, by default, uses default callbacks (which were given at the startup) for _resumed_ connections (as docs says). By good intenti

Re: [libmicrohttpd] MHD_quiesce_daemon() question

2017-03-27 Thread Christian Grothoff
On 03/26/2017 10:36 PM, Evgeny Grin wrote: > On 26.03.2017 8:33, silvioprog wrote: >> I found the following related message: >> >> https://lists.gnu.org/archive/html/libmicrohttpd/2014-09/msg00012.html >> >> I've used a similar logic, but with item X below, because I need to wait >> the client proc

[libmicrohttpd] Reading data from named pipe

2017-03-27 Thread Alex Reynolds
I have an API that reads a subset of data from an archive and writes it to a FILE*. I can use this API to write this data subset to a temporary file via mkstemp() and fdopen(). I am currently using MHD_create_response_from_callback() to read chunks of bytes from this temporary file and write them

Re: [libmicrohttpd] feature request: give a possibility to re-assign callbacks

2017-03-27 Thread Evgeny Grin
On 27.03.2017 17:29, Vitaliy T wrote: > 1. Subj. Which callbacks would you like to reassign? > 2. Why is this should be useful? > > 2.1. When you're actively using suspend/resume functionality and later > trying to shutdown the MHD daemon, then last one, by default, uses > default callbacks (whic

Re: [libmicrohttpd] why does not libmicrohttpd support for resume from break-point?

2017-03-27 Thread Evgeny Grin
Hi! Could you clarify, what do you mean by "resume from break-point"? -- Best Wishes, Evgeny Grin On 27.03.2017 5:21, 星**光 wrote: > why does not libmicrohttpd support for resume from break-point? how > do? Please give some suggestions?

Re: [libmicrohttpd] feature request: give a possibility to re-assign callbacks

2017-03-27 Thread Vitaliy T
On 27 March 2017 at 23:19, Evgeny Grin wrote: > Which callbacks would you like to reassign? At least, MHD_AccessHandlerCallback (a.k.a DH). > What prevents to return "MHD_NO" early from the same callback when required? Nothing. But on each request we do at least one useless check. > Simple (ps

Re: [libmicrohttpd] MHD_quiesce_daemon() question

2017-03-27 Thread silvioprog
Thanks for replying Evgeny, you and Christian always saving my day. :-) I read and re-read your and Christian answer, and finally I found a possible way to never lock the server at shutdown: adding an option to exit the server after configurable attempts. It can solve the timeout problem too, beca

Re: [libmicrohttpd] MHD_quiesce_daemon() question

2017-03-27 Thread silvioprog
Thanks a lot for your great idea, dude. I certainly will use it very soon. :-) I took a look at IPCs, but now, I would like something that stops receiving new clients and forces the current ones to finish their processing. Probably I may use IPCs (or any existing feature in MHD) to send some signa