[erlang-patches] ssh synchronous eof

Daniel Goertzen <>
Wed Sep 5 16:13:03 CEST 2012


Here is a new ssh suite that tests some of the functionality of
ssh_connection.  It is based on the ssh_to_openssh_SUITE.  There are
presently 2 failing test cases:

"big_cat" shows ssh_connection:send() behaving asynchronously for large
sends.  This is the issue I was talking about earlier in this thread.

"send_after_exit" shows that ssh_connection:send() does not report an
appropriate {error, closed} if send() is attempted after a channel is
closed.  I have a use case in my project that really needs a proper {error,
closed}.

I will start working on fixes for both of these. (Oops, just saw your
patch.  I will give it a try.)

Cheers,
Dan.

git fetch :goertzenator/otp.git ssh_connection_suite
https://github.com/goertzenator/otp/compare/ssh_connection_suite
https://github.com/goertzenator/otp/compare/ssh_connection_suite.patch


On Thu, Aug 30, 2012 at 2:27 AM, Ingela Anderton Andin <
> wrote:

> Hi!
>
>
> Daniel Goertzen wrote:
>
>> After looking through the SSH code and learning more about it, I feel
>> this patch is solving the wrong problem.  The REAL problem is that
>> ssh_connection:send() is supposed to be synchronous, but is actually not in
>> some cases.
>>
>> send() will be synchronous only if the given data will fit in the channel
>> send window.  Any data beyond that will be sent asynchronously.  So if you
>> send a very large binary, or repeatedly send smaller binaries you will run
>> into this problem.
>>
>> The minimum ssh packet size mandated by the RFCs is 32kB, so the minimum
>> window is the same.  OpenSSH gives me a send window of approx 200kB.  For
>> most of the applications that people use SSH for, the send window never
>> gets overrun and you never see asynchronous send behavior out of Erlang SSH.
>>
>> Ingela, I'm inclined to write some failing test cases for this and some
>> other problems I've seen.  Would this be helpful? I have some ideas about
>> how to fix the problems, but I may not have time to actually fix them.
>>
>>
> Yes it would be helpful. Then I  will not include your patch.   The remote
> id fix is already added. And we can investigate this other problem further
> I may need to refresh my ssh
> RFC knowledge too.
>
> Regards Ingela Erlang/OTP team - Ericsson AB
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20120905/9bf6965e/attachment.html>


More information about the erlang-patches mailing list