mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
applying uncrustify to ensure uniform indentation
This commit is contained in:
@@ -43,70 +43,74 @@ extern const char srv_self_signed_cert_pem[];
|
||||
*/
|
||||
static int
|
||||
test_concurent_daemon_pair (void *cls,
|
||||
const char *cipher_suite,
|
||||
const char *cipher_suite,
|
||||
int proto_version)
|
||||
{
|
||||
int ret;
|
||||
struct MHD_Daemon *d1;
|
||||
struct MHD_Daemon *d2;
|
||||
int port1, port2;
|
||||
(void)cls; /* Unused. Silent compiler warning. */
|
||||
(void) cls; /* Unused. Silent compiler warning. */
|
||||
|
||||
|
||||
if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
|
||||
port1 = port2 = 0;
|
||||
else
|
||||
{
|
||||
port1 = 3050;
|
||||
port2 = 3051;
|
||||
}
|
||||
{
|
||||
port1 = 3050;
|
||||
port2 = 3051;
|
||||
}
|
||||
|
||||
d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
|
||||
MHD_USE_ERROR_LOG, port1,
|
||||
d1 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
|
||||
| MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
|
||||
| MHD_USE_ERROR_LOG, port1,
|
||||
NULL, NULL, &http_ahc, NULL,
|
||||
MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
|
||||
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
|
||||
MHD_OPTION_END);
|
||||
|
||||
if (d1 == NULL)
|
||||
{
|
||||
fprintf (stderr, MHD_E_SERVER_INIT);
|
||||
return -1;
|
||||
}
|
||||
{
|
||||
fprintf (stderr, MHD_E_SERVER_INIT);
|
||||
return -1;
|
||||
}
|
||||
if (0 == port1)
|
||||
{
|
||||
const union MHD_DaemonInfo *dinfo;
|
||||
dinfo = MHD_get_daemon_info (d1, MHD_DAEMON_INFO_BIND_PORT);
|
||||
if ((NULL == dinfo) ||(0 == dinfo->port) )
|
||||
{
|
||||
const union MHD_DaemonInfo *dinfo;
|
||||
dinfo = MHD_get_daemon_info (d1, MHD_DAEMON_INFO_BIND_PORT);
|
||||
if (NULL == dinfo || 0 == dinfo->port)
|
||||
{ MHD_stop_daemon (d1); return -1; }
|
||||
port1 = (int)dinfo->port;
|
||||
MHD_stop_daemon (d1); return -1;
|
||||
}
|
||||
port1 = (int) dinfo->port;
|
||||
}
|
||||
|
||||
d2 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS |
|
||||
MHD_USE_ERROR_LOG, port2,
|
||||
d2 = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION
|
||||
| MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
|
||||
| MHD_USE_ERROR_LOG, port2,
|
||||
NULL, NULL, &http_ahc, NULL,
|
||||
MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
|
||||
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
|
||||
MHD_OPTION_END);
|
||||
|
||||
if (d2 == NULL)
|
||||
{
|
||||
MHD_stop_daemon (d1);
|
||||
fprintf (stderr, MHD_E_SERVER_INIT);
|
||||
return -1;
|
||||
}
|
||||
if (0 == port2)
|
||||
{
|
||||
const union MHD_DaemonInfo *dinfo;
|
||||
dinfo = MHD_get_daemon_info (d2, MHD_DAEMON_INFO_BIND_PORT);
|
||||
if ((NULL == dinfo) ||(0 == dinfo->port) )
|
||||
{
|
||||
MHD_stop_daemon (d1);
|
||||
fprintf (stderr, MHD_E_SERVER_INIT);
|
||||
MHD_stop_daemon (d2);
|
||||
return -1;
|
||||
}
|
||||
if (0 == port2)
|
||||
{
|
||||
const union MHD_DaemonInfo *dinfo;
|
||||
dinfo = MHD_get_daemon_info (d2, MHD_DAEMON_INFO_BIND_PORT);
|
||||
if (NULL == dinfo || 0 == dinfo->port)
|
||||
{
|
||||
MHD_stop_daemon (d1);
|
||||
MHD_stop_daemon (d2);
|
||||
return -1;
|
||||
}
|
||||
port2 = (int)dinfo->port;
|
||||
}
|
||||
port2 = (int) dinfo->port;
|
||||
}
|
||||
|
||||
ret =
|
||||
test_daemon_get (NULL, cipher_suite, proto_version, port1, 0);
|
||||
@@ -128,7 +132,7 @@ main (int argc, char *const *argv)
|
||||
unsigned int errorCount = 0;
|
||||
FILE *cert;
|
||||
const char *aes256_sha = "AES256-SHA";
|
||||
(void)argc; (void)argv; /* Unused. Silent compiler warning. */
|
||||
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
|
||||
|
||||
#ifdef MHD_HTTPS_REQUIRE_GRYPT
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
@@ -136,25 +140,25 @@ main (int argc, char *const *argv)
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
|
||||
if (!testsuite_curl_global_init ())
|
||||
if (! testsuite_curl_global_init ())
|
||||
return 99;
|
||||
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
|
||||
{
|
||||
fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
|
||||
curl_global_cleanup ();
|
||||
return 77;
|
||||
}
|
||||
{
|
||||
fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
|
||||
curl_global_cleanup ();
|
||||
return 77;
|
||||
}
|
||||
if ((cert = setup_ca_cert ()) == NULL)
|
||||
{
|
||||
fprintf (stderr, MHD_E_TEST_FILE_CREAT);
|
||||
curl_global_cleanup ();
|
||||
return 99;
|
||||
}
|
||||
{
|
||||
fprintf (stderr, MHD_E_TEST_FILE_CREAT);
|
||||
curl_global_cleanup ();
|
||||
return 99;
|
||||
}
|
||||
|
||||
if (curl_uses_nss_ssl() == 0)
|
||||
{
|
||||
aes256_sha = "rsa_aes_256_sha";
|
||||
}
|
||||
if (curl_uses_nss_ssl () == 0)
|
||||
{
|
||||
aes256_sha = "rsa_aes_256_sha";
|
||||
}
|
||||
|
||||
errorCount +=
|
||||
test_concurent_daemon_pair (NULL, aes256_sha, CURL_SSLVERSION_TLSv1);
|
||||
@@ -165,7 +169,7 @@ main (int argc, char *const *argv)
|
||||
fclose (cert);
|
||||
if (0 != remove (ca_cert_file_name))
|
||||
fprintf (stderr,
|
||||
"Failed to remove `%s'\n",
|
||||
ca_cert_file_name);
|
||||
"Failed to remove `%s'\n",
|
||||
ca_cert_file_name);
|
||||
return errorCount != 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user