A Day in a Pile of Work

My personal Web development blog

v0.2.9 Released! in Valum

I have just backported important fixes from the latest developments in this hotfix release.

  • fix blocking accept call
  • async I/O with FastCGI with UnixInputStream and UnixOutputStream
  • backlog defaults to 10

The blocking 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 gio-unix-2.0?

The streams are reimplemented by deriving UnixInputStream and UnixOutputStream and overriding read and 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.

Posted on .