ssh_connection:send/4 on R13B04 with the last argument as "infinity" fails

Kenji Rikitake kenji.rikitake@REDACTED
Sun Mar 21 06:35:16 CET 2010


On R13B04, when using
ssh_connection:send(ConnectionManager, ChannelId, Data, Timeout)
with Timeout as 'infinity' (atom), the function crashes
with the error on erlang:size([infinity]).

The following small patch will fix this, by explicitly treating
the 'infinity' atom in the pattern matching of
lib/src/ssh_connection.erl.

Kenji Rikitake

--- ssh_connection.erl.old	2010-03-21 14:28:43.000000000 +0900
+++ ssh_connection.erl	2010-03-21 14:29:59.000000000 +0900
@@ -123,6 +123,8 @@
     send(ConnectionManager, ChannelId, 0, Data, infinity).
 send(ConnectionManager, ChannelId, Data, TimeOut) when is_integer(TimeOut) ->
     send(ConnectionManager, ChannelId, 0, Data, TimeOut);
+send(ConnectionManager, ChannelId, Data, infinity) ->
+    send(ConnectionManager, ChannelId, 0, Data, infinity);
 send(ConnectionManager, ChannelId, Type, Data) ->
     send(ConnectionManager, ChannelId, Type, Data, infinity).
 send(ConnectionManager, ChannelId, Type, Data, TimeOut) ->


More information about the erlang-bugs mailing list