I was noticing that when receiving large amounts of data the erlang SSH library would often freeze and no longer receive any data from the server I was connecting to. After a bit of work, I tracked this down to an "infinite" loop in ssh_connection_handler.erl. The problem occurs when the first block has not yet been decoded and a call to next_packet is made. This would trigger the process to send itself a socket-receive message but it's possible that there isn't additional data ready on the socket. I fixed this by adding a call to make the socket active again as is the case in the subsequent next_packet function definition when the decoded_data_buffer is not empty.<br>
<br>From my testing so far, this resolves the issue and I have not yet seen any other side effects. Please let me know what you think.<br><br>I've attached my patch for R13B02, but you can also get it here:<br><a href="http://github.com/krisr/erlang-macports/raw/master/lang/erlang/files/patch-lib-ssh-src-ssh_connection_handler.erl.diff">http://github.com/krisr/erlang-macports/raw/master/lang/erlang/files/patch-lib-ssh-src-ssh_connection_handler.erl.diff</a><br>
<br>Best,<br>Kris<br clear="all"><br>-- <br>Kris Rasmussen<br><a href="mailto:kris@aptana.com">kris@aptana.com</a><br><br>Twitter: <a href="http://twitter.com/aptana">http://twitter.com/aptana</a><br>Facebook: <a href="http://aptana.com/facebook">http://aptana.com/facebook</a><br>