From 47d92d8f9d9891a9b40f3fbef1d762537af4ae25 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 17 Jun 2021 16:56:51 +0200 Subject: Nest: Clean up main channel handling Remove assumption that main channel is the only channel. --- sysdep/unix/krt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index ceb88563..7c2614b1 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -1013,7 +1013,7 @@ krt_postconfig(struct proto_config *CF) if (cf->c.class == SYM_TEMPLATE) return; - if (EMPTY_LIST(CF->channels)) + if (! proto_cf_main_channel(CF)) cf_error("Channel not specified"); #ifdef CONFIG_ALL_TABLES_AT_ONCE -- cgit v1.2.3 From 227e2d5541e86210b383c8e8054805692ad3cf14 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 26 May 2021 16:42:02 +0200 Subject: Debug output uses local buffer to avoid clashes between threads. --- sysdep/unix/log.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 14d18c01..4e9df069 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -309,22 +309,15 @@ die(const char *msg, ...) void debug(const char *msg, ...) { -#define MAX_DEBUG_BUFSIZE 65536 +#define MAX_DEBUG_BUFSIZE 16384 va_list args; - static uint bufsize = 4096; - static char *buf = NULL; - - if (!buf) - buf = mb_alloc(&root_pool, bufsize); + char buf[MAX_DEBUG_BUFSIZE]; va_start(args, msg); if (dbgf) { - while (bvsnprintf(buf, bufsize, msg, args) < 0) - if (bufsize >= MAX_DEBUG_BUFSIZE) - bug("Extremely long debug output, split it."); - else - buf = mb_realloc(buf, (bufsize *= 2)); + if (bvsnprintf(buf, MAX_DEBUG_BUFSIZE, msg, args) < 0) + bug("Extremely long debug output, split it."); fputs(buf, dbgf); } -- cgit v1.2.3