http_client: invoke debug callbcaks if they are enabled
@@ -984,6 +984,7 @@ int flb_http_do(struct flb_http_client *c, size_t *bytes)
c->header_buf[c->header_len++] = '\r';
c->header_buf[c->header_len++] = '\n';
+#ifdef FLB_HAVE_HTTP_CLIENT_DEBUG
/* debug: request_headers callback */
flb_http_client_debug_cb(c, "_debug.http.request_headers");
@@ -991,6 +992,7 @@ int flb_http_do(struct flb_http_client *c, size_t *bytes)
if (c->body_len > 0) {
flb_http_client_debug_cb(c, "_debug.http.request_payload");
}
+#endif
/* Write the header */
ret = flb_io_net_write(c->u_conn,
@@ -1067,10 +1069,13 @@ int flb_http_do(struct flb_http_client *c, size_t *bytes)
}
}
+#ifdef FLB_HAVE_HTTP_CLIENT_DEBUG
flb_http_client_debug_cb(c, "_debug.http.response_headers");
if (c->resp.payload_size > 0) {
flb_http_client_debug_cb(c, "_debug.http.response_payload");
}
+#endif
+
return 0;
}
