testcurl/https: fixed compiler warnings, wrong types

This commit is contained in:
Evgeny Grin (Karlson2k)
2022-10-05 18:42:19 +03:00
parent c1f7c8075a
commit 28e28436c6
15 changed files with 201 additions and 184 deletions
+11 -11
View File
@@ -54,7 +54,7 @@ https_transfer_thread_adapter (void *args)
{
static int nonnull;
struct https_test_data *cargs = args;
int ret;
unsigned int ret;
/* time spread incoming requests */
usleep ((useconds_t) 10.0 * ((double) rand ()) / ((double) RAND_MAX));
@@ -69,12 +69,12 @@ https_transfer_thread_adapter (void *args)
/**
* Test non-parallel requests.
*
* @return: 0 upon all client requests returning '0', -1 otherwise.
* @return: 0 upon all client requests returning '0', 1 otherwise.
*
* TODO : make client_count a parameter - number of curl client threads to spawn
*/
static int
test_single_client (void *cls, int port, const char *cipher_suite,
static unsigned int
test_single_client (void *cls, uint16_t port, const char *cipher_suite,
int curl_proto_version)
{
void *client_thread_ret;
@@ -84,7 +84,7 @@ test_single_client (void *cls, int port, const char *cipher_suite,
client_thread_ret = https_transfer_thread_adapter (&client_args);
if (client_thread_ret != NULL)
return -1;
return 1;
return 0;
}
@@ -92,12 +92,12 @@ test_single_client (void *cls, int port, const char *cipher_suite,
/**
* Test parallel request handling.
*
* @return: 0 upon all client requests returning '0', -1 otherwise.
* @return: 0 upon all client requests returning '0', 1 otherwise.
*
* TODO : make client_count a parameter - number of curl client threads to spawn
*/
static int
test_parallel_clients (void *cls, int port, const char *cipher_suite,
static unsigned int
test_parallel_clients (void *cls, uint16_t port, const char *cipher_suite,
int curl_proto_version)
{
int i;
@@ -114,7 +114,7 @@ test_parallel_clients (void *cls, int port, const char *cipher_suite,
&https_transfer_thread_adapter, &client_args) != 0)
{
fprintf (stderr, "Error: failed to spawn test client threads.\n");
return -1;
return 1;
}
}
@@ -123,7 +123,7 @@ test_parallel_clients (void *cls, int port, const char *cipher_suite,
{
if ((pthread_join (client_arr[i], &client_thread_ret) != 0) ||
(client_thread_ret != NULL))
return -1;
return 1;
}
return 0;
@@ -135,7 +135,7 @@ main (int argc, char *const *argv)
{
unsigned int errorCount = 0;
const char *aes256_sha = "AES256-SHA";
int port;
uint16_t port;
unsigned int iseed;
(void) argc; /* Unused. Silent compiler warning. */