aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/test_upgrade_large.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/test_upgrade_large.c')
-rw-r--r--src/microhttpd/test_upgrade_large.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/microhttpd/test_upgrade_large.c b/src/microhttpd/test_upgrade_large.c
index 7c1032cf..3ccb1985 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -338,6 +338,8 @@ fflush_allstd (void)
338 338
339static int verbose = 0; 339static int verbose = 0;
340 340
341static uint16_t global_port;
342
341static struct MHD_itc_ kicker = MHD_ITC_STATIC_INIT_INVALID; 343static struct MHD_itc_ kicker = MHD_ITC_STATIC_INIT_INVALID;
342 344
343enum tls_tool 345enum tls_tool
@@ -1453,9 +1455,7 @@ test_upgrade (int flags,
1453 1455
1454 if (! test_tls) 1456 if (! test_tls)
1455 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE, 1457 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE,
1456 MHD_is_feature_supported ( 1458 global_port,
1457 MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1458 0 : 1090,
1459 NULL, NULL, 1459 NULL, NULL,
1460 &ahc_upgrade, NULL, 1460 &ahc_upgrade, NULL,
1461 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) 512, 1461 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) 512,
@@ -1470,9 +1470,7 @@ test_upgrade (int flags,
1470 else 1470 else
1471 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE 1471 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE
1472 | MHD_USE_TLS, 1472 | MHD_USE_TLS,
1473 MHD_is_feature_supported ( 1473 global_port,
1474 MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1475 0 : 1090,
1476 NULL, NULL, 1474 NULL, NULL,
1477 &ahc_upgrade, NULL, 1475 &ahc_upgrade, NULL,
1478 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) 512, 1476 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) 512,
@@ -1497,6 +1495,7 @@ test_upgrade (int flags,
1497 if ( (NULL == dinfo) || 1495 if ( (NULL == dinfo) ||
1498 (0 == dinfo->port) ) 1496 (0 == dinfo->port) )
1499 mhdErrorExitDesc ("MHD_get_daemon_info() failed"); 1497 mhdErrorExitDesc ("MHD_get_daemon_info() failed");
1498 global_port = dinfo->port; /* Re-use the same port for the next checks */
1500 if (! test_tls || (TLS_LIB_GNUTLS == use_tls_tool)) 1499 if (! test_tls || (TLS_LIB_GNUTLS == use_tls_tool))
1501 { 1500 {
1502 sock = test_tls ? wr_create_tls_sckt () : wr_create_plain_sckt (); 1501 sock = test_tls ? wr_create_tls_sckt () : wr_create_plain_sckt ();
@@ -1634,6 +1633,9 @@ main (int argc,
1634#endif /* ! HTTPS_SUPPORT */ 1633#endif /* ! HTTPS_SUPPORT */
1635 } 1634 }
1636 1635
1636 global_port = MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1637 0 : (test_tls ? 1093 : 1092);
1638
1637 /* run tests */ 1639 /* run tests */
1638 if (verbose) 1640 if (verbose)
1639 printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n", 1641 printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n",