-/* $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.
*
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;
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)
{
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 */
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;