Skip to content

Commit

Permalink
Merge pull request #786 from openziti/fix-network-enroll
Browse files Browse the repository at this point in the history
handle redirect before invoking response callback
  • Loading branch information
ekoby authored Dec 6, 2024
2 parents d32c419 + 2609659 commit d2cc1aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/ziti_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ static void ctrl_resp_cb(tlsuv_http_resp_t *r, void *data) {
}

static void ctrl_default_cb(void *s, const ziti_error *e, struct ctrl_resp *resp) {
if (resp->resp_cb) {
resp->resp_cb(s, e, resp->ctx);
}
ziti_controller *ctrl = resp->ctrl;
if (resp->new_address && strcmp(resp->new_address, ctrl->url) != 0) {
CTRL_LOG(INFO, "controller supplied new address[%s]", resp->new_address);
Expand All @@ -250,6 +247,10 @@ static void ctrl_default_cb(void *s, const ziti_error *e, struct ctrl_resp *resp
}
}

if (resp->resp_cb) {
resp->resp_cb(s, e, resp->ctx);
}

FREE(resp->new_address);
if (resp->resp_json != NULL) {
json_object_put(resp->resp_json);
Expand Down

0 comments on commit d2cc1aa

Please sign in to comment.