From 856ae316cb369956917a8dcdbeb4d662522c5f7f Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 3 Oct 2020 21:30:00 +0200 Subject: ssh/server_proxy: More debug data about backend->client passing --- ssh/server_proxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ssh/server_proxy.c b/ssh/server_proxy.c index 84f0587..98a87bc 100644 --- a/ssh/server_proxy.c +++ b/ssh/server_proxy.c @@ -209,7 +209,10 @@ static int backend_data_cb(int fd, int revents, void *tdata_) { return 0; } - int cursor = 0; + debug("[%d] data from backend (length %zu):\n", tdata->thread_id, nr); + if (debug_enabled) xxd(stdout, buffer, nr); + + ssize_t cursor = 0; while (cursor < nr) { int nw = ssh_channel_write(tdata->channel, buffer + cursor, nr - cursor); if (nw == SSH_ERROR) { @@ -218,6 +221,8 @@ static int backend_data_cb(int fd, int revents, void *tdata_) { return 0; } cursor += nw; + debug("[%d] forwarded %d bytes, total %zd/%zd\n", + tdata->thread_id, nw, cursor, nr); } } -- cgit v1.2.3-70-g09d2