Fix logging incorrect timestamp with server-time

Fixes #972
This commit is contained in:
Riamse 2014-05-06 17:10:34 -07:00 committed by TingPing
parent fea144dd19
commit 6ef41f7d4f
1 changed files with 4 additions and 3 deletions

View File

@ -690,7 +690,7 @@ get_stamp_str (char *fmt, time_t tim, char **ret)
}
static void
log_write (session *sess, char *text)
log_write (session *sess, char *text, time_t ts)
{
char *temp;
char *stamp;
@ -727,7 +727,8 @@ log_write (session *sess, char *text)
if (prefs.hex_stamp_log)
{
len = get_stamp_str (prefs.hex_stamp_log_format, time (0), &stamp);
if (!ts) ts = time(0);
len = get_stamp_str (prefs.hex_stamp_log_format, ts, &stamp);
if (len)
{
write (sess->logfd, stamp, len);
@ -911,7 +912,7 @@ PrintTextTimeStamp (session *sess, char *text, time_t timestamp)
conv = text_validate ((char **)&text, &len);
}
log_write (sess, text);
log_write (sess, text, timestamp);
scrollback_save (sess, text);
fe_print_text (sess, text, timestamp, FALSE);