return buffer;
}
-/* format_protobuf iterates over all metric families in "metrics" and adds them
+/* format_text iterates over all metric families in "metrics" and adds them
* to a buffer in plain text format. */
static void format_text(ProtobufCBuffer *buffer) {
pthread_mutex_lock(&metrics_lock);
/* http_handler is the callback called by the microhttpd library. It essentially
* handles all HTTP request aspects and creates an HTTP response. */
-static MHD_RESULT http_handler(void *cls, struct MHD_Connection *connection,
- const char *url, const char *method,
- const char *version, const char *upload_data,
- size_t *upload_data_size,
+static MHD_RESULT http_handler(__attribute__((unused)) void *cls,
+ struct MHD_Connection *connection,
+ __attribute__((unused)) const char *url,
+ const char *method,
+ __attribute__((unused)) const char *version,
+ __attribute__((unused)) const char *upload_data,
+ __attribute__((unused)) size_t *upload_data_size,
void **connection_state) {
if (strcmp(method, MHD_HTTP_METHOD_GET) != 0) {
return MHD_NO;
}
- /* On the first call for each connection, return without anything further.
- * Apparently not everything has been initialized yet or so; the docs are not
- * very specific on the issue. */
+ /* According to documentation, first call for each connection is after headers
+ * have been parsed, and should be used only for reporting errors */
if (*connection_state == NULL) {
/* keep track of connection state */
*connection_state = &"called";