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
+12 -11
View File
@@ -36,18 +36,18 @@
#include "tls_test_keys.h"
static int global_port;
static uint16_t global_port;
/* perform a HTTP GET request via SSL/TLS */
static int
static unsigned int
test_secure_get (FILE *test_fd,
const char *cipher_suite,
int proto_version)
{
int ret;
unsigned int ret;
struct MHD_Daemon *d;
int port;
uint16_t port;
if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
port = 0;
@@ -66,7 +66,7 @@ test_secure_get (FILE *test_fd,
if (d == NULL)
{
fprintf (stderr, MHD_E_SERVER_INIT);
return -1;
return 1;
}
if (0 == port)
{
@@ -74,9 +74,10 @@ test_secure_get (FILE *test_fd,
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
MHD_stop_daemon (d);
return 1;
}
port = (int) dinfo->port;
port = dinfo->port;
}
ret = test_https_transfer (test_fd,
@@ -109,7 +110,7 @@ ahc_empty (void *cls,
(void) upload_data;
(void) upload_data_size; /* Unused. Silent compiler warning. */
if (0 != strcmp ("GET",
if (0 != strcmp (MHD_HTTP_METHOD_GET,
method))
return MHD_NO; /* unexpected method */
if (&ptr != *req_cls)
@@ -151,8 +152,8 @@ curlExcessFound (CURL *c,
}
static int
testEmptyGet (int poll_flag)
static unsigned int
testEmptyGet (unsigned int poll_flag)
{
struct MHD_Daemon *d;
CURL *c;
@@ -189,7 +190,7 @@ testEmptyGet (int poll_flag)
{
MHD_stop_daemon (d); return 32;
}
global_port = (int) dinfo->port;
global_port = dinfo->port;
}
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1/");