From 734506318c49778ff959c0f1f5136543fe8c314b Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 2 Apr 2015 14:53:17 +0200 Subject: ssh: fix loop bug for zero maximum_packet_size. A channel could be opened with the 'max packet size' set to 0. The behaviour is not defined in the ssh rfc:s, and openssh does not handle that case in some special way besides looping. The introduced solution just "keep quiet" but removes the eternal loop that caused Erlang to core dump. --- lib/ssh/src/ssh_connection.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/ssh/src/ssh_connection.erl') diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl index e9b4547aef..e6f2f12fb7 100644 --- a/lib/ssh/src/ssh_connection.erl +++ b/lib/ssh/src/ssh_connection.erl @@ -1040,6 +1040,9 @@ do_update_send_window(Channel0, Cache) -> get_window(#channel{send_window_size = 0 } = Channel, Acc) -> {lists:reverse(Acc), Channel}; +get_window(#channel{send_packet_size = 0 + } = Channel, Acc) -> + {lists:reverse(Acc), Channel}; get_window(#channel{send_buf = Buffer, send_packet_size = PacketSize, send_window_size = WindowSize0 -- cgit v1.2.3