File 2601-ssh-Remove-unused-port_bindings-from-connection.patch of Package erlang

From cb513913417070f57fbcefeaf57c1f3f477d6bbc Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Tue, 13 Aug 2019 12:14:41 +0200
Subject: [PATCH 1/2] ssh: Remove unused port_bindings from #connection{}

---
 lib/ssh/src/ssh_connect.hrl            |  1 -
 lib/ssh/src/ssh_connection.erl         | 26 +-------------------------
 lib/ssh/src/ssh_connection_handler.erl |  1 -
 3 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/lib/ssh/src/ssh_connect.hrl b/lib/ssh/src/ssh_connect.hrl
index 9a060b8304..0fee43c16f 100644
--- a/lib/ssh/src/ssh_connect.hrl
+++ b/lib/ssh/src/ssh_connect.hrl
@@ -263,7 +263,6 @@
 -record(connection, {
 	  requests = [], %% [{ChannelId, Pid}...] awaiting reply on request,
 	  channel_cache,
-	  port_bindings,
 	  channel_id_seed,
 	  cli_spec,
 	  address, 
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index 83f85b1d8e..5d773c50b0 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -60,8 +60,7 @@
 	 request_failure_msg/0, 
 	 request_success_msg/1,
 
-         bind/4, unbind/3, unbind_channel/2, 
-	 bound_channel/3, encode_ip/1
+	 encode_ip/1
         ]).
 
 -type connection_ref() :: ssh:connection_ref().
@@ -713,29 +712,6 @@ request_success_msg(Data) ->
 %%%----------------------------------------------------------------
 %%%
 %%%
-bind(IP, Port, ChannelPid, Connection) ->
-    Binds = [{{IP, Port}, ChannelPid}
-	     | lists:keydelete({IP, Port}, 1, 
-			       Connection#connection.port_bindings)],
-    Connection#connection{port_bindings = Binds}.
-
-unbind(IP, Port, Connection) ->
-    Connection#connection{
-      port_bindings = 
-      lists:keydelete({IP, Port}, 1,
-		      Connection#connection.port_bindings)}.
-unbind_channel(ChannelPid, Connection) ->
-    Binds = [{Bind, ChannelP} || {Bind, ChannelP} 
-				     <- Connection#connection.port_bindings, 
-				 ChannelP =/= ChannelPid],
-    Connection#connection{port_bindings = Binds}.
-
-bound_channel(IP, Port, Connection) ->
-    case lists:keysearch({IP, Port}, 1, Connection#connection.port_bindings) of
-	{value, {{IP, Port}, ChannelPid}} -> ChannelPid;
-	_ -> undefined
-    end.
-
 encode_ip(Addr) when is_tuple(Addr) ->
     case catch inet_parse:ntoa(Addr) of
 	{'EXIT',_} -> false;
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 9df4f1e2d7..7c71637301 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -414,7 +414,6 @@ init([Role,Socket,Opts]) ->
             {Protocol, Callback, CloseTag} = ?GET_OPT(transport, Opts),
             C = #connection{channel_cache = ssh_client_channel:cache_create(),
                             channel_id_seed = 0,
-                            port_bindings = [],
                             requests = [],
                             options = Opts},
             D0 = #data{starter = ?GET_INTERNAL_OPT(user_pid, Opts),
-- 
2.16.4

openSUSE Build Service is sponsored by