Skip to content
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
14 changes: 7 additions & 7 deletions tests/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ do_read(struct conndata *conn, struct rustls_connection *rconn)
signed_n = read(conn->fd, buf, sizeof(buf));
if(signed_n > 0) {
fprintf(stderr,
"client: error: read returned %ld bytes after receiving close_notify\n",
"client: error: read returned %zu bytes after receiving close_notify\n",
n);
return CRUSTLS_DEMO_ERROR;
}
Expand Down Expand Up @@ -237,7 +237,7 @@ send_request_and_read_response(struct conndata *conn,
body = body_beginning(&conn->data);
if(body != NULL) {
headers_len = body - conn->data.data;
fprintf(stderr, "client: body began at %ld\n", headers_len);
fprintf(stderr, "client: body began at %zu\n", headers_len);
content_length_str = get_first_header_value(conn->data.data,
headers_len,
CONTENT_LENGTH,
Expand All @@ -256,7 +256,7 @@ send_request_and_read_response(struct conndata *conn,
content_length_str);
goto cleanup;
}
fprintf(stderr, "client: content length %ld\n", content_length);
fprintf(stderr, "client: content length %lu\n", content_length);
}
}
if(headers_len != 0 &&
Expand Down Expand Up @@ -294,7 +294,7 @@ send_request_and_read_response(struct conndata *conn,
if(result != CRUSTLS_DEMO_OK && result != CRUSTLS_DEMO_EOF) {
goto cleanup;
}
fprintf(stderr, "client: writing %ld bytes to stdout\n", conn->data.len);
fprintf(stderr, "client: writing %zu bytes to stdout\n", conn->data.len);
if(write(STDOUT_FILENO, conn->data.data, conn->data.len) < 0) {
fprintf(stderr, "error writing to stderr\n");
goto cleanup;
Expand Down Expand Up @@ -375,15 +375,15 @@ verify(void *userdata, const rustls_verify_server_cert_params *params)
"client: custom certificate verifier called for %.*s\n",
(int)params->dns_name.len,
params->dns_name.data);
fprintf(stderr, "client: end entity len: %ld\n", params->end_entity_cert_der.len);
fprintf(stderr, "client: end entity len: %zu\n", params->end_entity_cert_der.len);
fprintf(stderr, "client: intermediates:\n");
for(i = 0; i < intermediates_len; i++) {
bytes = rustls_slice_slice_bytes_get(intermediates, i);
if(bytes.data != NULL) {
fprintf(stderr, "client: intermediate, len = %ld\n", bytes.len);
fprintf(stderr, "client: intermediate, len = %zu\n", bytes.len);
}
}
fprintf(stderr, "client: ocsp response len: %ld\n", params->ocsp_response.len);
fprintf(stderr, "client: ocsp response len: %zu\n", params->ocsp_response.len);
if(0 != strcmp(conn->verify_arg, "verify_arg")) {
fprintf(stderr, "client: invalid argument to verify: %p\n", userdata);
return RUSTLS_RESULT_GENERAL;
Expand Down
2 changes: 1 addition & 1 deletion tests/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ bytevec_ensure_available(struct bytevec *vec, size_t n)
}
newdata = realloc(vec->data, newsize);
if(newdata == NULL) {
fprintf(stderr, "out of memory trying to get %ld bytes\n", newsize);
fprintf(stderr, "out of memory trying to get %zu bytes\n", newsize);
return CRUSTLS_DEMO_ERROR;
}
vec->data = newdata;
Expand Down
6 changes: 3 additions & 3 deletions tests/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ do_read(struct conndata *conn, struct rustls_connection *rconn)
if(n == 0) {
return CRUSTLS_DEMO_EOF;
}
fprintf(stderr, "server: read %ld bytes from socket\n", n);
fprintf(stderr, "server: read %zu bytes from socket\n", n);

result = rustls_connection_process_new_packets(rconn);
if(result != RUSTLS_RESULT_OK) {
Expand All @@ -105,7 +105,7 @@ do_read(struct conndata *conn, struct rustls_connection *rconn)
signed_n = read(conn->fd, buf, sizeof(buf));
if(signed_n > 0) {
fprintf(stderr,
"server: error: read returned %ld bytes after receiving close_notify\n",
"server: error: read returned %zu bytes after receiving close_notify\n",
n);
return CRUSTLS_DEMO_ERROR;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ send_response(struct conndata *conn)

free(response);
if(n != response_size) {
fprintf(stderr, "server: failed to write all response bytes. wrote %ld\n", n);
fprintf(stderr, "server: failed to write all response bytes. wrote %zu\n", n);
return CRUSTLS_DEMO_ERROR;
}
return CRUSTLS_DEMO_OK;
Expand Down