1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Flush the logfile reasonably frequently in `printable output only' and

`all session data' modes, without completely mauling the performance, by
fflush()ing once per term_out(). If anyone complains I suppose we can
make this optional.

[originally from svn r4445]
This commit is contained in:
Jacob Nevins 2004-08-12 01:02:01 +00:00
parent 181e6fdfe1
commit 088a1d37e9
3 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,16 @@ void logtraffic(void *handle, unsigned char c, int logmode)
}
}
/*
* Flush any open log file.
*/
void logflush(void *handle) {
struct LogContext *ctx = (struct LogContext *)handle;
if (ctx->cfg.logtype > 0)
if (ctx->lgfp)
fflush(ctx->lgfp);
}
/*
* Log an Event Log entry. Used in SSH packet logging mode; this is
* also as convenient a place as any to put the output of Event Log

View File

@ -655,6 +655,7 @@ void log_reconfig(void *logctx, Config *cfg);
void logfopen(void *logctx);
void logfclose(void *logctx);
void logtraffic(void *logctx, unsigned char c, int logmode);
void logflush(void *logctx);
void log_eventlog(void *logctx, const char *string);
enum { PKT_INCOMING, PKT_OUTGOING };
void log_packet(void *logctx, int direction, int type,

View File

@ -3311,6 +3311,7 @@ void term_out(Terminal *term)
}
term_print_flush(term);
logflush(term->logctx);
}
#if 0