diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-02-02 07:13:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-02-02 07:13:22 +0000 |
commit | cb9bcba074e24e1e1cfa2b67341a055e1ed2cdb8 (patch) | |
tree | 3ec061833266025211002163db4ad0ab1af3ddbd | |
parent | cdc246a32e3efdf3293e97f833a89d2d517df3ea (diff) | |
download | libmicrohttpd-cb9bcba074e24e1e1cfa2b67341a055e1ed2cdb8.tar.gz libmicrohttpd-cb9bcba074e24e1e1cfa2b67341a055e1ed2cdb8.zip |
fix
-rw-r--r-- | src/testcurl/https/mhds_multi_daemon_test.c | 7 | ||||
-rw-r--r-- | src/testcurl/https/tls_authentication_test.c | 6 | ||||
-rw-r--r-- | src/testcurl/https/tls_daemon_options_test.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/tls_multi_thread_mode_test.c | 18 | ||||
-rw-r--r-- | src/testcurl/https/tls_thread_mode_test.c | 16 |
5 files changed, 31 insertions, 20 deletions
diff --git a/src/testcurl/https/mhds_multi_daemon_test.c b/src/testcurl/https/mhds_multi_daemon_test.c index 69598d8f..6407daf7 100644 --- a/src/testcurl/https/mhds_multi_daemon_test.c +++ b/src/testcurl/https/mhds_multi_daemon_test.c | |||
@@ -160,6 +160,7 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version, | |||
160 | { | 160 | { |
161 | fprintf (stderr, "Error: failed to read test file. %s\n", | 161 | fprintf (stderr, "Error: failed to read test file. %s\n", |
162 | strerror (errno)); | 162 | strerror (errno)); |
163 | free (doc_path); | ||
163 | return -1; | 164 | return -1; |
164 | } | 165 | } |
165 | 166 | ||
@@ -167,6 +168,8 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version, | |||
167 | { | 168 | { |
168 | fprintf (stderr, "Error: failed to read test file. %s\n", | 169 | fprintf (stderr, "Error: failed to read test file. %s\n", |
169 | strerror (errno)); | 170 | strerror (errno)); |
171 | free (mem_test_file_local); | ||
172 | free (doc_path); | ||
170 | return -1; | 173 | return -1; |
171 | } | 174 | } |
172 | cbc.size = len; | 175 | cbc.size = len; |
@@ -206,6 +209,9 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version, | |||
206 | fprintf (stderr, "curl_easy_perform failed: `%s'\n", | 209 | fprintf (stderr, "curl_easy_perform failed: `%s'\n", |
207 | curl_easy_strerror (errornum)); | 210 | curl_easy_strerror (errornum)); |
208 | curl_easy_cleanup (c); | 211 | curl_easy_cleanup (c); |
212 | free (mem_test_file_local); | ||
213 | free (doc_path); | ||
214 | free (cbc.buf); | ||
209 | return errornum; | 215 | return errornum; |
210 | } | 216 | } |
211 | 217 | ||
@@ -261,6 +267,7 @@ test_concurent_daemon_pair (FILE * test_fd, char *cipher_suite, | |||
261 | 267 | ||
262 | if (d2 == NULL) | 268 | if (d2 == NULL) |
263 | { | 269 | { |
270 | MHD_stop_daemon(d1); | ||
264 | fprintf (stderr, MHD_E_SERVER_INIT); | 271 | fprintf (stderr, MHD_E_SERVER_INIT); |
265 | return -1; | 272 | return -1; |
266 | } | 273 | } |
diff --git a/src/testcurl/https/tls_authentication_test.c b/src/testcurl/https/tls_authentication_test.c index 7f576654..6e8cf0af 100644 --- a/src/testcurl/https/tls_authentication_test.c +++ b/src/testcurl/https/tls_authentication_test.c | |||
@@ -284,12 +284,14 @@ setupTestFile () | |||
284 | { | 284 | { |
285 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 285 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
286 | test_file_name, strerror (errno)); | 286 | test_file_name, strerror (errno)); |
287 | fclose (test_fd); | ||
287 | return NULL; | 288 | return NULL; |
288 | } | 289 | } |
289 | if (fflush (test_fd)) | 290 | if (fflush (test_fd)) |
290 | { | 291 | { |
291 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", | 292 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", |
292 | strerror (errno)); | 293 | strerror (errno)); |
294 | fclose (test_fd); | ||
293 | return NULL; | 295 | return NULL; |
294 | } | 296 | } |
295 | 297 | ||
@@ -312,14 +314,14 @@ setup_ca_cert () | |||
312 | { | 314 | { |
313 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 315 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
314 | ca_cert_file_name, strerror (errno)); | 316 | ca_cert_file_name, strerror (errno)); |
315 | fclose (test_fd); | 317 | fclose (fd); |
316 | return NULL; | 318 | return NULL; |
317 | } | 319 | } |
318 | if (fflush (fd)) | 320 | if (fflush (fd)) |
319 | { | 321 | { |
320 | fprintf (stderr, "Error: failed to flush ca cert file stream. %s\n", | 322 | fprintf (stderr, "Error: failed to flush ca cert file stream. %s\n", |
321 | strerror (errno)); | 323 | strerror (errno)); |
322 | fclose (test_fd); | 324 | fclose (fd); |
323 | return NULL; | 325 | return NULL; |
324 | } | 326 | } |
325 | 327 | ||
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c index f24ff4f9..2575c340 100644 --- a/src/testcurl/https/tls_daemon_options_test.c +++ b/src/testcurl/https/tls_daemon_options_test.c | |||
@@ -230,6 +230,9 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
230 | fprintf (stderr, "curl_easy_perform failed: `%s'\n", | 230 | fprintf (stderr, "curl_easy_perform failed: `%s'\n", |
231 | curl_easy_strerror (errornum)); | 231 | curl_easy_strerror (errornum)); |
232 | curl_easy_cleanup (c); | 232 | curl_easy_cleanup (c); |
233 | free (cbc.buf); | ||
234 | free (mem_test_file_local); | ||
235 | free (doc_path); | ||
233 | return errornum; | 236 | return errornum; |
234 | } | 237 | } |
235 | 238 | ||
@@ -240,6 +243,7 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
240 | fprintf (stderr, "Error: local file & received file differ.\n"); | 243 | fprintf (stderr, "Error: local file & received file differ.\n"); |
241 | free (cbc.buf); | 244 | free (cbc.buf); |
242 | free (mem_test_file_local); | 245 | free (mem_test_file_local); |
246 | free (doc_path); | ||
243 | return -1; | 247 | return -1; |
244 | } | 248 | } |
245 | 249 | ||
diff --git a/src/testcurl/https/tls_multi_thread_mode_test.c b/src/testcurl/https/tls_multi_thread_mode_test.c index e0c0a304..eeb5e8a0 100644 --- a/src/testcurl/https/tls_multi_thread_mode_test.c +++ b/src/testcurl/https/tls_multi_thread_mode_test.c | |||
@@ -163,44 +163,39 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; | 163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; |
164 | if (NULL == (doc_path = malloc (doc_path_len))) | 164 | if (NULL == (doc_path = malloc (doc_path_len))) |
165 | { | 165 | { |
166 | fclose (test_fd); | ||
167 | fprintf (stderr, MHD_E_MEM); | 166 | fprintf (stderr, MHD_E_MEM); |
168 | return -1; | 167 | return -1; |
169 | } | 168 | } |
170 | if (getcwd (doc_path, doc_path_len) == NULL) | 169 | if (getcwd (doc_path, doc_path_len) == NULL) |
171 | { | 170 | { |
172 | fclose (test_fd); | ||
173 | free (doc_path); | ||
174 | fprintf (stderr, "Error: failed to get working directory. %s\n", | 171 | fprintf (stderr, "Error: failed to get working directory. %s\n", |
175 | strerror (errno)); | 172 | strerror (errno)); |
173 | free (doc_path); | ||
176 | return -1; | 174 | return -1; |
177 | } | 175 | } |
178 | 176 | ||
179 | if (NULL == (mem_test_file_local = malloc (len))) | 177 | if (NULL == (mem_test_file_local = malloc (len))) |
180 | { | 178 | { |
181 | fclose (test_fd); | ||
182 | free (doc_path); | ||
183 | fprintf (stderr, MHD_E_MEM); | 179 | fprintf (stderr, MHD_E_MEM); |
180 | free (doc_path); | ||
184 | return -1; | 181 | return -1; |
185 | } | 182 | } |
186 | 183 | ||
187 | fseek (test_fd, 0, SEEK_SET); | 184 | fseek (test_fd, 0, SEEK_SET); |
188 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) | 185 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) |
189 | { | 186 | { |
190 | fclose (test_fd); | ||
191 | free (doc_path); | ||
192 | free (mem_test_file_local); | ||
193 | fprintf (stderr, "Error: failed to read test file. %s\n", | 187 | fprintf (stderr, "Error: failed to read test file. %s\n", |
194 | strerror (errno)); | 188 | strerror (errno)); |
189 | free (doc_path); | ||
190 | free (mem_test_file_local); | ||
195 | return -1; | 191 | return -1; |
196 | } | 192 | } |
197 | 193 | ||
198 | if (NULL == (cbc.buf = malloc (len))) | 194 | if (NULL == (cbc.buf = malloc (len))) |
199 | { | 195 | { |
200 | fclose (test_fd); | 196 | fprintf (stderr, MHD_E_MEM); |
201 | free (doc_path); | 197 | free (doc_path); |
202 | free (mem_test_file_local); | 198 | free (mem_test_file_local); |
203 | fprintf (stderr, MHD_E_MEM); | ||
204 | return -1; | 199 | return -1; |
205 | } | 200 | } |
206 | cbc.size = len; | 201 | cbc.size = len; |
@@ -299,12 +294,14 @@ setupTestFile () | |||
299 | { | 294 | { |
300 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 295 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
301 | test_file_name, strerror (errno)); | 296 | test_file_name, strerror (errno)); |
297 | fclose (test_fd); | ||
302 | return NULL; | 298 | return NULL; |
303 | } | 299 | } |
304 | if (fflush (test_fd)) | 300 | if (fflush (test_fd)) |
305 | { | 301 | { |
306 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", | 302 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", |
307 | strerror (errno)); | 303 | strerror (errno)); |
304 | fclose (test_fd); | ||
308 | return NULL; | 305 | return NULL; |
309 | } | 306 | } |
310 | 307 | ||
@@ -453,6 +450,7 @@ main (int argc, char *const *argv) | |||
453 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 450 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
454 | { | 451 | { |
455 | fprintf (stderr, "Error: %s\n", strerror (errno)); | 452 | fprintf (stderr, "Error: %s\n", strerror (errno)); |
453 | fclose (test_fd); | ||
456 | return -1; | 454 | return -1; |
457 | } | 455 | } |
458 | 456 | ||
diff --git a/src/testcurl/https/tls_thread_mode_test.c b/src/testcurl/https/tls_thread_mode_test.c index ed263e3f..24882d95 100644 --- a/src/testcurl/https/tls_thread_mode_test.c +++ b/src/testcurl/https/tls_thread_mode_test.c | |||
@@ -163,40 +163,37 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; | 163 | doc_path_len = PATH_MAX > 4096 ? 4096 : PATH_MAX; |
164 | if (NULL == (doc_path = malloc (doc_path_len))) | 164 | if (NULL == (doc_path = malloc (doc_path_len))) |
165 | { | 165 | { |
166 | fclose (test_fd); | ||
167 | fprintf (stderr, MHD_E_MEM); | 166 | fprintf (stderr, MHD_E_MEM); |
168 | return -1; | 167 | return -1; |
169 | } | 168 | } |
170 | if (getcwd (doc_path, doc_path_len) == NULL) | 169 | if (getcwd (doc_path, doc_path_len) == NULL) |
171 | { | 170 | { |
172 | fclose (test_fd); | ||
173 | free (doc_path); | ||
174 | fprintf (stderr, "Error: failed to get working directory. %s\n", | 171 | fprintf (stderr, "Error: failed to get working directory. %s\n", |
175 | strerror (errno)); | 172 | strerror (errno)); |
173 | free (doc_path); | ||
176 | return -1; | 174 | return -1; |
177 | } | 175 | } |
178 | 176 | ||
179 | if (NULL == (mem_test_file_local = malloc (len))) | 177 | if (NULL == (mem_test_file_local = malloc (len))) |
180 | { | 178 | { |
181 | fclose (test_fd); | ||
182 | free (doc_path); | ||
183 | fprintf (stderr, MHD_E_MEM); | 179 | fprintf (stderr, MHD_E_MEM); |
180 | free (doc_path); | ||
184 | return -1; | 181 | return -1; |
185 | } | 182 | } |
186 | 183 | ||
187 | fseek (test_fd, 0, SEEK_SET); | 184 | fseek (test_fd, 0, SEEK_SET); |
188 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) | 185 | if (fread (mem_test_file_local, sizeof (char), len, test_fd) != len) |
189 | { | 186 | { |
190 | fclose (test_fd); | ||
191 | free (doc_path); | ||
192 | fprintf (stderr, "Error: failed to read test file. %s\n", | 187 | fprintf (stderr, "Error: failed to read test file. %s\n", |
193 | strerror (errno)); | 188 | strerror (errno)); |
189 | fclose (test_fd); | ||
190 | free (doc_path); | ||
191 | free (mem_test_file_local); | ||
194 | return -1; | 192 | return -1; |
195 | } | 193 | } |
196 | 194 | ||
197 | if (NULL == (cbc.buf = malloc (len))) | 195 | if (NULL == (cbc.buf = malloc (len))) |
198 | { | 196 | { |
199 | fclose (test_fd); | ||
200 | free (doc_path); | 197 | free (doc_path); |
201 | free (mem_test_file_local); | 198 | free (mem_test_file_local); |
202 | fprintf (stderr, MHD_E_MEM); | 199 | fprintf (stderr, MHD_E_MEM); |
@@ -298,12 +295,14 @@ setupTestFile () | |||
298 | { | 295 | { |
299 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 296 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
300 | test_file_name, strerror (errno)); | 297 | test_file_name, strerror (errno)); |
298 | fclose (test_fd); | ||
301 | return NULL; | 299 | return NULL; |
302 | } | 300 | } |
303 | if (fflush (test_fd)) | 301 | if (fflush (test_fd)) |
304 | { | 302 | { |
305 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", | 303 | fprintf (stderr, "Error: failed to flush test file stream. %s\n", |
306 | strerror (errno)); | 304 | strerror (errno)); |
305 | fclose (test_fd); | ||
307 | return NULL; | 306 | return NULL; |
308 | } | 307 | } |
309 | 308 | ||
@@ -452,6 +451,7 @@ main (int argc, char *const *argv) | |||
452 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 451 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
453 | { | 452 | { |
454 | fprintf (stderr, "Error: %s\n", strerror (errno)); | 453 | fprintf (stderr, "Error: %s\n", strerror (errno)); |
454 | fclose (test_fd); | ||
455 | return -1; | 455 | return -1; |
456 | } | 456 | } |
457 | 457 | ||