I have just backported important fixes from the latest developments in this hotfix release.
- fix blocking
- async I/O with FastCGI with
- backlog defaults to
accept call was a real pain to work around, but I finally ended
up with an elegant solution:
- use a threaded loop for accepting a new request
- delegate the processing into the main context
FastCGI mutiplexes multiple requests on a single connection and thus, it’s hard
to perform efficient asynchronous I/O. The only thing we can do is polling the
unique file descriptor we have and to do it correctly, why not reusing
The streams are reimplemented by deriving
UnixOutputStream and overriding
write to write a record instead
of the raw data. That’s it!
I have also been working on SCGI: the netstring processing is now fully asynchronous. I couldn’t backport it as it was depending on other breaking changes.