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

rollback tlsuv update for now #583

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else ()

FetchContent_Declare(tlsuv
GIT_REPOSITORY https://github.com/openziti/tlsuv.git
GIT_TAG v0.27.2
GIT_TAG v0.26.1
)
FetchContent_MakeAvailable(tlsuv)

Expand Down
6 changes: 3 additions & 3 deletions library/ziti_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
return ZITI_WTF;
}

#define CTRL_LOG(lvl, fmt, ...) ZITI_LOG(lvl, "ctrl[%s] " fmt, ctrl->client->host, ##__VA_ARGS__)

Check warning on line 93 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM

format '%ld' expects argument of type 'long int', but argument 10 has type 'uint64_t ***aka long long unsigned int***' [-Wformat=]

Check warning on line 93 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM

format '%ld' expects argument of type 'long int', but argument 11 has type 'uint64_t ***aka long long unsigned int***' [-Wformat=]

#define MAKE_RESP(ctrl, cb, parser, ctx) prepare_resp(ctrl, (ctrl_resp_cb_t)(cb), (body_parse_fn)(parser), ctx)

Expand Down Expand Up @@ -132,7 +132,7 @@

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, char *b, ssize_t len);
static void ctrl_body_cb(tlsuv_http_req_t *req, const 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 @@
free(services);
}

static void free_body_cb(tlsuv_http_req_t *req, char *body, ssize_t len) {
static void free_body_cb(tlsuv_http_req_t *req, const char *body, ssize_t len) {
free((char *) body);
}

static void ctrl_body_cb(tlsuv_http_req_t *req, char *b, ssize_t len) {
static void ctrl_body_cb(tlsuv_http_req_t *req, const char *b, ssize_t len) {
struct ctrl_resp *resp = req->data;
ziti_controller *ctrl = resp->ctrl;

Expand Down Expand Up @@ -326,7 +326,7 @@
uv_timeval64_t now;
uv_gettimeofday(&now);
uint64_t elapsed = (now.tv_sec * 1000000 + now.tv_usec) - (resp->start.tv_sec * 1000000 + resp->start.tv_usec);
CTRL_LOG(DEBUG, "completed %s[%s] in %ld.%03ld s", req->method, req->path, elapsed / 1000000, (elapsed / 1000) % 1000);

Check warning on line 329 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 329 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 329 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 329 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]
if (resp->paging) {
bool last_page = cr.meta.pagination.total <= cr.meta.pagination.offset + cr.meta.pagination.limit;
if (cr.meta.pagination.total > resp->total) {
Expand Down Expand Up @@ -354,7 +354,7 @@
return;
}
elapsed = (now.tv_sec * 1000000 + now.tv_usec) - (resp->all_start.tv_sec * 1000000 + resp->all_start.tv_usec);
CTRL_LOG(DEBUG, "completed paging request GET[%s] in %ld.%03ld s", resp->base_path, elapsed / 1000000, (elapsed / 1000) % 1000);

Check warning on line 357 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 357 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 357 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]

Check warning on line 357 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]
resp_obj = resp->resp_array;
}
}
Expand Down Expand Up @@ -487,8 +487,8 @@
CTRL_LOG(WARN, "no API session");
ziti_error err = {
.err = ZITI_AUTHENTICATION_FAILED,
.code = ERROR_CODE_UNAUTHORIZED,

Check warning on line 490 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 490 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 490 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS arm64

initializing 'string' (aka 'char *') with an expression of type 'const char *const' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]

Check warning on line 490 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

initializing 'string' (aka 'char *') with an expression of type 'const char *const' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
.message = ERROR_MSG_NO_API_SESSION_TOKEN,

Check warning on line 491 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 491 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 491 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / MacOS x86_64

initializing 'string' (aka 'char *') with an expression of type 'const char *const' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
};
cb(NULL, &err, ctx);
return false;
Expand Down Expand Up @@ -649,7 +649,7 @@
} else {
tlsuv_http_req_header(req, "Content-Type", "application/json");
if (name != NULL) {
ziti_identity id = {.name = name};

Check warning on line 652 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 652 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
size_t body_len;
char *body = ziti_identity_to_json(&id, MODEL_JSON_COMPACT, &body_len);
tlsuv_http_req_data(req, body, body_len, free_body_cb);
Expand Down Expand Up @@ -780,7 +780,7 @@
snprintf(path, sizeof(path), "/current-identity/authenticators/%s/extend", authenticatorId);

ziti_extend_cert_authenticator_req extend_req;
extend_req.client_cert_csr = csr;

Check warning on line 783 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 783 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

size_t body_len;
char *body = ziti_extend_cert_authenticator_req_to_json(&extend_req, 0, &body_len);
Expand All @@ -799,7 +799,7 @@
snprintf(path, sizeof(path), "/current-identity/authenticators/%s/extend-verify", authenticatorId);

ziti_verify_extend_cert_authenticator_req verify_req;
verify_req.client_cert = client_cert;

Check warning on line 802 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Check warning on line 802 in library/ziti_ctrl.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

size_t body_len;
char *body = ziti_verify_extend_cert_authenticator_req_to_json(&verify_req, 0, &body_len);
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, char *body, ssize_t len) {
void body_cb(tlsuv_http_req_t *req, const 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, char *body, ssize_t len){
resp->body_cb = [](tlsuv_http_req_t *req, const char *body, ssize_t len){
auto t = (source_test*)req->data;
if (len > 0)
t->body.append(body, len);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
]
}
},
"builtin-baseline": "8eb57355a4ffb410a2e94c07b4dca2dffbee8e50"
"builtin-baseline": "f6a5d4e8eb7476b8d7fc12a56dff300c1c986131"
}
Loading