ajaxorg/jsftp — pull request #2 by sergi (2012-11-11 13:42:02+00:00)
Title: Changed code to continuation-style to avoid potential bugs

We should only create streams when the socket is connected. But if we do that, many tests will fail due to commands being issued when the stream queue is not yet available, because the socket hasn't connected yet. To solve this, we create a buffer of commands that are issued while the socket is not yet available, and we send them ordered in the server when the socket eventually connects.

This change doesn't need new unit tests, since the existing ones would break if the flow was not async.

@zefhemel @ajaxorg/knuth