[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3305 - in GNUnet/src: applications/sqstore_sqlite applicat
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3305 - in GNUnet/src: applications/sqstore_sqlite applications/transport server util/config_impl |
Date: |
Thu, 24 Aug 2006 19:20:41 -0700 (PDT) |
Author: grothoff
Date: 2006-08-24 19:20:38 -0700 (Thu, 24 Aug 2006)
New Revision: 3305
Modified:
GNUnet/src/applications/sqstore_sqlite/sqlite.c
GNUnet/src/applications/transport/transport.c
GNUnet/src/server/startup.c
GNUnet/src/util/config_impl/impl.c
Log:
more bugfixes
Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c 2006-08-25 02:12:53 UTC
(rev 3304)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c 2006-08-25 02:20:38 UTC
(rev 3305)
@@ -156,7 +156,9 @@
if (sqlite3_open(db->fn, &ret->dbh) != SQLITE_OK) {
GE_LOG(ectx,
GE_ERROR | GE_BULK | GE_USER,
- _("Unable to initialize SQLite.\n"));
+ _("Unable to initialize SQLite: %s.\n"),
+ sqlite3_errmsg(ret->dbh));
+ sqlite3_close(ret->dbh);
FREE(ret);
return NULL;
}
@@ -1062,17 +1064,12 @@
db->lastSync = 0;
afsdir = NULL;
- if (0 != GC_get_configuration_value_string(capi->cfg,
- "FS",
- "DIR",
- NULL,
- &afsdir)) {
+ if (0 != GC_get_configuration_value_filename(capi->cfg,
+ "FS",
+ "DIR",
+ VAR_DAEMON_DIRECTORY "/data/fs/",
+ &afsdir)) {
FREE(db);
- GE_LOG(ectx,
- GE_ERROR | GE_USER | GE_ADMIN | GE_IMMEDIATE,
- _("Configuration must specify directory in section `%s' entry
`%s'\n"),
- "FS",
- "DIR");
return NULL;
}
@@ -1095,7 +1092,6 @@
dbh = getDBHandle();
if (dbh == NULL) {
- LOG_SQLITE(GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "db_handle");
MUTEX_DESTROY(db->DATABASE_Lock_);
FREE(db->fn);
FREE(db);
Modified: GNUnet/src/applications/transport/transport.c
===================================================================
--- GNUnet/src/applications/transport/transport.c 2006-08-25 02:12:53 UTC
(rev 3304)
+++ GNUnet/src/applications/transport/transport.c 2006-08-25 02:20:38 UTC
(rev 3305)
@@ -446,33 +446,6 @@
return used;
}
-/**
- * Actually start the transport services and begin
- * receiving messages.
- */
-static void startTransports(P2P_PACKETProcessor mpp) {
- int i;
-
- ctapi.receive = mpp;
- for (i=0;i<tapis_count;i++)
- if (tapis[i] != NULL) {
- if (OK != tapis[i]->startTransportServer())
- unloadTransport(i);
- }
-}
-
-/**
- * Stop the transport services, stop receiving messages.
- */
-static void stopTransports() {
- int i;
-
- for (i=0;i<tapis_count;i++)
- if (tapis[i] != NULL)
- tapis[i]->stopTransportServer();
- ctapi.receive = NULL;
-}
-
static void initHello(void * cls) {
TransportAPI * tapi = cls;
P2P_hello_MESSAGE * helo;
@@ -485,21 +458,6 @@
}
}
-static void initHelper(TransportAPI * tapi,
- void * unused) {
- /* Creation of HELLOs takes longer if a locally
- unresolvable hostname ((Dyn)DNS) was specified
- as this host's address and we have no network
- connection at the moment. gethostbyname()
- blocks the startup process in this case.
- This is why we create the HELLOs in another
- thread. */
- cron_add_job(coreAPI->cron,
- &initHello,
- 0,
- 0,
- tapi);
-}
static void doneHelper(TransportAPI * tapi,
void * unused) {
@@ -515,7 +473,7 @@
static void unloadTransport(int i) {
void (*ptr)();
- doneHelper(&tapis[i], NULL);
+ doneHelper(tapis[i], NULL);
cron_del_job(coreAPI->cron,
&createSignedhello,
HELLO_RECREATE_FREQ,
@@ -534,6 +492,49 @@
/**
+ * Actually start the transport services and begin
+ * receiving messages.
+ */
+static void startTransports(P2P_PACKETProcessor mpp) {
+ int i;
+
+ ctapi.receive = mpp;
+ for (i=0;i<tapis_count;i++)
+ if (tapis[i] != NULL) {
+ if (OK != tapis[i]->startTransportServer())
+ unloadTransport(i);
+ }
+}
+
+/**
+ * Stop the transport services, stop receiving messages.
+ */
+static void stopTransports() {
+ int i;
+
+ for (i=0;i<tapis_count;i++)
+ if (tapis[i] != NULL)
+ tapis[i]->stopTransportServer();
+ ctapi.receive = NULL;
+}
+
+static void initHelper(TransportAPI * tapi,
+ void * unused) {
+ /* Creation of HELLOs takes longer if a locally
+ unresolvable hostname ((Dyn)DNS) was specified
+ as this host's address and we have no network
+ connection at the moment. gethostbyname()
+ blocks the startup process in this case.
+ This is why we create the HELLOs in another
+ thread. */
+ cron_add_job(coreAPI->cron,
+ &initHello,
+ 0,
+ 0,
+ tapi);
+}
+
+/**
* Initialize the transport layer.
*/
Transport_ServiceAPI *
Modified: GNUnet/src/server/startup.c
===================================================================
--- GNUnet/src/server/startup.c 2006-08-25 02:12:53 UTC (rev 3304)
+++ GNUnet/src/server/startup.c 2006-08-25 02:20:38 UTC (rev 3305)
@@ -60,11 +60,11 @@
static char * getPIDFile(struct GC_Configuration * cfg) {
char * pif;
- if (0 != GC_get_configuration_value_string(cfg,
- "GNUNETD",
- "PIDFILE",
- NULL,
- &pif))
+ if (0 != GC_get_configuration_value_filename(cfg,
+ "GNUNETD",
+ "PIDFILE",
+ NULL,
+ &pif))
return NULL;
return pif;
}
Modified: GNUnet/src/util/config_impl/impl.c
===================================================================
--- GNUnet/src/util/config_impl/impl.c 2006-08-25 02:12:53 UTC (rev 3304)
+++ GNUnet/src/util/config_impl/impl.c 2006-08-25 02:20:38 UTC (rev 3305)
@@ -628,7 +628,6 @@
char * tmp;
data = cfg->data;
- GE_ASSERT(data->ectx, def != NULL);
tmp = NULL;
ret = _get_configuration_value_string(cfg, section, option, def, &tmp);
if (tmp != NULL) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3305 - in GNUnet/src: applications/sqstore_sqlite applications/transport server util/config_impl,
grothoff <=