[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-developers] tdb.patch
From: |
Uli Luckas |
Subject: |
[GNUnet-developers] tdb.patch |
Date: |
Sun, 05 May 2002 23:22:40 +0200 |
Hi,
as discussed before, there is a concurency problem with gdbm. This is
why i did some more research for an adequat record management library.
I found Andrew Tridgell's tdb (http://sourceforge.net/projects/tdb/) to
be abel to handle multiple concurent writers and suppose it should do
the job quite well.
As tdb is heavily used within samba it should be available with most
distributions.
Attached you find a patch to update the latest cvs to use tdb.
The modifications are almost trivial as tdb's api is most similar to
gdbm.
After applying the patch there are two files that are not needed any
more:
src/include/util/contentdatabase_gdbm.h
src/util/contentdatabase_gdbm.c
They have been replaced by almost identical *_tdb.* files. So just
remove them.
Uli
? tdb.patch
? src/include/util/contentdatabase_tdb.h
? src/util/contentdatabase_tdb.c
Index: Makefile.am
===================================================================
RCS file: /var/cvs/GNUnet/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- Makefile.am 5 May 2002 18:50:42 -0000 1.9
+++ Makefile.am 5 May 2002 21:05:17 -0000
@@ -1,5 +1,3 @@
INCLUDES = -I$(top_srcdir)/src/include
-LIBS = -lgdbm
-LIBS = -lgdbm
-LIBS = -lgdbm
+LIBS = -ltdb
SUBDIRS = src doc
Index: configure.in
===================================================================
RCS file: /var/cvs/GNUnet/configure.in,v
retrieving revision 1.27
diff -u -r1.27 configure.in
--- configure.in 5 May 2002 18:50:42 -0000 1.27
+++ configure.in 5 May 2002 21:05:17 -0000
@@ -51,7 +51,7 @@
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(gdbm, gdbm_open)
+AC_CHECK_LIB(tdb, tdb_open)
AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GNUnet needs GTK))
AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GNUnet needs glib),gthread)
Index: src/Makefile.am
===================================================================
RCS file: /var/cvs/GNUnet/src/Makefile.am,v
retrieving revision 1.10
diff -u -r1.10 Makefile.am
--- src/Makefile.am 5 May 2002 18:50:42 -0000 1.10
+++ src/Makefile.am 5 May 2002 21:05:18 -0000
@@ -1,3 +1,3 @@
INCLUDES = -I$(top_srcdir)/src/include
-LIBS = -lgdbm
+LIBS = -ltdb
SUBDIRS = util common server textui test gtkui
Index: src/common/lookup.c
===================================================================
RCS file: /var/cvs/GNUnet/src/common/lookup.c,v
retrieving revision 1.66
diff -u -r1.66 lookup.c
--- src/common/lookup.c 5 May 2002 18:50:42 -0000 1.66
+++ src/common/lookup.c 5 May 2002 21:05:19 -0000
@@ -25,7 +25,7 @@
**/
#include "lookup.h"
-#include "util/contentdatabase_gdbm.h"
+#include "util/contentdatabase_tdb.h"
#include <dirent.h>
Index: src/server/gnet.c
===================================================================
RCS file: /var/cvs/GNUnet/src/server/gnet.c,v
retrieving revision 1.111
diff -u -r1.111 gnet.c
--- src/server/gnet.c 5 May 2002 18:50:42 -0000 1.111
+++ src/server/gnet.c 5 May 2002 21:05:20 -0000
@@ -45,7 +45,7 @@
#include "configuration.h"
#include "util/semaphore.h"
#include "util/statuscalls.h"
-#include "util/contentdatabase_gdbm.h"
+#include "util/contentdatabase_tdb.h"
#include "server/startup.h"
#include "server/handler.h"
#include "server/keyservice.h"
@@ -131,7 +131,7 @@
readConfig(configFile);
checkCompiler();
- initContentDatabase_GDBM((DirName*)expandFileName
+ initContentDatabase_TDB((DirName*)expandFileName
((FileName)getContentDirectory()));
initCron();
initStatusCalls(getNetInterfaces(),
Index: src/server/policy.c
===================================================================
RCS file: /var/cvs/GNUnet/src/server/policy.c,v
retrieving revision 1.10
diff -u -r1.10 policy.c
--- src/server/policy.c 5 May 2002 18:50:42 -0000 1.10
+++ src/server/policy.c 5 May 2002 21:05:21 -0000
@@ -25,7 +25,7 @@
**/
#include "server/policy.h"
-#include "util/contentdatabase_gdbm.h"
+#include "util/contentdatabase_tdb.h"
/* import from routing.c */
extern HostIdentity ROUTING_localhost_;
Index: src/textui/insertfile.c
===================================================================
RCS file: /var/cvs/GNUnet/src/textui/insertfile.c,v
retrieving revision 1.105
diff -u -r1.105 insertfile.c
--- src/textui/insertfile.c 5 May 2002 18:50:42 -0000 1.105
+++ src/textui/insertfile.c 5 May 2002 21:05:21 -0000
@@ -28,7 +28,7 @@
**/
#include "textui/insertfile.h"
-#include "contentdatabase_gdbm.h"
+#include "contentdatabase_tdb.h"
#include "lookup.h"
/**
Index: src/textui/insertmain.c
===================================================================
RCS file: /var/cvs/GNUnet/src/textui/insertmain.c,v
retrieving revision 1.29
diff -u -r1.29 insertmain.c
--- src/textui/insertmain.c 5 May 2002 18:50:42 -0000 1.29
+++ src/textui/insertmain.c 5 May 2002 21:05:22 -0000
@@ -26,7 +26,7 @@
**/
#include "textui/insertfile.h"
-#include "util/contentdatabase_gdbm.h"
+#include "util/contentdatabase_tdb.h"
#include "lookup.h"
#include <unistd.h>
#include "getopt.h"
@@ -120,7 +120,7 @@
description = argv[optind++];
keywords = &(argv[optind]);
num_keywords = argc - optind;
- initContentDatabase_GDBM(getContentDirectory());
+ initContentDatabase_TDB(getContentDirectory());
initCron();
initLookup();
Index: src/textui/insertmp3.c
===================================================================
RCS file: /var/cvs/GNUnet/src/textui/insertmp3.c,v
retrieving revision 1.16
diff -u -r1.16 insertmp3.c
--- src/textui/insertmp3.c 5 May 2002 18:50:42 -0000 1.16
+++ src/textui/insertmp3.c 5 May 2002 21:05:22 -0000
@@ -31,7 +31,7 @@
#include "util/cron.h"
#include <unistd.h>
#include "getopt.h"
-#include "util/contentdatabase_gdbm.h"
+#include "util/contentdatabase_tdb.h"
/**
* Prints the usage information for this command if the user errs.
@@ -223,7 +223,7 @@
}
readConfig(confFile);
initRAND();
- initContentDatabase_GDBM(getContentDirectory());
+ initContentDatabase_TDB(getContentDirectory());
if (encode_content == 1) {
initCron();
initLookup();
Index: src/util/Makefile.am
===================================================================
RCS file: /var/cvs/GNUnet/src/util/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- src/util/Makefile.am 5 May 2002 18:50:42 -0000 1.9
+++ src/util/Makefile.am 5 May 2002 21:05:22 -0000
@@ -13,5 +13,5 @@
statuscalls.c statuscalls.h \
storage.c storage.h \
getopt.c getopt.h \
- contentdatabase_gdbm.c contentdatabase_gdbm.h \
+ contentdatabase_tdb.c contentdatabase_tdb.h \
getopt1.c getopt.h
- [GNUnet-developers] tdb.patch,
Uli Luckas <=