Automattic/engine.io — pull request #285 by lpinca (2014-09-26 14:23:29+00:00)
Title: socket: allow upgrades if the socket is still in closing state (courtesy of @3rd-Eden)

This ensures that any buffered data still to be flushed, can be sent to the client.
After flushing the data, if the `readyState` was set to `'closing'`, this will close the newly created transport and the connection.