summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2018-09-17 15:37:36 +0000
committercheloha <cheloha@cvs.openbsd.org>2018-09-17 15:37:36 +0000
commit7ae103433bf24bca6fa9dcb64f1fb85fbc5eb982 (patch)
tree3ee0a1ef2cb4e8540aa0815d972f03408a258f8d /usr.bin
parentea7c0a80b9a0ce1867b808c044cbe434cd3cc1f6 (diff)
Move tally mark printing out of the main benchmark loop; ok tb@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/openssl/s_time.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/usr.bin/openssl/s_time.c b/usr.bin/openssl/s_time.c
index 793e50e4be7..1506ca356ac 100644
--- a/usr.bin/openssl/s_time.c
+++ b/usr.bin/openssl/s_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_time.c,v 1.31 2018/08/28 14:30:48 cheloha Exp $ */
+/* $OpenBSD: s_time.c,v 1.32 2018/09/17 15:37:35 cheloha Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -92,6 +92,7 @@ extern int verify_depth;
static void s_time_usage(void);
static int run_test(SSL *);
static int benchmark(int);
+static void print_tally_mark(SSL *);
static SSL_CTX *tm_ctx = NULL;
static const SSL_METHOD *s_time_meth = NULL;
@@ -393,6 +394,24 @@ run_test(SSL *scon)
return 1;
}
+static void
+print_tally_mark(SSL *scon)
+{
+ int ver;
+
+ if (SSL_session_reused(scon))
+ ver = 'r';
+ else {
+ ver = SSL_version(scon);
+ if (ver == TLS1_VERSION)
+ ver = 't';
+ else
+ ver = '*';
+ }
+ fputc(ver, stdout);
+ fflush(stdout);
+}
+
static int
benchmark(int reuse_session)
{
@@ -400,7 +419,6 @@ benchmark(int reuse_session)
int nConn = 0;
SSL *scon = NULL;
int ret = 1;
- int ver;
if (reuse_session) {
/* Get an SSL object so we can reuse the session id */
@@ -429,18 +447,7 @@ benchmark(int reuse_session)
if (!run_test(scon))
goto end;
nConn += 1;
- if (SSL_session_reused(scon))
- ver = 'r';
- else {
- ver = SSL_version(scon);
- if (ver == TLS1_VERSION)
- ver = 't';
- else
- ver = '*';
- }
- fputc(ver, stdout);
- fflush(stdout);
-
+ print_tally_mark(scon);
if (!reuse_session) {
SSL_free(scon);
scon = NULL;