gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3676 - in GNUnet: . src/applications/fs/fsui src/applicati


From: grothoff
Subject: [GNUnet-SVN] r3676 - in GNUnet: . src/applications/fs/fsui src/applications/fs/module src/applications/fs/tools src/applications/sqstore_sqlite src/applications/transport src/util/boot
Date: Thu, 9 Nov 2006 23:04:45 -0800 (PST)

Author: grothoff
Date: 2006-11-09 23:04:37 -0800 (Thu, 09 Nov 2006)
New Revision: 3676

Modified:
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/fs/module/ondemand.c
   GNUnet/src/applications/fs/tools/gnunet-download.c
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
   GNUnet/src/applications/transport/transport.c
   GNUnet/src/util/boot/startup.c
   GNUnet/todo
Log:
fixing bugs in gnunet-insert and gnunet-download and sqlite delete operation 
and ondemand long-term expiration check

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2006-11-08 21:15:17 UTC (rev 
3675)
+++ GNUnet/src/applications/fs/fsui/download.c  2006-11-10 07:04:37 UTC (rev 
3676)
@@ -31,7 +31,7 @@
 #include "gnunet_fsui_lib.h"
 #include "fsui.h"
 
-#define DEBUG_DTM NO
+#define DEBUG_DTM YES
 
 /**
  * Start to download a file.
@@ -281,7 +281,7 @@
 
   if ( (ret == OK) &&
        (dl->is_recursive) &&
-       (dl->is_directory) ) {
+       (dl->is_directory == YES) ) {
     char * dirBlock;
     int fd;
     char * fn;

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2006-11-08 21:15:17 UTC (rev 
3675)
+++ GNUnet/src/applications/fs/fsui/upload.c    2006-11-10 07:04:37 UTC (rev 
3676)
@@ -228,7 +228,7 @@
   ret = ECRS_uploadFile(utc->shared->ctx->ectx,
                        utc->shared->ctx->cfg,
                        filename,
-                       utc->shared->doIndex,
+                       utc->shared->doIndex == YES ? (utc->child == NULL ? YES 
: NO) : NO,
                        utc->shared->anonymityLevel,
                        utc->shared->priority,
                        utc->shared->expiration,

Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c        2006-11-08 21:15:17 UTC 
(rev 3675)
+++ GNUnet/src/applications/fs/module/ondemand.c        2006-11-10 07:04:37 UTC 
(rev 3676)
@@ -256,11 +256,13 @@
 #endif
 
 #if DEBUG_ONDEMAND
-  IF_GELOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-       hash2enc(&key, &enc));
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "Storing on-demand content for query `%s'\n",
-      &enc);
+  IF_GELOG(ectx,
+ GE_DEBUG | GE_REQUEST | GE_USER,
+          hash2enc(&key, &enc));
+  GE_LOG(ectx,
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "Storing on-demand content for query `%s'\n",
+        &enc);
 #endif
 
   ret = datastore->get(&key,
@@ -313,9 +315,10 @@
 #if DEBUG_ONDEMAND
   hash2enc(query,
           &enc);
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      _("Indexed file disappeared, deleting block for query `%s'\n"),
-      &enc);
+  GE_LOG(ectx, 
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        _("Indexed file disappeared, deleting block for query `%s'\n"),
+        &enc);
 #endif
   /* schedule for "immediate" execution */
   cron_add_job(coreAPI->cron,
@@ -360,10 +363,13 @@
   if (fileHandle == -1) {
     char unavail_key[256];
     EncName enc;
-    cron_t * first_unavail;
+    unsigned long long * first_unavail;
     struct stat linkStat;
 
-    GE_LOG_STRERROR_FILE(ectx,GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "open", 
fn);
+    GE_LOG_STRERROR_FILE(ectx,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
+                        "open", 
+                        fn);
 
     /* Is the symlink there? */
     if (LSTAT(fn, &linkStat) == -1) {
@@ -378,7 +384,7 @@
               (char *) &enc);
       if (state->read(ectx,
                      unavail_key,
-                     (void *) &first_unavail) == SYSERR) {
+                     (void*)&first_unavail) != sizeof(cron_t)) {
         unsigned long long now = htonll(get_time());
         state->write(ectx,
                     unavail_key,
@@ -386,7 +392,7 @@
                     (void *) &now);
       } else {
         /* Delete it after 3 days */
-        if (*first_unavail - get_time() > 3 * cronDAYS) {
+        if (ntohll(*first_unavail) - get_time() > 3 * cronDAYS) {
          unsigned int len;
          char * ofn;
          int ret;
@@ -407,11 +413,12 @@
                 len*2);
                
           if (ret != -1) {
-            GE_LOG(ectx, GE_ERROR | GE_BULK | GE_USER,
-               _("Because the file `%s' has been unavailable for 3 days"
-                 " it got removed from your share.  Please unindex files 
before"
-                 " deleting them as the index now contains invalid 
references!\n"),
-               ofn);
+            GE_LOG(ectx,
+                  GE_ERROR | GE_BULK | GE_USER,
+                  _("Because the file `%s' has been unavailable for 3 days"
+                    " it got removed from your share.  Please unindex files 
before"
+                    " deleting them as the index now contains invalid 
references!\n"),
+                  ofn);
          }
          FREE(ofn);
          asyncDelete(datastore, dbv, query);
@@ -488,7 +495,9 @@
   FREE(db);
   FREE(fn);
   if (ret == SYSERR) {
-    GE_LOG(ectx, GE_ERROR | GE_BULK | GE_USER, "Indexed content does not match 
its hash.\n");
+    GE_LOG(ectx, 
+          GE_ERROR | GE_BULK | GE_USER, 
+          "Indexed content does not match its hash.\n");
     asyncDelete(datastore, dbv, query);
     return SYSERR;
   }

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2006-11-08 21:15:17 UTC 
(rev 3675)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2006-11-10 07:04:37 UTC 
(rev 3676)
@@ -49,6 +49,14 @@
 
 static int errorCode;
 
+static unsigned int downloads_running;
+
+static struct FSUI_DownloadList ** downloads;
+
+static unsigned int downloads_size;
+
+static struct MUTEX * lock;
+
 /**
  * All gnunet-download command line options
  */
@@ -78,6 +86,7 @@
  */
 static void * progressModel(void * unused,
                            const FSUI_Event * event) {
+  MUTEX_LOCK(lock);
   switch (event->type) {
   case FSUI_download_progress:
     if (verbose) {
@@ -112,18 +121,24 @@
           (event->data.DownloadCompleted.total/1024.0) /
           (((double)(get_time()-(start_time - 1)))
            / (double)cronSECONDS) );
-    if (dl == event->data.DownloadCompleted.dc.pos) {
+    downloads_running--;
+    if (downloads_running == 0) {
       errorCode = 0;
       GNUNET_SHUTDOWN_INITIATE();
     }
     break;
   case FSUI_download_started:
+    downloads_running++;
+    APPEND(downloads,
+          downloads_size,
+          event->data.DownloadStarted.dc.pos);
   case FSUI_download_stopped:
     break;
   default:
     GE_BREAK(ectx, 0);
     break;
   }
+  MUTEX_UNLOCK(lock);
   return NULL;
 }
 
@@ -198,6 +213,7 @@
     try_rename = YES;
   }
   ok = NO;
+  lock = MUTEX_CREATE(NO);
   ctx = FSUI_start(ectx,
                   cfg,
                   "gnunet-download",
@@ -219,13 +235,21 @@
   ECRS_freeMetaData(meta);
   if (dl == NULL) {
     FSUI_stop(ctx);
+    MUTEX_DESTROY(lock);
     goto quit;
   }
   GNUNET_SHUTDOWN_WAITFOR();
-  if (errorCode == 1)
-    FSUI_abortDownload(ctx, dl);
-  FSUI_stopDownload(ctx, dl);
+  if (errorCode == 1) {
+    for (i=0;i<downloads_size;i++)
+      FSUI_abortDownload(ctx, downloads[i]);
+  }
+  for (i=0;i<downloads_size;i++)
+    FSUI_stopDownload(ctx, downloads[i]);
+  GROW(downloads,
+       downloads_size,
+       0);
   FSUI_stop(ctx);
+  MUTEX_DESTROY(lock);
 
   if ( (errorCode == 0) &&
        (dl != NULL) &&

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2006-11-08 21:15:17 UTC 
(rev 3675)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2006-11-10 07:04:37 UTC 
(rev 3676)
@@ -22,6 +22,7 @@
  * @file applications/sqstore_sqlite/sqlite.c
  * @brief SQLite based implementation of the sqstore service
  * @author Nils Durner
+ * @author Christian Grothoff
  * @todo Estimation of DB size
  *
  * Database: SQLite
@@ -299,7 +300,21 @@
     return 8;
 }
 
+/**
+ * Get a (good) estimate of the size of the given
+ * value (and its key) in the datastore.<p>
+ * <pre>
+ * row length = hash length + block length + numbers + column count + 
estimated index size + 1 
+ * </pre>
+ */
+static unsigned int getContentDatastoreSize(const Datastore_Value * value) {
+  return sizeof(HashCode512) + ntohl(value->size) - sizeof(Datastore_Value)
+    + getIntSize(ntohl(value->size)) + getIntSize(ntohl(value->type)) + 
getIntSize(ntohl(value->prio))
+    + getIntSize(ntohl(value->anonymityLevel)) + 
getIntSize(ntohll(value->expirationTime)) + 7 + 245 + 1;
+}
 
+
+
 /**
  * Get the current on-disk size of the SQ store.  Estimates are fine,
  * if that's the only thing available.
@@ -322,8 +337,9 @@
  * Given a full row from gn070 table 
(size,type,prio,anonLevel,expire,hash,value),
  * assemble it into a Datastore_Datum representation.
  */
-static Datastore_Datum * assembleDatum(sqliteHandle * handle,
-                                      sqlite3_stmt *stmt) {
+static Datastore_Datum * 
+assembleDatum(sqliteHandle * handle,
+             sqlite3_stmt *stmt) {
   Datastore_Datum * datum;
   Datastore_Value * value;
   int contentSize;
@@ -335,9 +351,10 @@
   if (contentSize < 0) {
     sqlite3_stmt * stmt;
 
-    GE_LOG(ectx, GE_WARNING | GE_BULK | GE_USER,
-       _("Invalid data in %s.  Trying to fix (by deletion).\n"),
-       _("sqlite datastore"));
+    GE_LOG(ectx, 
+          GE_WARNING | GE_BULK | GE_USER,
+          _("Invalid data in %s.  Trying to fix (by deletion).\n"),
+          _("sqlite datastore"));
     if (sq_prepare(dbh,
                   "DELETE FROM gn070 WHERE size < ?", &stmt) == SQLITE_OK) {
       sqlite3_bind_int(stmt,
@@ -355,9 +372,10 @@
       sqlite3_column_bytes(stmt, 6) != contentSize) {
     sqlite3_stmt * stmt;
 
-    GE_LOG(ectx, GE_WARNING | GE_BULK | GE_USER,
-       _("Invalid data in %s.  Trying to fix (by deletion).\n"),
-       _("sqlite datastore"));
+    GE_LOG(ectx, 
+          GE_WARNING | GE_BULK | GE_USER,
+          _("Invalid data in %s.  Trying to fix (by deletion).\n"),
+          _("sqlite datastore"));
     if (sq_prepare(dbh,
                   "DELETE FROM gn070 WHERE NOT ((LENGTH(hash) = ?) AND (size = 
LENGTH(value) + ?))",
                    &stmt) == SQLITE_OK) {
@@ -884,7 +902,6 @@
               const Datastore_Value * value) {
   int n;
   sqlite3_stmt *stmt;
-  unsigned long rowLen;
   unsigned int contentSize;
   unsigned int size, type, prio, anon;
   unsigned long long expir;
@@ -896,8 +913,8 @@
           GE_DEBUG | GE_REQUEST | GE_USER,
           hash2enc(key,
                    &enc));
-  GE_LOG(ectx, G
-        E_DEBUG | GE_REQUEST | GE_USER,
+  GE_LOG(ectx, 
+        GE_DEBUG | GE_REQUEST | GE_USER,
         "Storing in database block with type %u, key `%s' and priority %u.\n",
         ntohl(*(int*)&value[1]),
         &enc,
@@ -908,24 +925,17 @@
     GE_BREAK(ectx, 0);
     return SYSERR;
   }
-
   dbh = getDBHandle();
   MUTEX_LOCK(db->DATABASE_Lock_);
-
   if (db->lastSync > 1000)
     syncStats(dbh);
-
-
-  rowLen = 0;
   contentSize = ntohl(value->size)-sizeof(Datastore_Value);
   stmt = dbh->insertContent;
-
   size = ntohl(value->size);
   type = ntohl(value->type);
   prio = ntohl(value->prio);
   anon = ntohl(value->anonymityLevel);
   expir = ntohll(value->expirationTime);
-
   sqlite3_bind_int(stmt, 1, size);
   sqlite3_bind_int(stmt, 2, type);
   sqlite3_bind_int(stmt, 3, prio);
@@ -933,7 +943,6 @@
   sqlite3_bind_int64(stmt, 5, expir);
   sqlite3_bind_blob(stmt, 6, key, sizeof(HashCode512), SQLITE_TRANSIENT);
   sqlite3_bind_blob(stmt, 7, &value[1], contentSize, SQLITE_TRANSIENT);
-
   n = sqlite3_step(stmt);
   sqlite3_reset(stmt);
   if (n != SQLITE_DONE) {
@@ -944,17 +953,13 @@
     return SYSERR;
   }
   db->lastSync++;
-  /* row length = hash length + block length + numbers + column count + 
estimated index size + 1 */
-  db->payload = db->payload + contentSize + sizeof(HashCode512) + 
getIntSize(size) + getIntSize(type) +
-       getIntSize(prio) + getIntSize(anon) + getIntSize(expir) + 7 + 245 + 1;
+  db->payload += getContentDatastoreSize(value);
   MUTEX_UNLOCK(db->DATABASE_Lock_);
-
 #if DEBUG_SQLITE
   GE_LOG(ectx,
         GE_DEBUG | GE_REQUEST | GE_USER,
         "SQLite: done writing content\n");
 #endif
-
   return OK;
 }
 
@@ -970,18 +975,26 @@
               const Datastore_Value * value) {
   size_t n;
   sqlite3_stmt *stmt;
-  unsigned long rowLen;
   int deleted;
   sqliteHandle *dbh;
+  Datastore_Datum * dvalue; 
+  unsigned int size;
+  unsigned int type;
+  unsigned int prio;
+  unsigned int anon;
+  unsigned long long expir;
+  unsigned long contentSize;
 #if DEBUG_SQLITE
   EncName enc;
 
-  IF_GELOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-       hash2enc(key,
-                &enc));
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "SQLite: deleting block with key `%s'\n",
-      &enc);
+  IF_GELOG(ectx, 
+          GE_DEBUG | GE_REQUEST | GE_USER,
+          hash2enc(key,
+                   &enc));
+  GE_LOG(ectx, 
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "SQLite: deleting block with key `%s'\n",
+        &enc);
 #endif
 
   dbh = getDBHandle();
@@ -989,77 +1002,68 @@
   if (db->lastSync > 1000)
     syncStats(dbh);
 
-  if (!value) {
-    sqlite3_bind_blob(dbh->exists,
+  if (NULL == value) {
+    if (sq_prepare(dbh->dbh,
+                  "SELECT size, type, prio, anonLevel, expire, hash, value "
+                  "FROM gn070 WHERE hash = ? ORDER BY prio ASC",
+                  &stmt) != SQLITE_OK) {
+      LOG_SQLITE(dbh,
+                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                "sqlite_query");
+      MUTEX_UNLOCK(db->DATABASE_Lock_);
+      return SYSERR;
+    }
+    sqlite3_bind_blob(stmt,
                      1,
                      key,
                      sizeof(HashCode512),
-                     SQLITE_TRANSIENT);
-    while(sqlite3_step(dbh->exists) == SQLITE_ROW) {   
-      /* row length = hash length + block length + numbers + column count + 
estimated index size + 1 */
-      rowLen = sqlite3_column_int(dbh->exists, 0) + 
sqlite3_column_int(dbh->exists, 1) +
-       sqlite3_column_int(dbh->exists, 2) + sqlite3_column_int(dbh->exists, 3) 
+
-       sqlite3_column_int(dbh->exists, 4) + sqlite3_column_int(dbh->exists, 5) 
+
-       sqlite3_column_int(dbh->exists, 6) + 7 + 245 + 1;
-
-      if (db->payload > rowLen)
-       db->payload -= rowLen;
-      else
-       db->payload = 0;
-
-      db->lastSync++;
+                     SQLITE_TRANSIENT);      
+    if (sqlite3_step(stmt) != SQLITE_ROW) {
+      sqlite3_finalize(stmt);
+      MUTEX_UNLOCK(db->DATABASE_Lock_);
+      return NO;
     }
-    sqlite3_reset(dbh->exists);
-
-    n = sq_prepare(dbh->dbh,
-                  "DELETE FROM gn070 WHERE hash = ?", /*  ORDER BY prio ASC 
LIMIT 1" -- not available */
-                  &stmt);
-    if (n == SQLITE_OK) {
-      sqlite3_bind_blob(stmt,
-                       1,
-                       key,
-                       sizeof(HashCode512),
-                       SQLITE_TRANSIENT);
-      n = sqlite3_step(stmt);
+    dvalue = assembleDatum(dbh,
+                          stmt);    
+    if (dvalue == NULL) {
+      sqlite3_finalize(stmt);
+      MUTEX_UNLOCK(db->DATABASE_Lock_);
+      return SYSERR;
     }
-    /* FIXME: this operation fails to update db->payload properly! */
+    sqlite3_finalize(stmt);
+    value = &dvalue->value;
   } else {
-    unsigned int size, type, prio, anon;
-    unsigned long long expir;
-    unsigned long contentSize;
-       
-    contentSize = ntohl(value->size)-sizeof(Datastore_Value);
-    n = sq_prepare(dbh->dbh,
-                  "DELETE FROM gn070 WHERE hash = ? and "
-                  "value = ? AND size = ? AND type = ? AND prio = ? AND 
anonLevel = ? "
-                  "AND expire = ?", /* ORDER BY prio ASC LIMIT 1" -- not 
available in sqlite */
-                  &stmt);
-    if (n == SQLITE_OK) {
-      size = ntohl(value->size);
-      type = ntohl(value->type);
-      prio = ntohl(value->prio);
-      anon = ntohl(value->anonymityLevel);
-      expir = ntohll(value->expirationTime);
-
-      sqlite3_bind_blob(stmt, 1, key, sizeof(HashCode512), SQLITE_TRANSIENT);
-      sqlite3_bind_blob(stmt, 2, &value[1], contentSize, SQLITE_TRANSIENT);
-      sqlite3_bind_int(stmt, 3, size);
-      sqlite3_bind_int(stmt, 4, type);
-      sqlite3_bind_int(stmt, 5, prio);
-      sqlite3_bind_int(stmt, 6, anon);
-      sqlite3_bind_int64(stmt, 7, expir);
-      n = sqlite3_step(stmt);
-      if ( (n == SQLITE_DONE) || (n == SQLITE_ROW) )
-       /* row length = hash length + block length + numbers + column count + 
estimated index size + 1 */
-       db->payload = db->payload - sizeof(HashCode512) - contentSize
-         - getIntSize(size) - getIntSize(type) - getIntSize(prio)
-         - getIntSize(anon) - getIntSize(expir) - 7 - 245 - 1;
-    } else {
-      LOG_SQLITE(dbh,
-                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
-                "sqlite3_prepare");
-    }
+    dvalue = NULL;
+  }    
+  contentSize = ntohl(value->size)-sizeof(Datastore_Value);
+  n = sq_prepare(dbh->dbh,
+                "DELETE FROM gn070 WHERE hash = ? and "
+                "value = ? AND size = ? AND type = ? AND prio = ? AND 
anonLevel = ? "
+                "AND expire = ?", /* ORDER BY prio ASC LIMIT 1" -- not 
available in sqlite */
+                &stmt);
+  if (n == SQLITE_OK) {
+    size = ntohl(value->size);
+    type = ntohl(value->type);
+    prio = ntohl(value->prio);
+    anon = ntohl(value->anonymityLevel);
+    expir = ntohll(value->expirationTime);
+    
+    sqlite3_bind_blob(stmt, 1, key, sizeof(HashCode512), SQLITE_TRANSIENT);
+    sqlite3_bind_blob(stmt, 2, &value[1], contentSize, SQLITE_TRANSIENT);
+    sqlite3_bind_int(stmt, 3, size);
+    sqlite3_bind_int(stmt, 4, type);
+    sqlite3_bind_int(stmt, 5, prio);
+    sqlite3_bind_int(stmt, 6, anon);
+    sqlite3_bind_int64(stmt, 7, expir);
+    n = sqlite3_step(stmt);
+    if ( (n == SQLITE_DONE) || (n == SQLITE_ROW) )
+      db->payload -= getContentDatastoreSize(value);
+  } else {
+    LOG_SQLITE(dbh,
+              GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+              "sqlite3_prepare");
   }
+  FREENONNULL(dvalue);
   deleted = ( (n == SQLITE_DONE) || (n == SQLITE_ROW) ) ? 
sqlite3_changes(dbh->dbh) : SYSERR;
   sqlite3_finalize(stmt);
 
@@ -1149,7 +1153,6 @@
 
   char *dir;
   char *afsdir;
-  size_t nX;
   sqliteHandle *dbh;
 
   ectx = capi->ectx;

Modified: GNUnet/src/applications/transport/transport.c
===================================================================
--- GNUnet/src/applications/transport/transport.c       2006-11-08 21:15:17 UTC 
(rev 3675)
+++ GNUnet/src/applications/transport/transport.c       2006-11-10 07:04:37 UTC 
(rev 3676)
@@ -591,58 +591,60 @@
                                                    "TRANSPORTS",
                                                    "udp tcp nat",
                                                    &dso));
-  GE_LOG(ectx,
-        GE_INFO | GE_USER | GE_BULK,
-        _("Loading transports `%s'\n"),
-        dso);
-  next = dso;
-  do {
-    pos = next;
-    while ( (*next != '\0') &&
-           (*next != ' ') )
-      next++;
-    if (*next == '\0')
-      next = NULL; /* terminate! */
-    else {
-      *next = '\0'; /* add 0-termination for pos */
-      next++;
-    }
-    lib = os_plugin_load(ectx,
-                        "libgnunettransport_",
-                        pos);
-    if (lib == NULL) {
+  if (strlen(dso) != 0) {
+    GE_LOG(ectx,
+          GE_INFO | GE_USER | GE_BULK,
+          _("Loading transports `%s'\n"),
+          dso);
+    next = dso;
+    do {
+      pos = next;
+      while ( (*next != '\0') &&
+             (*next != ' ') )
+       next++;
+      if (*next == '\0')
+       next = NULL; /* terminate! */
+      else {
+       *next = '\0'; /* add 0-termination for pos */
+       next++;
+      }
+      lib = os_plugin_load(ectx,
+                          "libgnunettransport_",
+                          pos);
+      if (lib == NULL) {
+       GE_LOG(ectx,
+              GE_ERROR | GE_USER | GE_ADMIN | GE_IMMEDIATE,
+              _("Could not load transport plugin `%s'\n"),
+              pos);
+       continue;
+      }
+      tptr = os_plugin_resolve_function(lib,
+                                       "inittransport_",
+                                       YES);
+      if (tptr == NULL) {
+       GE_LOG(ectx,
+              GE_ERROR | GE_ADMIN | GE_USER | GE_DEVELOPER | GE_IMMEDIATE,
+              _("Transport library `%s' did not provide required function 
'%s%s'.\n"),
+              pos,
+              "inittransport_",
+              pos);
+       os_plugin_unload(lib);
+       continue;
+      }
+      tapi = tptr(&ctapi);
+      if (tapi == NULL) {
+       os_plugin_unload(lib);
+       continue;
+      }
+      tapi->libHandle = lib;
+      tapi->transName = STRDUP(pos);
+      addTransport(tapi);
       GE_LOG(ectx,
-            GE_ERROR | GE_USER | GE_ADMIN | GE_IMMEDIATE,
-            _("Could not load transport plugin `%s'\n"),
+            GE_INFO | GE_USER | GE_BULK,
+            _("Loaded transport `%s'\n"),
             pos);
-      continue;
-    }
-    tptr = os_plugin_resolve_function(lib,
-                                     "inittransport_",
-                                     YES);
-    if (tptr == NULL) {
-      GE_LOG(ectx,
-            GE_ERROR | GE_ADMIN | GE_USER | GE_DEVELOPER | GE_IMMEDIATE,
-            _("Transport library `%s' did not provide required function 
'%s%s'.\n"),
-            pos,
-            "inittransport_",
-            pos);
-      os_plugin_unload(lib);
-      continue;
-    }
-    tapi = tptr(&ctapi);
-    if (tapi == NULL) {
-      os_plugin_unload(lib);
-      continue;
-    }
-    tapi->libHandle = lib;
-    tapi->transName = STRDUP(pos);
-    addTransport(tapi);
-    GE_LOG(ectx,
-          GE_INFO | GE_USER | GE_BULK,
-          _("Loaded transport `%s'\n"),
-          pos);
-  } while (next != NULL);
+    } while (next != NULL);
+  }
   FREE(dso);
 
   IF_GELOG(ectx,

Modified: GNUnet/src/util/boot/startup.c
===================================================================
--- GNUnet/src/util/boot/startup.c      2006-11-08 21:15:17 UTC (rev 3675)
+++ GNUnet/src/util/boot/startup.c      2006-11-10 07:04:37 UTC (rev 3676)
@@ -30,6 +30,8 @@
 #include "gnunet_util_error_loggers.h"
 #include "platform.h"
 
+#define DO_REQUEST YES
+
 static GE_KIND 
 convertLogLevel(const char * level) {
   GE_KIND ret;
@@ -111,7 +113,13 @@
   FREE(admin_log_file);
   if (ull != 0) {
     tetx = GE_create_context_stderr(NO,
-                                   ull | GE_USERKIND | GE_BULK | GE_IMMEDIATE);
+                                   ull 
+                                   | GE_USERKIND 
+#if DO_REQUEST
+                                   | GE_REQUEST
+#endif
+                                   | GE_BULK 
+                                   | GE_IMMEDIATE);
     if (nctx == NULL)
       nctx = tetx;
     else
@@ -143,7 +151,7 @@
   int i;
   char *path;
 
- #if ENABLE_NLS
+#if ENABLE_NLS
   setlocale (LC_ALL, "");
   path = os_get_installation_path(IPK_LOCALEDIR);
   BINDTEXTDOMAIN("GNUnet", path);

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-11-08 21:15:17 UTC (rev 3675)
+++ GNUnet/todo 2006-11-10 07:04:37 UTC (rev 3676)
@@ -14,10 +14,7 @@
 
 0.7.1 [11'06] (aka "stabilization")
 - fix critical known bugs:
-  * recursive gnunet-download stopped working [RCpre0]
-    ?: no reply from gnunetd (we seem to send queries, but gnunetd does not 
respond!)
-       => insert error? wrong query?
-  * gnunet-download stopped working [RCpre0]
+  * recursive gnunet-download results in ".gnd"-named directories 
(unclean/regression!) [RCpre0]
     Possibly related to #1144, #1143
   * fix connection problem reported by Nils! [RCpre0]
     Maybe only an issue with connections to 0.7.0e?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]