aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sftpd.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-02-28 16:47:20 +0100
committerHans Nilsson <[email protected]>2018-03-29 11:58:28 +0200
commit3715deff44f38aa35873106cd1f116c74c65040a (patch)
tree858ee3c036609eab1f717c5fd42a9b606465026a /lib/ssh/src/ssh_sftpd.erl
parent3352eaf189c55e60778fc76b94530fac0c314fba (diff)
downloadotp-3715deff44f38aa35873106cd1f116c74c65040a.tar.gz
otp-3715deff44f38aa35873106cd1f116c74c65040a.tar.bz2
otp-3715deff44f38aa35873106cd1f116c74c65040a.zip
ssh: Use the new ssh_dbg module
Diffstat (limited to 'lib/ssh/src/ssh_sftpd.erl')
-rw-r--r--lib/ssh/src/ssh_sftpd.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl
index 427edf01ab..26cf2cb665 100644
--- a/lib/ssh/src/ssh_sftpd.erl
+++ b/lib/ssh/src/ssh_sftpd.erl
@@ -38,6 +38,8 @@
-export([init/1, handle_ssh_msg/2, handle_msg/2, terminate/2]).
+-export([dbg_trace/3]).
+
-record(state, {
xf, % [{channel,ssh_xfer states}...]
cwd, % current dir (on first connect)
@@ -947,3 +949,20 @@ maybe_increase_recv_window(ConnectionManager, ChannelId, Options) ->
Increment =< 0 ->
do_nothing
end.
+
+%%%################################################################
+%%%#
+%%%# Tracing
+%%%#
+
+dbg_trace(points, _, _) -> [terminate];
+
+dbg_trace(flags, terminate, _) -> [c];
+dbg_trace(on, terminate, _) -> dbg:tp(?MODULE, terminate, 2, x);
+dbg_trace(off, terminate, _) -> dbg:ctpg(?MODULE, terminate, 2);
+dbg_trace(format, terminate, {call, {?MODULE,terminate, [Reason, State]}}) ->
+ ["SftpD Terminating:\n",
+ io_lib:format("Reason: ~p,~nState:~n~s", [Reason, wr_record(State)])
+ ].
+
+?wr_record(state).