Skip to content
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

zitilib: populate dial_identity according to intercept.dial_options.identity #722

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

ekoby
Copy link
Member

@ekoby ekoby commented Sep 11, 2024

@ekoby ekoby requested a review from a team as a code owner September 11, 2024 19:21
while(*p != 0) {
if (*p == '$') {
p++;
if (strncmp(p, "dst_protocol", strlen("dst_protocol")) == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dst_protocol, dst_hostname, dst_port are used here multiple times as well as used in library/ziti_src.c and library/zitilib.c too... it feel like it should be centralized... maybe defined in a single location?

o += snprintf(o, sizeof(identity) - (o - identity), "%s", proto);
p += strlen("dst_protocol");
}
if (strncmp(p, "dst_hostname", strlen("dst_hostname")) == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't these be else ifs? why do the if's if not needed?

Copy link
Member

@dovholuknf dovholuknf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of questions ... most notable is the string literal reuse.

@ekoby ekoby merged commit a34f54c into release-1.x Sep 11, 2024
9 checks passed
@ekoby ekoby deleted the zitilib-intercept-identity-option branch September 11, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants