add SMALL_SESSION_CACHE define and configure option

pull/1/head
Todd A Ouska 2011-09-06 16:23:25 -07:00
parent 3eb3a70074
commit 8c55e4883e
2 changed files with 20 additions and 0 deletions

View File

@ -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)],

View File

@ -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