Skip to content

Commit

Permalink
fix cb declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoby committed Dec 14, 2023
1 parent 98d6995 commit f4f8575
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions library/ziti_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion programs/sample_http_link/sample_http_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/ziti_src_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f4f8575

Please sign in to comment.