diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-03-17 07:34:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-03-17 07:34:32 +0000 |
commit | e9128f7887291e9239e380d250960580463d157b (patch) | |
tree | abc2a8b962d9016b49fe3de9596e45b7859ed917 /src/testcurl/https/tls_test_common.c | |
parent | d2630b7e6970c4a67c4e914e4f426f7da0f51c29 (diff) | |
download | libmicrohttpd-e9128f7887291e9239e380d250960580463d157b.tar.gz libmicrohttpd-e9128f7887291e9239e380d250960580463d157b.zip |
various bugfixes and docu updates
Diffstat (limited to 'src/testcurl/https/tls_test_common.c')
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index a960b086..97d7a4ba 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -189,7 +189,7 @@ gen_test_file_url (char *url, int port) | |||
189 | if (NULL == (doc_path = malloc (doc_path_len))) | 189 | if (NULL == (doc_path = malloc (doc_path_len))) |
190 | { | 190 | { |
191 | fprintf (stderr, MHD_E_MEM); | 191 | fprintf (stderr, MHD_E_MEM); |
192 | ret = -1; | 192 | return -1; |
193 | } | 193 | } |
194 | if (getcwd (doc_path, doc_path_len) == NULL) | 194 | if (getcwd (doc_path, doc_path_len) == NULL) |
195 | { | 195 | { |
@@ -220,9 +220,14 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
220 | /* used to memcmp local copy & deamon supplied copy */ | 220 | /* used to memcmp local copy & deamon supplied copy */ |
221 | unsigned char *mem_test_file_local; | 221 | unsigned char *mem_test_file_local; |
222 | 222 | ||
223 | stat (TEST_FILE_NAME, &statb); | 223 | if (0 != stat (TEST_FILE_NAME, &statb)) |
224 | { | ||
225 | fprintf (stderr, "Failed to stat `%s': %s\n", | ||
226 | TEST_FILE_NAME, strerror(errno)); | ||
227 | return -1; | ||
228 | } | ||
224 | len = statb.st_size; | 229 | len = statb.st_size; |
225 | 230 | cbc.buf = NULL; | |
226 | if (NULL == (mem_test_file_local = malloc (len))) | 231 | if (NULL == (mem_test_file_local = malloc (len))) |
227 | { | 232 | { |
228 | fprintf (stderr, MHD_E_MEM); | 233 | fprintf (stderr, MHD_E_MEM); |
@@ -269,7 +274,8 @@ test_https_transfer (FILE * test_fd, char *cipher_suite, int proto_version) | |||
269 | 274 | ||
270 | cleanup: | 275 | cleanup: |
271 | free (mem_test_file_local); | 276 | free (mem_test_file_local); |
272 | free (cbc.buf); | 277 | if (cbc.buf != NULL) |
278 | free (cbc.buf); | ||
273 | return ret; | 279 | return ret; |
274 | } | 280 | } |
275 | 281 | ||
@@ -341,7 +347,7 @@ setup_session (MHD_gtls_session_t * session, | |||
341 | MHD_gnutls_datum_t * cert, MHD_gtls_cert_credentials_t * xcred) | 347 | MHD_gnutls_datum_t * cert, MHD_gtls_cert_credentials_t * xcred) |
342 | { | 348 | { |
343 | int ret; | 349 | int ret; |
344 | const char **err_pos; | 350 | const char *err_pos; |
345 | 351 | ||
346 | MHD__gnutls_certificate_allocate_credentials (xcred); | 352 | MHD__gnutls_certificate_allocate_credentials (xcred); |
347 | 353 | ||
@@ -353,7 +359,7 @@ setup_session (MHD_gtls_session_t * session, | |||
353 | GNUTLS_X509_FMT_PEM); | 359 | GNUTLS_X509_FMT_PEM); |
354 | 360 | ||
355 | MHD__gnutls_init (session, GNUTLS_CLIENT); | 361 | MHD__gnutls_init (session, GNUTLS_CLIENT); |
356 | ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", err_pos); | 362 | ret = MHD__gnutls_priority_set_direct (*session, "NORMAL", &err_pos); |
357 | if (ret < 0) | 363 | if (ret < 0) |
358 | { | 364 | { |
359 | return -1; | 365 | return -1; |