1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-15 18:17:32 -05:00

log_proxy_stderr: limit the length of Event Log lines.

If a proxy command jabbers on standard error in a way that doesn't
involve any newline characters, we now won't keep buffering data for
ever.

(Not that I've heard of it happening, but I noticed the theoretical
possibility on the way past in a recent cleanup pass.)
This commit is contained in:
Simon Tatham
2019-03-01 19:18:31 +00:00
parent 76bacaabf0
commit b9f20b84f3
4 changed files with 83 additions and 41 deletions

View File

@ -290,7 +290,13 @@ void backend_socket_log(Seat *seat, LogContext *logctx,
int type, SockAddr *addr, int port,
const char *error_msg, int error_code, Conf *conf,
bool session_started);
typedef struct ProxyStderrBuf {
char buf[8192];
size_t size;
} ProxyStderrBuf;
void psb_init(ProxyStderrBuf *psb);
void log_proxy_stderr(
Plug *plug, bufchain *buf, const void *vdata, size_t len);
Plug *plug, ProxyStderrBuf *psb, const void *vdata, size_t len);
#endif