]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
capabilities plugin: Make state tracking clearer in the MDH handler.
authorFlorian Forster <octo@collectd.org>
Wed, 29 Nov 2023 19:24:03 +0000 (20:24 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 29 Nov 2023 20:56:22 +0000 (21:56 +0100)
src/capabilities.c

index c108d145d98c83a478c7e81ddd61bb488ee31031..2909d7b9e3dff9a4605b4eb0c70d63fc8d16b937 100644 (file)
@@ -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);