I have a change that seems to work, at least I've tested with http & https using an external kqueue/kevent event manager.
Christian: do you mind looking over https://github.com/nomis52/libmicrohttpd/pull/1/files which has the API & an example program. If you're happy with the approach I'll clean up the rest of the code so you can review it. Simon On Thu, Jun 4, 2015 at 8:05 AM, Simon Newton <li...@nomis52.net> wrote: > On Wed, Jun 3, 2015 at 1:08 AM, Christian Grothoff <groth...@gnunet.org> > wrote: >> Well, the easiest way you can do it now is just ask MHD to run in >> 'EPOLL' mode and grab the epoll() FD. Then you can select/poll/epoll on >> the MHD epoll() FD. You won't get detailed information about add/remove >> events from MHD, but you'll then only have to deal with one FD for all >> of MHD in your event set ever, and your overall big-O complexity for all >> operations should also be perfect. > > That only works for platforms with epoll() support. > > I'll have a go at building a generic event management API today. > > Simon > >> My 2 cents >> >> Christian >> >> On 06/03/2015 04:33 AM, Simon Newton wrote: >>> 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, and that has worked >>> well for us. >>> >>> [1] http://avahi.org/download/doxygen/struct_avahi_poll.html >>> >>> >>> Simon >>>