From 270b02293e85a994673d6048b25ed3a1c7fd97d8 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Tue, 27 Oct 2026 15:28:57 +0300 Subject: [PATCH] Loggers: no blocks flag A logger's lines are written by a thread of its own, its clients only queueing them, so a logger whose writes wait cannot hold a client's thread or a loop: its blocks flag, giving its services a thread for each client, is gone. ODBC was the logger setting it; its services are served on loops now too. Only a logger whose thread could not be started is written by its clients themselves, as before. Plugins: struct logtype loses its last member, blocks. Co-Authored-By: Claude Opus 5.5 --- src/mainconf.c | 1 - src/sql.c | 2 +- src/structures.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mainconf.c b/src/mainconf.c index 0c094a5..0dad946 100644 --- a/src/mainconf.c +++ b/src/mainconf.c @@ -652,7 +652,6 @@ static int srvprepare(struct srvstart *s, int argc, char **argv){ other client */ if(srv->o_nsfd >= 0) srv->threadperclient = 1; #endif - if(srv->logger && srv->logger->type && srv->logger->type->blocks) srv->threadperclient = 1; #ifndef STDMAIN if(sysresolves(srv->resolvmode)) srv->threadperclient = 1; #endif diff --git a/src/sql.c b/src/sql.c index 54500dd..0f0fd99 100644 --- a/src/sql.c +++ b/src/sql.c @@ -132,7 +132,7 @@ static void odbcclose(struct logger *lg){ } const struct logtype logtype_odbc = { - "odbc", odbcmatch, odbcinit, odbcformat, odbcwrite, odbcclose, NULL, LOGSTACKSIZE, 0, 0, 1, 1 + "odbc", odbcmatch, odbcinit, odbcformat, odbcwrite, odbcclose, NULL, LOGSTACKSIZE, 0, 0, 1 }; #endif diff --git a/src/structures.h b/src/structures.h index 8e9b39e..df20696 100644 --- a/src/structures.h +++ b/src/structures.h @@ -668,7 +668,6 @@ struct logtype { int standard; /* kept open for the life of the process */ int text; /* writes a line of text: errors can go there */ int params; /* the string after a comma is parameters */ - int blocks; /* waits for its writes other than in sockpoll() */ }; /* What a log's queue holds: a line (log.c's struct logslot, of which this