aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/https/test_https_multi_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/https/test_https_multi_daemon.c')
-rw-r--r--src/testcurl/https/test_https_multi_daemon.c42
1 files changed, 36 insertions, 6 deletions
diff --git a/src/testcurl/https/test_https_multi_daemon.c b/src/testcurl/https/test_https_multi_daemon.c
index 8ffef656..b7b9b065 100644
--- a/src/testcurl/https/test_https_multi_daemon.c
+++ b/src/testcurl/https/test_https_multi_daemon.c
@@ -47,12 +47,12 @@ test_concurent_daemon_pair (void *cls,
47 int proto_version) 47 int proto_version)
48{ 48{
49 unsigned int ret; 49 unsigned int ret;
50 enum test_get_result res;
50 struct MHD_Daemon *d1; 51 struct MHD_Daemon *d1;
51 struct MHD_Daemon *d2; 52 struct MHD_Daemon *d2;
52 uint16_t port1, port2; 53 uint16_t port1, port2;
53 (void) cls; /* Unused. Silent compiler warning. */ 54 (void) cls; /* Unused. Silent compiler warning. */
54 55
55
56 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) 56 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
57 port1 = port2 = 0; 57 port1 = port2 = 0;
58 else 58 else
@@ -115,15 +115,42 @@ test_concurent_daemon_pair (void *cls,
115 port2 = (int) dinfo->port; 115 port2 = (int) dinfo->port;
116 } 116 }
117 117
118 ret = 118 res =
119 test_daemon_get (NULL, cipher_suite, proto_version, port1, 0); 119 test_daemon_get (NULL, cipher_suite, proto_version, port1, 0);
120 ret += 120 ret = (unsigned int) res;
121 if ((TEST_GET_HARD_ERROR == res) ||
122 (TEST_GET_CURL_GEN_ERROR == res))
123 {
124 fprintf (stderr, "libcurl error.\nTest aborted.\n");
125 MHD_stop_daemon (d2);
126 MHD_stop_daemon (d1);
127 return 99;
128 }
129
130 res =
121 test_daemon_get (NULL, cipher_suite, proto_version, 131 test_daemon_get (NULL, cipher_suite, proto_version,
122 port2, 0); 132 port2, 0);
133 ret += (unsigned int) res;
134 if ((TEST_GET_HARD_ERROR == res) ||
135 (TEST_GET_CURL_GEN_ERROR == res))
136 {
137 fprintf (stderr, "libcurl error.\nTest aborted.\n");
138 MHD_stop_daemon (d2);
139 MHD_stop_daemon (d1);
140 return 99;
141 }
123 142
124 MHD_stop_daemon (d2); 143 MHD_stop_daemon (d2);
125 ret += 144 res =
126 test_daemon_get (NULL, cipher_suite, proto_version, port1, 0); 145 test_daemon_get (NULL, cipher_suite, proto_version, port1, 0);
146 ret += (unsigned int) res;
147 if ((TEST_GET_HARD_ERROR == res) ||
148 (TEST_GET_CURL_GEN_ERROR == res))
149 {
150 fprintf (stderr, "libcurl error.\nTest aborted.\n");
151 MHD_stop_daemon (d1);
152 return 99;
153 }
127 MHD_stop_daemon (d1); 154 MHD_stop_daemon (d1);
128 return ret; 155 return ret;
129} 156}
@@ -132,7 +159,7 @@ test_concurent_daemon_pair (void *cls,
132int 159int
133main (int argc, char *const *argv) 160main (int argc, char *const *argv)
134{ 161{
135 unsigned int errorCount = 0; 162 unsigned int errorCount;
136 (void) argc; (void) argv; /* Unused. Silent compiler warning. */ 163 (void) argc; (void) argv; /* Unused. Silent compiler warning. */
137 164
138#ifdef MHD_HTTPS_REQUIRE_GCRYPT 165#ifdef MHD_HTTPS_REQUIRE_GCRYPT
@@ -150,11 +177,14 @@ main (int argc, char *const *argv)
150 return 77; 177 return 77;
151 } 178 }
152 179
153 errorCount += 180 errorCount =
154 test_concurent_daemon_pair (NULL, NULL, CURL_SSLVERSION_DEFAULT); 181 test_concurent_daemon_pair (NULL, NULL, CURL_SSLVERSION_DEFAULT);
155 182
156 print_test_result (errorCount, "concurent_daemon_pair"); 183 print_test_result (errorCount, "concurent_daemon_pair");
157 184
158 curl_global_cleanup (); 185 curl_global_cleanup ();
186 if (99 == errorCount)
187 return 99;
188
159 return errorCount != 0 ? 1 : 0; 189 return errorCount != 0 ? 1 : 0;
160} 190}