aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_channel.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-10-21 16:59:11 +0200
committerHans Nilsson <[email protected]>2014-10-21 16:59:11 +0200
commitc07fd2c3fdc14a9ccf33b604b397e581b4d52893 (patch)
treec38d6febdfdd1a7424b313d5c316a0ec3f38a667 /lib/ssh/src/ssh_channel.erl
parent6351f65ae896274c7ff1cc62561a20b7c37b324c (diff)
downloadotp-c07fd2c3fdc14a9ccf33b604b397e581b4d52893.tar.gz
otp-c07fd2c3fdc14a9ccf33b604b397e581b4d52893.tar.bz2
otp-c07fd2c3fdc14a9ccf33b604b397e581b4d52893.zip
ssh: simple info function (ssh_info:print/0).
Diffstat (limited to 'lib/ssh/src/ssh_channel.erl')
-rw-r--r--lib/ssh/src/ssh_channel.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl
index 508ae637cf..5c24f362b1 100644
--- a/lib/ssh/src/ssh_channel.erl
+++ b/lib/ssh/src/ssh_channel.erl
@@ -67,7 +67,8 @@
%% Internal application API
-export([cache_create/0, cache_lookup/2, cache_update/2,
cache_delete/1, cache_delete/2, cache_foldl/3,
- cache_find/2]).
+ cache_find/2,
+ get_print_info/1]).
-record(state, {
cm,
@@ -190,6 +191,14 @@ init([Options]) ->
%% {stop, Reason, State}
%% Description: Handling call messages
%%--------------------------------------------------------------------
+handle_call(get_print_info, _From, State) ->
+ Reply =
+ {{State#state.cm,
+ State#state.channel_id},
+ io_lib:format('CB=~p',[State#state.channel_cb])
+ },
+ {reply, Reply, State};
+
handle_call(Request, From, #state{channel_cb = Module,
channel_state = ChannelState} = State) ->
try Module:handle_call(Request, From, ChannelState) of
@@ -333,6 +342,9 @@ cache_find(ChannelPid, Cache) ->
Channel
end.
+get_print_info(Pid) ->
+ call(Pid, get_print_info, 1000).
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------