diff options
Diffstat (limited to 'src/microhttpd/test_upgrade.c')
-rw-r--r-- | src/microhttpd/test_upgrade.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c index acaecf9f..d4b97718 100644 --- a/src/microhttpd/test_upgrade.c +++ b/src/microhttpd/test_upgrade.c | |||
@@ -1257,7 +1257,7 @@ test_upgrade (int flags, | |||
1257 | struct MHD_Daemon *d = NULL; | 1257 | struct MHD_Daemon *d = NULL; |
1258 | struct wr_socket *sock; | 1258 | struct wr_socket *sock; |
1259 | struct sockaddr_in sa; | 1259 | struct sockaddr_in sa; |
1260 | const union MHD_DaemonInfo *real_flags; | 1260 | enum MHD_FLAG used_flags; |
1261 | const union MHD_DaemonInfo *dinfo; | 1261 | const union MHD_DaemonInfo *dinfo; |
1262 | #if defined(HTTPS_SUPPORT) && defined(HAVE_FORK) && defined(HAVE_WAITPID) | 1262 | #if defined(HTTPS_SUPPORT) && defined(HAVE_FORK) && defined(HAVE_WAITPID) |
1263 | pid_t pid = -1; | 1263 | pid_t pid = -1; |
@@ -1296,10 +1296,11 @@ test_upgrade (int flags, | |||
1296 | #endif /* HTTPS_SUPPORT */ | 1296 | #endif /* HTTPS_SUPPORT */ |
1297 | if (NULL == d) | 1297 | if (NULL == d) |
1298 | mhdErrorExitDesc ("MHD_start_daemon() failed"); | 1298 | mhdErrorExitDesc ("MHD_start_daemon() failed"); |
1299 | real_flags = MHD_get_daemon_info (d, | 1299 | dinfo = MHD_get_daemon_info (d, |
1300 | MHD_DAEMON_INFO_FLAGS); | 1300 | MHD_DAEMON_INFO_FLAGS); |
1301 | if (NULL == real_flags) | 1301 | if (NULL == dinfo) |
1302 | mhdErrorExitDesc ("MHD_get_daemon_info() failed"); | 1302 | mhdErrorExitDesc ("MHD_get_daemon_info() failed"); |
1303 | used_flags = dinfo->flags; | ||
1303 | dinfo = MHD_get_daemon_info (d, | 1304 | dinfo = MHD_get_daemon_info (d, |
1304 | MHD_DAEMON_INFO_BIND_PORT); | 1305 | MHD_DAEMON_INFO_BIND_PORT); |
1305 | if ( (NULL == dinfo) || | 1306 | if ( (NULL == dinfo) || |
@@ -1347,15 +1348,7 @@ test_upgrade (int flags, | |||
1347 | sock)) | 1348 | sock)) |
1348 | externalErrorExitDesc ("pthread_create() failed"); | 1349 | externalErrorExitDesc ("pthread_create() failed"); |
1349 | if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) ) | 1350 | if (0 == (flags & MHD_USE_INTERNAL_POLLING_THREAD) ) |
1350 | { | ||
1351 | enum MHD_FLAG used_flags; | ||
1352 | |||
1353 | /* make address sanitizer happy */ | ||
1354 | memcpy (&used_flags, | ||
1355 | real_flags /* ->flags */, | ||
1356 | sizeof (used_flags)); | ||
1357 | run_mhd_loop (d, used_flags); | 1351 | run_mhd_loop (d, used_flags); |
1358 | } | ||
1359 | if (0 != pthread_join (pt_client, | 1352 | if (0 != pthread_join (pt_client, |
1360 | NULL)) | 1353 | NULL)) |
1361 | externalErrorExitDesc ("pthread_join() failed"); | 1354 | externalErrorExitDesc ("pthread_join() failed"); |