aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/test_upgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/test_upgrade.c')
-rw-r--r--src/microhttpd/test_upgrade.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index 68598723..fa91f7dc 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -174,6 +174,8 @@ fflush_allstd (void)
174 174
175static int verbose = 0; 175static int verbose = 0;
176 176
177static uint16_t global_port;
178
177enum tls_tool 179enum tls_tool
178{ 180{
179 TLS_CLI_NO_TOOL = 0, 181 TLS_CLI_NO_TOOL = 0,
@@ -1265,9 +1267,7 @@ test_upgrade (int flags,
1265 1267
1266 if (! test_tls) 1268 if (! test_tls)
1267 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE, 1269 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE,
1268 MHD_is_feature_supported ( 1270 global_port,
1269 MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1270 0 : 1090,
1271 NULL, NULL, 1271 NULL, NULL,
1272 &ahc_upgrade, NULL, 1272 &ahc_upgrade, NULL,
1273 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 1273 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -1281,9 +1281,7 @@ test_upgrade (int flags,
1281 else 1281 else
1282 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE 1282 d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE
1283 | MHD_USE_TLS, 1283 | MHD_USE_TLS,
1284 MHD_is_feature_supported ( 1284 global_port,
1285 MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1286 0 : 1090,
1287 NULL, NULL, 1285 NULL, NULL,
1288 &ahc_upgrade, NULL, 1286 &ahc_upgrade, NULL,
1289 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, 1287 MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
@@ -1307,6 +1305,7 @@ test_upgrade (int flags,
1307 if ( (NULL == dinfo) || 1305 if ( (NULL == dinfo) ||
1308 (0 == dinfo->port) ) 1306 (0 == dinfo->port) )
1309 mhdErrorExitDesc ("MHD_get_daemon_info() failed"); 1307 mhdErrorExitDesc ("MHD_get_daemon_info() failed");
1308 global_port = dinfo->port; /* Re-use the same port for the next checks */
1310 if (! test_tls || (TLS_LIB_GNUTLS == use_tls_tool)) 1309 if (! test_tls || (TLS_LIB_GNUTLS == use_tls_tool))
1311 { 1310 {
1312 sock = test_tls ? wr_create_tls_sckt () : wr_create_plain_sckt (); 1311 sock = test_tls ? wr_create_tls_sckt () : wr_create_plain_sckt ();
@@ -1434,6 +1433,9 @@ main (int argc,
1434#endif /* ! HTTPS_SUPPORT */ 1433#endif /* ! HTTPS_SUPPORT */
1435 } 1434 }
1436 1435
1436 global_port = MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT) ?
1437 0 : (test_tls ? 1091 : 1090);
1438
1437 /* run tests */ 1439 /* run tests */
1438 if (verbose) 1440 if (verbose)
1439 printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n", 1441 printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n",