mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05: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:
parent
181e6fdfe1
commit
088a1d37e9
10
logging.c
10
logging.c
@ -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
|
* 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
|
* also as convenient a place as any to put the output of Event Log
|
||||||
|
1
putty.h
1
putty.h
@ -655,6 +655,7 @@ void log_reconfig(void *logctx, Config *cfg);
|
|||||||
void logfopen(void *logctx);
|
void logfopen(void *logctx);
|
||||||
void logfclose(void *logctx);
|
void logfclose(void *logctx);
|
||||||
void logtraffic(void *logctx, unsigned char c, int logmode);
|
void logtraffic(void *logctx, unsigned char c, int logmode);
|
||||||
|
void logflush(void *logctx);
|
||||||
void log_eventlog(void *logctx, const char *string);
|
void log_eventlog(void *logctx, const char *string);
|
||||||
enum { PKT_INCOMING, PKT_OUTGOING };
|
enum { PKT_INCOMING, PKT_OUTGOING };
|
||||||
void log_packet(void *logctx, int direction, int type,
|
void log_packet(void *logctx, int direction, int type,
|
||||||
|
@ -3311,6 +3311,7 @@ void term_out(Terminal *term)
|
|||||||
}
|
}
|
||||||
|
|
||||||
term_print_flush(term);
|
term_print_flush(term);
|
||||||
|
logflush(term->logctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user