[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3220 - in GNUnet: . m4 src/applications/chat src/applicati
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3220 - in GNUnet: . m4 src/applications/chat src/applications/fs/module src/applications/tbench src/applications/testbed |
Date: |
Sat, 12 Aug 2006 19:02:20 -0700 (PDT) |
Author: grothoff
Date: 2006-08-12 19:02:14 -0700 (Sat, 12 Aug 2006)
New Revision: 3220
Modified:
GNUnet/m4/Makefile.in
GNUnet/src/applications/chat/chat.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/fs/module/ondemand.c
GNUnet/src/applications/tbench/tbench.c
GNUnet/src/applications/testbed/testbed.c
GNUnet/todo
Log:
fixing fs/module
Modified: GNUnet/m4/Makefile.in
===================================================================
--- GNUnet/m4/Makefile.in 2006-08-12 15:45:04 UTC (rev 3219)
+++ GNUnet/m4/Makefile.in 2006-08-13 02:02:14 UTC (rev 3220)
@@ -93,6 +93,7 @@
GMSGFMT = @GMSGFMT@
GNUNETGTK_CFLAGS = @GNUNETGTK_CFLAGS@
GNUNETGTK_LIBS = @GNUNETGTK_LIBS@
+GREP = @GREP@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
GUILE = @GUILE@
@@ -169,15 +170,9 @@
XFREEBSD_FALSE = @XFREEBSD_FALSE@
XFREEBSD_TRUE = @XFREEBSD_TRUE@
XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_F77 = @ac_ct_F77@
-ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -192,6 +187,9 @@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
guile_available = @guile_available@
host = @host@
@@ -199,17 +197,21 @@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
subdirs = @subdirs@
Modified: GNUnet/src/applications/chat/chat.c
===================================================================
--- GNUnet/src/applications/chat/chat.c 2006-08-12 15:45:04 UTC (rev 3219)
+++ GNUnet/src/applications/chat/chat.c 2006-08-13 02:02:14 UTC (rev 3220)
@@ -207,9 +207,13 @@
if (SYSERR == capi->registerClientHandler(CS_PROTO_chat_MSG,
&csHandleChatRequest))
ok = SYSERR;
- setConfigurationString("ABOUT",
- "chat",
- _("enables P2P-chat (incomplete)"));
+
+ GE_ASSERT(capi->ectx,
+ 0 == GC_set_configuration_value_string(capi->cfg,
+ capi->ectx,
+ "ABOUT",
+ "chat",
+ _("enables P2P-chat
(incomplete)")));
return ok;
}
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2006-08-12 15:45:04 UTC (rev
3219)
+++ GNUnet/src/applications/fs/module/fs.c 2006-08-13 02:02:14 UTC (rev
3220)
@@ -1165,6 +1165,7 @@
int initialize_module_fs(CoreAPIForApplication * capi) {
static Blockstore dsGap;
static Blockstore dsDht;
+ unsigned long long quota;
ectx = capi->ectx;
GE_ASSERT(ectx, sizeof(CHK) == 128);
@@ -1174,17 +1175,26 @@
GE_ASSERT(ectx, sizeof(SBlock) == 724);
GE_ASSERT(ectx, sizeof(NBlock) == 716);
GE_ASSERT(ectx, sizeof(KNBlock) == 1244);
- migration = testConfigurationString("FS",
- "ACTIVEMIGRATION",
- "YES");
+ migration = GC_get_configuration_value_yesno(capi->cfg,
+ "FS",
+ "ACTIVEMIGRATION",
+ YES);
+ if (migration == SYSERR)
+ return SYSERR;
hash("GNUNET_FS",
strlen("GNUNET_FS"),
&dht_table);
- if (getConfigurationInt("FS",
- "QUOTA") <= 0) {
- GE_LOG(ectx, GE_ERROR | GE_BULK | GE_USER,
- _("You must specify a postive number for `%s' in the configuration in
section `%s'.\n"),
- "QUOTA", "FS");
+ if (GC_get_configuration_value_number(capi->cfg,
+ "FS",
+ "QUOTA",
+ 1,
+ ((unsigned long long)-1)/1024,
+ 1024,
+ "a) == -1) {
+ GE_LOG(ectx,
+ GE_ERROR | GE_BULK | GE_USER,
+ _("You must specify a postive number for `%s' in the configuration
in section `%s'.\n"),
+ "QUOTA", "FS");
return SYSERR;
}
datastore = capi->requestService("datastore");
@@ -1206,7 +1216,9 @@
NULL,
32 * 1024);
if (localGetProcessor == NULL)
- DIE_STRERROR("pthread_create");
+ GE_DIE_STRERROR(ectx,
+ GE_ADMIN | GE_FATAL | GE_BULK,
+ "pthread_create");
coreAPI = capi;
ONDEMAND_init(capi);
lock = MUTEX_CREATE(NO);
@@ -1267,9 +1279,12 @@
gap,
dht,
traffic);
- setConfigurationString("ABOUT",
- "fs",
- gettext_noop("enables (anonymous) file-sharing"));
+ GE_ASSERT(capi->ectx,
+ 0 == GC_set_configuration_value_string(capi->cfg,
+ capi->ectx,
+ "ABOUT",
+ "fs",
+ gettext_noop("enables
(anonymous) file-sharing")));
return OK;
}
Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c 2006-08-12 15:45:04 UTC
(rev 3219)
+++ GNUnet/src/applications/fs/module/ondemand.c 2006-08-13 02:02:14 UTC
(rev 3220)
@@ -26,8 +26,10 @@
#include "platform.h"
#include "gnunet_protocols.h"
+#include "gnunet_directories.h"
#include "ecrs_core.h"
#include "ondemand.h"
+#include "gnunet_state_service.h"
#define DEBUG_ONDEMAND NO
@@ -69,6 +71,8 @@
static CoreAPIForApplication * coreAPI;
+static State_ServiceAPI * state;
+
static char * getOnDemandFile(const HashCode512 * fileId) {
EncName enc;
char * fn;
@@ -144,7 +148,8 @@
256,
"FIRST_UNAVAILABLE-%s",
(char*)&enc);
- stateUnlinkFromDB(unavail_key);
+ state->unlink(ectx,
+ unavail_key);
FREE(serverFN);
return YES;
}
@@ -371,10 +376,14 @@
256,
"FIRST_UNVAILABLE-%s",
(char *) &enc);
- if (stateReadContent(unavail_key,
- (void *) &first_unavail) == SYSERR) {
+ if (state->read(ectx,
+ unavail_key,
+ (void *) &first_unavail) == SYSERR) {
unsigned long long now = htonll(get_time());
- stateWriteContent(unavail_key, sizeof(cron_t), (void *) &now);
+ state->write(ectx,
+ unavail_key,
+ sizeof(cron_t),
+ (void *) &now);
} else {
/* Delete it after 3 days */
if (*first_unavail - get_time() > 3 * cronDAYS) {
@@ -406,7 +415,8 @@
}
FREE(ofn);
asyncDelete(datastore, dbv, query);
- stateUnlinkFromDB(unavail_key);
+ state->unlink(ectx,
+ unavail_key);
UNLINK(fn);
}
}
@@ -659,7 +669,8 @@
256,
"FIRST_UNAVAILABLE-%s",
(char*)&enc);
- stateUnlinkFromDB(unavail_key);
+ state->unlink(ectx,
+ unavail_key);
FREE(fn);
@@ -670,17 +681,27 @@
char * tmp;
coreAPI = capi;
+ state = capi->requestService("state");
+ if (state == NULL) {
+ GE_BREAK(ectx, 0);
+ return SYSERR;
+ }
ectx = capi->ectx;
- tmp
- = getConfigurationString("FS",
- "INDEX-DIRECTORY");
- if (NULL == tmp) {
- tmp = getConfigurationString("GNUNETD",
- "GNUNETD_HOME");
- GE_ASSERT(ectx, NULL != tmp);
+ if (0 != GC_get_configuration_value_string(capi->cfg,
+ "FS",
+ "INDEX-DIRECTORY",
+ NULL,
+ &tmp)) {
+ GC_get_configuration_value_string(capi->cfg,
+ "GNUNETD",
+ "GNUNETD_HOME",
+ VAR_DAEMON_DIRECTORY,
+ &tmp);
+ GE_ASSERT(ectx,
+ NULL != tmp);
tmp = REALLOC(tmp,
- strlen(tmp) +
- strlen("/data/shared/") + 1);
+ strlen(tmp) +
+ strlen("/data/shared/") + 1);
strcat(tmp, "/data/shared/");
}
index_directory = string_expandFileName(ectx,
@@ -692,6 +713,8 @@
}
int ONDEMAND_done() {
+ coreAPI->releaseService(state);
+ state = NULL;
FREE(index_directory);
return OK;
}
Modified: GNUnet/src/applications/tbench/tbench.c
===================================================================
--- GNUnet/src/applications/tbench/tbench.c 2006-08-12 15:45:04 UTC (rev
3219)
+++ GNUnet/src/applications/tbench/tbench.c 2006-08-13 02:02:14 UTC (rev
3220)
@@ -451,10 +451,14 @@
if (SYSERR == capi->registerClientHandler(CS_PROTO_tbench_REQUEST,
&csHandleTBenchRequest))
ok = SYSERR;
- setConfigurationString("ABOUT",
- "tbench",
- gettext_noop("allows profiling of direct "
- "peer-to-peer connections"));
+
+ GE_ASSERT(capi->ectx,
+ 0 == GC_set_configuration_value_string(capi->cfg,
+ capi->ectx,
+ "ABOUT",
+ "tbench",
+ gettext_noop("allows
profiling of direct "
+ "peer-to-peer
connections")));
return ok;
}
Modified: GNUnet/src/applications/testbed/testbed.c
===================================================================
--- GNUnet/src/applications/testbed/testbed.c 2006-08-12 15:45:04 UTC (rev
3219)
+++ GNUnet/src/applications/testbed/testbed.c 2006-08-13 02:02:14 UTC (rev
3220)
@@ -1352,10 +1352,14 @@
GE_ASSERT(ectx, SYSERR !=
capi->registerClientHandler(CS_PROTO_testbed_REQUEST,
(CSHandler)&csHandleTestbedRequest));
httpRegister("startup");
- setConfigurationString("ABOUT",
- "testbed",
- gettext_noop("allows construction of a P2P-testbed"
- " (incomplete)"));
+
+ GE_ASSERT(capi->ectx,
+ 0 == GC_set_configuration_value_string(capi->cfg,
+ capi->ectx,
+ "ABOUT",
+ "testbed",
+ gettext_noop("allows
construction of a P2P-testbed"
+ "
(incomplete)")));
return OK;
}
Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-08-12 15:45:04 UTC (rev 3219)
+++ GNUnet/todo 2006-08-13 02:02:14 UTC (rev 3220)
@@ -26,7 +26,8 @@
* applications:
+ fragmentation, identity, pingpong, session, transport,
stats, topology_default, state, getoption, advertising,
- traffic, ecrs_core, template, tbench, tracekit, fs/fslib compile
+ traffic, ecrs_core, template, tbench, tracekit, fs/fslib,
+ fs/module compile
+ bootstrap_http: maybe switch to libwww?
+ for fs: fs (18500), gap (2800)
+ rest: sqstore_mysql, dht, rpc, topology_f2f, vpn
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3220 - in GNUnet: . m4 src/applications/chat src/applications/fs/module src/applications/tbench src/applications/testbed,
grothoff <=