Re: [libmicrohttpd] MHD_create_response_from_fd using a pipe

2015-06-02 Thread Christian Grothoff
Hi! Why don't you just use 'MHD_create_response_from_fd'? I'm not sure how well pipes (or socketpairs) work with 'sendfile', but short of that, this should work at least to set the FD. You wouldn't be able to do chunked encoding on systems where 'size_t != uint64_t' (because we have 'size_t' for

Re: [libmicrohttpd] MHD_create_response_from_fd using a pipe

2015-06-02 Thread Denis Dowling
Hi, The 'MHD_create_response_from_fd' almost does what I want but I need a different MHD_ContentREaderFreeCallback that does more then just close the fd. When the pipe is finished reading the process needs to be reaped with a pclose() call. Not sure if there is another way to have a function ca

Re: [libmicrohttpd] Expose the fdset events

2015-06-02 Thread Simon Newton
Digging up a thread from the past... Is the codebase in a better shape to make this change now? We've run into this again now that we've switched to using kevent rather than select. If you're looking for existing APIs to model this from, Avahi has a watch API [1] which provides fd notifications

Re: [libmicrohttpd] MHD_create_response_from_fd using a pipe

2015-06-02 Thread Christian Grothoff
On 06/03/2015 03:44 AM, Denis Dowling wrote: > Then in my code when I want to return data from a process I do something like > > FILE *pf = popen(cmd, "r"); > int fd = fileno(pf); > > response = MHD_create_response_from_callback_fd(-1, 4096, &popen_reader, > pf, &popen_free, fd);