-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update ctrl list with new advertised address #794
Conversation
better handle invalid controller responses
library/ziti.c
Outdated
model_list_iter it = model_list_iterator(&ztx->config.controllers); | ||
while(it) { | ||
char *addr = (char*)model_list_it_element(it); | ||
if (strcmp(addr, ztx->config.controller_url) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be case insensitive?
library/ziti_ctrl.c
Outdated
const char *k; | ||
ziti_controller_detail *detail; | ||
MODEL_MAP_FOREACH(k, detail, &ctrl->endpoints) { | ||
if (strcmp(k, ctrl->url) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same - case insensitive?
if(detail == NULL) { | ||
detail = alloc_ziti_controller_detail(); | ||
} | ||
FREE(detail->name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if detail was NULL previous, you still need to FREE the name? seems like could be in the else?
if (resp->resp_content == ctrl_content_text) { | ||
resp_obj = string_buf_to_string(resp->content_proc, NULL); | ||
if (resp->body_parse_func) { | ||
error.code = strdup("INVALID_CONTROLLER_RESPONSE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've never noticed this before but i'm surprised the code doesn't come from the corresponding CODE_MAP
. seems like they could get out of sync this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case insensitive comparisons seems like a good idea for a domain name?
better handle invalid controller responses