From 9424e7ec1313861299e84453e3a3c68c0a76cba3 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 8 Jan 2017 15:29:54 +0300 Subject: [PATCH] Strip too long error messages --- src/cypherpunks.ru/nncp/log.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cypherpunks.ru/nncp/log.go b/src/cypherpunks.ru/nncp/log.go index f37d949..5b64880 100644 --- a/src/cypherpunks.ru/nncp/log.go +++ b/src/cypherpunks.ru/nncp/log.go @@ -112,6 +112,9 @@ func (ctx *Ctx) LogP(who string, sds SDS, msg string) { func (ctx *Ctx) LogE(who string, sds SDS, msg string) { msg = msgFmt(LogLevel("E"), who, sds, msg) + if len(msg) > 2048 { + msg = msg[:2048] + } fmt.Fprintln(os.Stderr, ctx.Humanize(msg)) ctx.Log(msg) } -- 2.50.0