From 8c55e4883e427bf9c24be89b8bd3daac83ec395c Mon Sep 17 00:00:00 2001 From: Todd A Ouska Date: Tue, 6 Sep 2011 16:23:25 -0700 Subject: [PATCH] add SMALL_SESSION_CACHE define and configure option --- configure.ac | 13 +++++++++++++ src/ssl.c | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 0d6c180cd..2047262e9 100644 --- a/configure.ac +++ b/configure.ac @@ -232,6 +232,19 @@ then fi +# SMALL cache +AC_ARG_ENABLE(smallcache, + [ --enable-smallcache Enable small session cache (default: disabled)], + [ ENABLED_SMALLCACHE=$enableval ], + [ ENABLED_SMALLCACHE=no ] + ) + +if test "$ENABLED_SMALLCACHE" = "yes" +then + AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE" +fi + + # SNIFFER AC_ARG_ENABLE(sniffer, [ --enable-sniffer Enable CyaSSL sniffer support (default: disabled)], diff --git a/src/ssl.c b/src/ssl.c index 463f562f8..baa662a19 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -456,6 +456,10 @@ int AddCA(CYASSL_CTX* ctx, buffer der) HUGE_SESSION_CACHE yields 65,791 sessions, for servers under heavy load, allows over 13,000 new sessions per minute or over 200 new sessions per second + + SMALL_SESSION_CACHE only stores 6 sessions, good for embedded clients + or systems where the default of nearly 3kB is too much RAM, this define + uses less than 500 bytes RAM */ #ifdef HUGE_SESSION_CACHE #define SESSIONS_PER_ROW 11 @@ -463,6 +467,9 @@ int AddCA(CYASSL_CTX* ctx, buffer der) #elif defined(BIG_SESSION_CACHE) #define SESSIONS_PER_ROW 5 #define SESSION_ROWS 211 + #elif defined(SMALL_SESSION_CACHE) + #define SESSIONS_PER_ROW 2 + #define SESSION_ROWS 3 #else #define SESSIONS_PER_ROW 3 #define SESSION_ROWS 11