Skip to content

Commit 8fea94c

Browse files
authored
Merge pull request #851 from openziti/shutdown-fix
fix ziti_shutdown(): trying to logout sometimes lead to crashes
2 parents e369d2f + 285cb25 commit 8fea94c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

library/ziti.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static void ziti_stop_internal(ziti_context ztx, void *data) {
529529

530530
ziti_ctrl_cancel(ztx_get_controller(ztx));
531531
// logout
532-
ziti_ctrl_logout(ztx_get_controller(ztx), logout_cb, ztx);
532+
ziti_ctrl_clear_api_session(ztx_get_controller(ztx));
533533
update_ctrl_status(ztx, ZITI_DISABLED, ziti_errorstr(ZITI_DISABLED));
534534
ztx->enabled = false;
535535
}

library/ziti_ctrl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,9 @@ static void on_http_close(tlsuv_http_t *clt) {
689689
}
690690

691691
int ziti_ctrl_cancel(ziti_controller *ctrl) {
692+
if (ctrl->client == NULL) {
693+
return ZITI_OK;
694+
}
692695
return tlsuv_http_cancel_all(ctrl->client);
693696
}
694697

0 commit comments

Comments
 (0)