Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-10-10 22:32:23 +0400
committerSimon Tatham <anakin@pobox.com>2012-10-10 22:32:23 +0400
commit36b8d450f0fa33b3f4a1d2cda9a4854ca2ab4eb6 (patch)
tree55f9bf10c5f35e4175f0eaca1ea05c3688158482 /logging.c
parent8e56c52eaaa78b322eec301ea007c093a75cb7dd (diff)
Add timestamps to the 'SSH raw data' logging mode.
[originally from svn r9687]
Diffstat (limited to 'logging.c')
-rw-r--r--logging.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/logging.c b/logging.c
index 6252364c..fc89db73 100644
--- a/logging.c
+++ b/logging.c
@@ -258,8 +258,21 @@ void log_packet(void *handle, int direction, int type,
type, type, texttype);
}
} else {
- logprintf(ctx, "%s raw data\r\n",
- direction == PKT_INCOMING ? "Incoming" : "Outgoing");
+ /*
+ * Raw data is logged with a timestamp, so that it's possible
+ * to determine whether a mysterious delay occurred at the
+ * client or server end. (Timestamping the raw data avoids
+ * cluttering the normal case of only logging decrypted SSH
+ * messages, and also adds conceptual rigour in the case where
+ * an SSH message arrives in several pieces.)
+ */
+ char buf[256];
+ struct tm tm;
+ tm = ltime();
+ strftime(buf, 24, "%Y-%m-%d %H:%M:%S", &tm);
+ logprintf(ctx, "%s raw data at %s\r\n",
+ direction == PKT_INCOMING ? "Incoming" : "Outgoing",
+ buf);
}
/*