log: truncate giant IO logging.

Adding a giant IO message simply causes it to be pruned immediately,
so truncate it if it's more than 1/64 the max size.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-04-08 09:22:19 +09:30
parent 6cac2c959e
commit 87cd628f52
5 changed files with 30 additions and 12 deletions

View File

@@ -382,7 +382,7 @@ void set_log_outfn_(struct log_book *lr UNNEEDED,
bool continued UNNEEDED,
const struct timeabs *time UNNEEDED,
const char *str UNNEEDED,
const u8 *io UNNEEDED,
const u8 *io UNNEEDED, size_t io_len UNNEEDED,
void *arg) UNNEEDED,
void *arg UNNEEDED)
{ fprintf(stderr, "set_log_outfn_ called!\n"); abort(); }