diff --git a/configure.ac b/configure.ac index 4150b8439..ba5d74147 100644 --- a/configure.ac +++ b/configure.ac @@ -265,7 +265,7 @@ AC_ARG_ENABLE([leantls], if test "$ENABLED_LEANTLS" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_FILESYSTEM -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_CERTS -DNO_PWDBASED -DNO_DES3 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SESSION_CACHE -DNO_SHA -DUSE_SLOW_SHA -DUSE_SLOW_SHA2 -DNO_PSK -DNO_WOLFSSL_MEMORY -DNO_CODING" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_DES3 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SESSION_CACHE -DNO_SHA -DUSE_SLOW_SHA -DUSE_SLOW_SHA2 -DNO_PSK -DNO_WOLFSSL_MEMORY" fi AM_CONDITIONAL([BUILD_LEANTLS], [test "x$ENABLED_LEANTLS" = "xyes"]) @@ -1124,8 +1124,8 @@ if test "$ENABLED_CODING" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" else - # turn off CODING if leanpsk or leantls on - if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" + # turn off CODING if leanpsk on + if test "$ENABLED_LEANPSK" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_CODING" ENABLED_CODING=no @@ -1415,8 +1415,8 @@ if test "$ENABLED_FILESYSTEM" = "no" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" else - # turn off filesystem if leanpsk or leantls on - if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" + # turn off filesystem if leanpsk on + if test "$ENABLED_LEANPSK" = "yes" then AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM" ENABLED_FILESYSTEM=no diff --git a/examples/client/client.c b/examples/client/client.c index 021e97958..57f0a212d 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -148,11 +148,16 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, /* time passed in number of connects give average */ int times = benchmark; int loops = resumeSession ? 2 : 1; - int i = 0; + int i = 0; +#ifndef NO_SESSION_CACHE WOLFSSL_SESSION* benchSession = NULL; +#endif + (void)resumeSession; while (loops--) { + #ifndef NO_SESSION_CACHE int benchResume = resumeSession && loops == 0; + #endif double start = current_time(), avg; for (i = 0; i < times; i++) { @@ -163,25 +168,31 @@ int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port, tcp_connect(&sockfd, host, port, doDTLS, ssl); + #ifndef NO_SESSION_CACHE if (benchResume) wolfSSL_set_session(ssl, benchSession); + #endif wolfSSL_set_fd(ssl, sockfd); if (wolfSSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed"); wolfSSL_shutdown(ssl); + #ifndef NO_SESSION_CACHE if (i == (times-1) && resumeSession) { benchSession = wolfSSL_get_session(ssl); } + #endif wolfSSL_free(ssl); CloseSocket(sockfd); } avg = current_time() - start; avg /= times; avg *= 1000; /* milliseconds */ + #ifndef NO_SESSION_CACHE if (benchResume) printf("wolfSSL_resume avg took: %8.3f milliseconds\n", avg); else + #endif printf("wolfSSL_connect avg took: %8.3f milliseconds\n", avg); }