Cleanup mttest.c : do not try to output reference counts when threads are done
[openssl.git] / crypto / threads / mttest.c
index 01b587880b5f86ecb7a1851ed25bd008364ebd77..7bb431778fa088375176ae2d59b55023228fdfe9 100644 (file)
@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
     SSL_CTX *c_ctx = NULL;
     char *scert = TEST_SERVER_CERT;
     char *ccert = TEST_CLIENT_CERT;
-    SSL_METHOD *ssl_method = TLS_method();
+    const SSL_METHOD *ssl_method = TLS_method();
 
     RAND_seed(rnd_seed, sizeof rnd_seed);
 
@@ -276,9 +276,12 @@ int main(int argc, char *argv[])
                                    SSL_SESS_CACHE_SERVER);
 
     if (!SSL_CTX_use_certificate_file(s_ctx, scert, SSL_FILETYPE_PEM)) {
+        BIO_printf(bio_err, "SSL_CTX_use_certificate_file (%s)\n", scert);
         ERR_print_errors(bio_err);
+        goto end;
     } else
         if (!SSL_CTX_use_RSAPrivateKey_file(s_ctx, scert, SSL_FILETYPE_PEM)) {
+        BIO_printf(bio_err, "SSL_CTX_use_RSAPrivateKey_file (%s)\n", scert);
         ERR_print_errors(bio_err);
         goto end;
     }
@@ -800,8 +803,12 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
         thr_join(thread_ctx[i], NULL, NULL);
     }
 
+#if 0 /* We can't currently find out the reference amount */
     BIO_printf(bio_stdout, "solaris threads done (%d,%d)\n",
                s_ctx->references, c_ctx->references);
+#else
+    BIO_printf(bio_stdout, "solaris threads done\n");
+#endif
 }
 
 void solaris_thread_id(CRYPTO_THREADID *tid)
@@ -884,8 +891,12 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
         wait(NULL);
     }
 
+#if 0 /* We can't currently find out the reference amount */
     BIO_printf(bio_stdout, "irix threads done (%d,%d)\n",
                s_ctx->references, c_ctx->references);
+#else
+    BIO_printf(bio_stdout, "irix threads done\n");
+#endif
 }
 
 unsigned long irix_thread_id(void)
@@ -962,8 +973,12 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
         pthread_join(thread_ctx[i], NULL);
     }
 
+#if 0 /* We can't currently find out the reference amount */
     BIO_printf(bio_stdout, "pthreads threads done (%d,%d)\n",
                s_ctx->references, c_ctx->references);
+#else
+    BIO_printf(bio_stdout, "pthreads threads done\n");
+#endif
 }
 
 void pthreads_thread_id(CRYPTO_THREADID *tid)
@@ -1040,8 +1055,12 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
     for (i = 0; i < thread_number; i++) {
         MPKSemaphoreWait(ThreadSem);
     }
+#if 0 /* We can't currently find out the reference amount */
     BIO_printf(bio_stdout, "netware threads done (%d,%d)\n",
                s_ctx->references, c_ctx->references);
+#else
+    BIO_printf(bio_stdout, "netware threads done\n");
+#endif
 }
 
 unsigned long netware_thread_id(void)