From f4f8575a53f648433d1c7f82e5e0180b714b6e87 Mon Sep 17 00:00:00 2001 From: Eugene K Date: Thu, 14 Dec 2023 09:04:50 -0500 Subject: [PATCH] fix cb declarations --- library/ziti_ctrl.c | 8 ++++---- programs/sample_http_link/sample_http_link.c | 2 +- tests/ziti_src_tests.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/ziti_ctrl.c b/library/ziti_ctrl.c index b591f09e..246e435c 100644 --- a/library/ziti_ctrl.c +++ b/library/ziti_ctrl.c @@ -132,7 +132,7 @@ static void ctrl_paging_req(struct ctrl_resp *resp); static void ctrl_default_cb(void *s, const ziti_error *e, struct ctrl_resp *resp); -static void ctrl_body_cb(tlsuv_http_req_t *req, const char *b, ssize_t len); +static void ctrl_body_cb(tlsuv_http_req_t *req, char *b, ssize_t len); static tlsuv_http_req_t * start_request(tlsuv_http_t *http, const char *method, const char *path, tlsuv_http_resp_cb cb, struct ctrl_resp *resp) { @@ -285,11 +285,11 @@ static void ctrl_service_cb(ziti_service **services, ziti_error *e, struct ctrl_ free(services); } -static void free_body_cb(tlsuv_http_req_t *req, const char *body, ssize_t len) { - free((char *) body); +static void free_body_cb(tlsuv_http_req_t *req, char *body, ssize_t len) { + free(body); } -static void ctrl_body_cb(tlsuv_http_req_t *req, const char *b, ssize_t len) { +static void ctrl_body_cb(tlsuv_http_req_t *req, char *b, ssize_t len) { struct ctrl_resp *resp = req->data; ziti_controller *ctrl = resp->ctrl; diff --git a/programs/sample_http_link/sample_http_link.c b/programs/sample_http_link/sample_http_link.c index 0477a463..77780345 100644 --- a/programs/sample_http_link/sample_http_link.c +++ b/programs/sample_http_link/sample_http_link.c @@ -45,7 +45,7 @@ void resp_cb(tlsuv_http_resp_t *resp, void *data) { printf("\n"); } -void body_cb(tlsuv_http_req_t *req, const char *body, ssize_t len) { +void body_cb(tlsuv_http_req_t *req, char *body, ssize_t len) { if (len == UV_EOF) { printf("\n\n====================\nRequest completed\n"); ziti_shutdown(ziti); diff --git a/tests/ziti_src_tests.cpp b/tests/ziti_src_tests.cpp index a9b83e8c..544befe2 100644 --- a/tests/ziti_src_tests.cpp +++ b/tests/ziti_src_tests.cpp @@ -60,7 +60,7 @@ TEST_CASE("httpbin.ziti:ziti_src", "[integ]") { auto t = (source_test*)ctx; t->code = resp->code; - resp->body_cb = [](tlsuv_http_req_t *req, const char *body, ssize_t len){ + resp->body_cb = [](tlsuv_http_req_t *req, char *body, ssize_t len){ auto t = (source_test*)req->data; if (len > 0) t->body.append(body, len);