diff options
author | cheloha <> | 2018-09-17 15:37:35 +0000 |
---|---|---|
committer | cheloha <> | 2018-09-17 15:37:35 +0000 |
commit | e6a459dcbefb4cbc837bce30f21261bd6350200a (patch) | |
tree | 3264cf76244348a724e934c8c7f05d561f332b03 /src/usr.bin/openssl/s_time.c | |
parent | 6ae7e36ac660812622367c922c684b97052bae6d (diff) | |
download | openbsd-e6a459dcbefb4cbc837bce30f21261bd6350200a.tar.gz openbsd-e6a459dcbefb4cbc837bce30f21261bd6350200a.tar.bz2 openbsd-e6a459dcbefb4cbc837bce30f21261bd6350200a.zip |
Move tally mark printing out of the main benchmark loop; ok tb@
Diffstat (limited to 'src/usr.bin/openssl/s_time.c')
-rw-r--r-- | src/usr.bin/openssl/s_time.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index 793e50e4be..1506ca356a 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_time.c,v 1.31 2018/08/28 14:30:48 cheloha Exp $ */ | 1 | /* $OpenBSD: s_time.c,v 1.32 2018/09/17 15:37:35 cheloha Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -92,6 +92,7 @@ extern int verify_depth; | |||
92 | static void s_time_usage(void); | 92 | static void s_time_usage(void); |
93 | static int run_test(SSL *); | 93 | static int run_test(SSL *); |
94 | static int benchmark(int); | 94 | static int benchmark(int); |
95 | static void print_tally_mark(SSL *); | ||
95 | 96 | ||
96 | static SSL_CTX *tm_ctx = NULL; | 97 | static SSL_CTX *tm_ctx = NULL; |
97 | static const SSL_METHOD *s_time_meth = NULL; | 98 | static const SSL_METHOD *s_time_meth = NULL; |
@@ -393,6 +394,24 @@ run_test(SSL *scon) | |||
393 | return 1; | 394 | return 1; |
394 | } | 395 | } |
395 | 396 | ||
397 | static void | ||
398 | print_tally_mark(SSL *scon) | ||
399 | { | ||
400 | int ver; | ||
401 | |||
402 | if (SSL_session_reused(scon)) | ||
403 | ver = 'r'; | ||
404 | else { | ||
405 | ver = SSL_version(scon); | ||
406 | if (ver == TLS1_VERSION) | ||
407 | ver = 't'; | ||
408 | else | ||
409 | ver = '*'; | ||
410 | } | ||
411 | fputc(ver, stdout); | ||
412 | fflush(stdout); | ||
413 | } | ||
414 | |||
396 | static int | 415 | static int |
397 | benchmark(int reuse_session) | 416 | benchmark(int reuse_session) |
398 | { | 417 | { |
@@ -400,7 +419,6 @@ benchmark(int reuse_session) | |||
400 | int nConn = 0; | 419 | int nConn = 0; |
401 | SSL *scon = NULL; | 420 | SSL *scon = NULL; |
402 | int ret = 1; | 421 | int ret = 1; |
403 | int ver; | ||
404 | 422 | ||
405 | if (reuse_session) { | 423 | if (reuse_session) { |
406 | /* Get an SSL object so we can reuse the session id */ | 424 | /* Get an SSL object so we can reuse the session id */ |
@@ -429,18 +447,7 @@ benchmark(int reuse_session) | |||
429 | if (!run_test(scon)) | 447 | if (!run_test(scon)) |
430 | goto end; | 448 | goto end; |
431 | nConn += 1; | 449 | nConn += 1; |
432 | if (SSL_session_reused(scon)) | 450 | print_tally_mark(scon); |
433 | ver = 'r'; | ||
434 | else { | ||
435 | ver = SSL_version(scon); | ||
436 | if (ver == TLS1_VERSION) | ||
437 | ver = 't'; | ||
438 | else | ||
439 | ver = '*'; | ||
440 | } | ||
441 | fputc(ver, stdout); | ||
442 | fflush(stdout); | ||
443 | |||
444 | if (!reuse_session) { | 451 | if (!reuse_session) { |
445 | SSL_free(scon); | 452 | SSL_free(scon); |
446 | scon = NULL; | 453 | scon = NULL; |