From: Florian Forster Date: Wed, 29 Nov 2023 19:24:03 +0000 (+0100) Subject: capabilities plugin: Make state tracking clearer in the MDH handler. X-Git-Tag: 6.0.0-rc0~42^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc378172e245b2c246e37adb914eb8bb724da3f4;p=thirdparty%2Fcollectd.git capabilities plugin: Make state tracking clearer in the MDH handler. --- diff --git a/src/capabilities.c b/src/capabilities.c index c108d145d..2909d7b9e 100644 --- a/src/capabilities.c +++ b/src/capabilities.c @@ -203,10 +203,10 @@ static MHD_RESULT cap_http_handler(void *cls, struct MHD_Connection *connection, /* On the first call for each connection, return without anything further. * The first time only the headers are valid, do not respond in the first - * round. The docs are not very specific on the issue. */ + * round. */ if (*connection_state == NULL) { - /* set to a random non-NULL pointer. */ - *connection_state = (void *)1; + /* keep track of connection state */ + *connection_state = (void *)"called"; return MHD_YES; } DEBUG(CAP_PLUGIN ": formatted response: %s", g_cap_json);