aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nokis Mavrogiannopoulos 2008-03-03 13:59:47 +0000
committerGravatar Nokis Mavrogiannopoulos 2008-03-03 13:59:47 +0000
commit4fd6f509964f164e328cda0d52816b26bd05f9f3 (patch)
treebb4d0de55bd6566da1a84936a6fc531de4693a02
parent35e1d6a89b8587e5a9bcbaa0b93e813f469eac7f (diff)
corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers.
-rwxr-xr-xautogen.sh17
-rw-r--r--configure.ac6
-rw-r--r--src/gnutls_cache.c9
-rw-r--r--src/mod_gnutls.c1
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 @@
1#!/bin/sh 1#!/bin/sh
2 2
3if [ -z $ACLOCAL ]; then
4 ACLOCAL=aclocal
5fi
6if [ -z $AUTOCONF ]; then
7 AUTOCONF=autoconf
8fi
9if [ -z $AUTOHEADER ]; then
10 AUTOHEADER=autoheader
11fi
12if [ -z $AUTORECONF ]; then 3if [ -z $AUTORECONF ]; then
13 AUTORECONF=autoreconf 4 AUTORECONF=autoreconf
14fi 5fi
15 6
16#rm -rf autom4te.cache 7#rm -rf autom4te.cache
17$AUTORECONF -f -i 8$AUTORECONF -f -v -i
18#touch stamp-h.in 9#touch stamp-h.in
19 10
20for x in providers/*; do
21 if [ -e $x/autogen.sh ]; then
22 echo Generating Config files in $x
23 (cd $x; ./autogen.sh $*)
24 fi
25done
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,
47 AS_HELP_STRING([--disable-srp], 47 AS_HELP_STRING([--disable-srp],
48 [unconditionally disable the SRP functionality]), 48 [unconditionally disable the SRP functionality]),
49 use_srp=$enableval, use_srp=yes) 49 use_srp=$enableval, use_srp=yes)
50
51SRP_CFLAGS=""
50if test "$use_srp" != "no"; then 52if test "$use_srp" != "no"; then
51 AC_DEFINE_UNQUOTED(ENABLE_SRP, 1, [whether to enable SRP]) 53 SRP_CFLAGS="-DENABLE_SRP=1"
52fi 54fi
53AC_MSG_CHECKING([whether to enable SRP functionality]) 55AC_MSG_CHECKING([whether to enable SRP functionality])
54AC_MSG_RESULT($use_srp) 56AC_MSG_RESULT($use_srp)
55 57
56MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}" 58MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}"
57MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}" 59MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
58 60
59AC_SUBST(MODULE_CFLAGS) 61AC_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 @@
1/** 1/**
2 * Copyright 2004-2005 Paul Querna 2 * Copyright 2004-2005 Paul Querna
3 * Portions Copyright 2008 Nikos Mavrogiannopoulos
3 * 4 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 6 * 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)
345 break; 346 break;
346 } 347 }
347 } 348 }
349 apr_dbm_freedatum( dbm, dbmval);
348 350
349 } 351 }
350 apr_dbm_nextkey(dbm, &dbmkey); 352 apr_dbm_nextkey(dbm, &dbmkey);
@@ -401,20 +403,25 @@ static gnutls_datum_t dbm_cache_fetch(void* baton, gnutls_datum_t key)
401 } 403 }
402 404
403 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) { 405 if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(apr_time_t)) {
406 apr_dbm_freedatum( dbm, dbmval);
404 apr_dbm_close(dbm); 407 apr_dbm_close(dbm);
405 return data; 408 return data;
406 } 409 }
407 apr_dbm_close(dbm);
408 410
409 data.size = dbmval.dsize - sizeof(apr_time_t); 411 data.size = dbmval.dsize - sizeof(apr_time_t);
410 412
411 data.data = gnutls_malloc(data.size); 413 data.data = gnutls_malloc(data.size);
412 if (data.data == NULL) { 414 if (data.data == NULL) {
415 apr_dbm_freedatum( dbm, dbmval);
416 apr_dbm_close(dbm);
413 return data; 417 return data;
414 } 418 }
415 419
416 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size); 420 memcpy(data.data, dbmval.dptr+sizeof(apr_time_t), data.size);
417 421
422 apr_dbm_freedatum( dbm, dbmval);
423 apr_dbm_close(dbm);
424
418 return data; 425 return data;
419} 426}
420 427
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 @@
17 17
18#include "mod_gnutls.h" 18#include "mod_gnutls.h"
19 19
20
21static void gnutls_hooks(apr_pool_t * p) 20static void gnutls_hooks(apr_pool_t * p)
22{ 21{
23 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL, 22 ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL,