From 4fd6f509964f164e328cda0d52816b26bd05f9f3 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Mon, 3 Mar 2008 13:59:47 +0000 Subject: corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers. --- autogen.sh | 17 +---------------- configure.ac | 6 ++++-- src/gnutls_cache.c | 9 ++++++++- src/mod_gnutls.c | 1 - 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/autogen.sh b/autogen.sh index 742b2cc..541e187 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,25 +1,10 @@ #!/bin/sh -if [ -z $ACLOCAL ]; then - ACLOCAL=aclocal -fi -if [ -z $AUTOCONF ]; then - AUTOCONF=autoconf -fi -if [ -z $AUTOHEADER ]; then - AUTOHEADER=autoheader -fi if [ -z $AUTORECONF ]; then AUTORECONF=autoreconf fi #rm -rf autom4te.cache -$AUTORECONF -f -i +$AUTORECONF -f -v -i #touch stamp-h.in -for x in providers/*; do - if [ -e $x/autogen.sh ]; then - echo Generating Config files in $x - (cd $x; ./autogen.sh $*) - fi -done diff --git a/configure.ac b/configure.ac index 5345dc8..1e3e91c 100644 --- a/configure.ac +++ b/configure.ac @@ -47,13 +47,15 @@ AC_ARG_ENABLE(srp, AS_HELP_STRING([--disable-srp], [unconditionally disable the SRP functionality]), use_srp=$enableval, use_srp=yes) + +SRP_CFLAGS="" if test "$use_srp" != "no"; then - AC_DEFINE_UNQUOTED(ENABLE_SRP, 1, [whether to enable SRP]) + SRP_CFLAGS="-DENABLE_SRP=1" fi AC_MSG_CHECKING([whether to enable SRP functionality]) AC_MSG_RESULT($use_srp) -MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" +MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}" AC_SUBST(MODULE_CFLAGS) diff --git a/src/gnutls_cache.c b/src/gnutls_cache.c index 83e7bb5..90f5a86 100644 --- a/src/gnutls_cache.c +++ b/src/gnutls_cache.c @@ -1,5 +1,6 @@ /** * Copyright 2004-2005 Paul Querna + * Portions Copyright 2008 Nikos Mavrogiannopoulos * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -345,6 +346,7 @@ static int dbm_cache_expire(mgs_handle_t *ctxt) break; } } + apr_dbm_freedatum( dbm, dbmval); } apr_dbm_nextkey(dbm, &dbmkey); @@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key) } if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { + apr_dbm_freedatum( dbm, dbmval); apr_dbm_close(dbm); return data; } - apr_dbm_close(dbm); data.size = dbmval.dsize - sizeof(apr_time_t); data.data = gnutls_malloc(data.size); if (data.data == NULL) { + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); return data; } memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); + apr_dbm_freedatum( dbm, dbmval); + apr_dbm_close(dbm); + return data; } diff --git a/src/mod_gnutls.c b/src/mod_gnutls.c index a8363fe..cc760e6 100644 --- a/src/mod_gnutls.c +++ b/src/mod_gnutls.c @@ -17,7 +17,6 @@ #include "mod_gnutls.h" - static void gnutls_hooks(apr_pool_t * p) { ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, -- cgit