zedshaw/mongrel2 — pull request #240 by artemharutyunyan (2014-11-18 18:50:14+00:00)
Title: Closing the temporary file before notifying about upload completion.

mkstemp() opens the file with O_EXCL, so notifying upload handler about completion before actually closing the file can lead to a race condition where the handler fails to open() the file because the close() on the original file descriptor returned by mkstemp() has not been called yet.