gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5585 - in GNUnet/src: applications/dstore applications/fs/


From: gnunet
Subject: [GNUnet-SVN] r5585 - in GNUnet/src: applications/dstore applications/fs/module applications/session applications/sqstore_sqlite server setup/gtk transports
Date: Sun, 2 Sep 2007 18:21:41 -0600 (MDT)

Author: grothoff
Date: 2007-09-02 18:21:41 -0600 (Sun, 02 Sep 2007)
New Revision: 5585

Modified:
   GNUnet/src/applications/dstore/dstore.c
   GNUnet/src/applications/fs/module/fs.c
   GNUnet/src/applications/fs/module/migration.c
   GNUnet/src/applications/session/connect.c
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
   GNUnet/src/server/connection.c
   GNUnet/src/setup/gtk/about.c
   GNUnet/src/setup/gtk/ngconf.c
   GNUnet/src/transports/http.c
   GNUnet/src/transports/tcp.c
   GNUnet/src/transports/udp.c
   GNUnet/src/transports/udp_helper.c
Log:
code cleanup

Modified: GNUnet/src/applications/dstore/dstore.c
===================================================================
--- GNUnet/src/applications/dstore/dstore.c     2007-09-01 03:05:37 UTC (rev 
5584)
+++ GNUnet/src/applications/dstore/dstore.c     2007-09-03 00:21:41 UTC (rev 
5585)
@@ -91,6 +91,13 @@
 
 #define SQLITE3_EXEC(db, cmd) do { if (SQLITE_OK != sqlite3_exec(db, cmd, 
NULL, NULL, &emsg)) { GE_LOG(coreAPI->ectx, GE_ERROR | GE_ADMIN | GE_BULK, 
_("`%s' failed at %s:%d with error: %s\n"), "sqlite3_exec", __FILE__, __LINE__, 
emsg); sqlite3_free(emsg); } } while(0);
 
+/**
+ * Log an error message at log-level 'level' that indicates
+ * a failure of the command 'cmd' on file 'filename'
+ * with the message given by strerror(errno).
+ */
+#define LOG_SQLITE(db, level, cmd) do { GE_LOG(ectx, level, _("`%s' failed at 
%s:%d with error: %s\n"), cmd, __FILE__, __LINE__, sqlite3_errmsg(db->dbh)); } 
while(0);
+
 static void
 db_init (sqlite3 * dbh)
 {
@@ -341,15 +348,33 @@
       MUTEX_UNLOCK (lock);
       return SYSERR;
     }
-  sqlite3_bind_int (stmt, 1, size);
-  sqlite3_bind_int (stmt, 2, type);
-  sqlite3_bind_int64 (stmt, 3, get_time ());
-  sqlite3_bind_int64 (stmt, 4, discard_time);
-  sqlite3_bind_blob (stmt, 5, key, sizeof (HashCode512), SQLITE_TRANSIENT);
-  sqlite3_bind_blob (stmt, 6, data, size, SQLITE_TRANSIENT);
-  sqlite3_step (stmt);
-  sqlite3_finalize (stmt);
-  payload += size + OVERHEAD;
+  if ((SQLITE_OK == sqlite3_bind_int (stmt, 1, size)) &&
+      (SQLITE_OK == sqlite3_bind_int (stmt, 2, type)) &&
+      (SQLITE_OK == sqlite3_bind_int64 (stmt, 3, get_time ())) &&
+      (SQLITE_OK == sqlite3_bind_int64 (stmt, 4, discard_time)) &&
+      (SQLITE_OK ==
+       sqlite3_bind_blob (stmt, 5, key, sizeof (HashCode512),
+                          SQLITE_TRANSIENT))
+      && (SQLITE_OK ==
+          sqlite3_bind_blob (stmt, 6, data, size, SQLITE_TRANSIENT)))
+    {
+      if (SQLITE_DONE != sqlite3_step (stmt))
+        LOG_SQLITE (dbh,
+                    GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                    "sqlite3_step");
+      else
+        payload += size + OVERHEAD;
+      if (SQLITE_OK != sqlite3_finalize (stmt))
+        LOG_SQLITE (dbh,
+                    GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                    "sqlite3_finalize");
+    }
+  else
+    {
+      LOG_SQLITE (dbh,
+                  GE_ERROR | GE_DEVELOPER | GE_ADMIN | GE_BULK,
+                  "sqlite3_bind_xxx");
+    }
 #if DEBUG_DSTORE
   GE_LOG (coreAPI->ectx,
           GE_DEBUG | GE_REQUEST | GE_DEVELOPER,

Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c      2007-09-01 03:05:37 UTC (rev 
5584)
+++ GNUnet/src/applications/fs/module/fs.c      2007-09-03 00:21:41 UTC (rev 
5585)
@@ -1273,9 +1273,7 @@
   LG_Job *job;
   void *unused;
 
-  GE_LOG (ectx,
-          GE_DEBUG | GE_REQUEST | GE_USER,
-          "fs shutdown\n");
+  GE_LOG (ectx, GE_DEBUG | GE_REQUEST | GE_USER, "fs shutdown\n");
   doneMigration ();
   GE_ASSERT (ectx,
              SYSERR !=

Modified: GNUnet/src/applications/fs/module/migration.c
===================================================================
--- GNUnet/src/applications/fs/module/migration.c       2007-09-01 03:05:37 UTC 
(rev 5584)
+++ GNUnet/src/applications/fs/module/migration.c       2007-09-03 00:21:41 UTC 
(rev 5585)
@@ -162,7 +162,7 @@
           discard_time = now;
           if (OK != datastore->getRandom (&content[i].key, &content[i].value))
             {
-              content[i].value = NULL;      /* just to be sure... */
+              content[i].value = NULL;  /* just to be sure... */
               continue;
             }
           else

Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c   2007-09-01 03:05:37 UTC (rev 
5584)
+++ GNUnet/src/applications/session/connect.c   2007-09-03 00:21:41 UTC (rev 
5585)
@@ -491,7 +491,7 @@
               GE_ERROR | GE_USER | GE_IMMEDIATE,
               _("Could not create any HELLO for myself!\n"));
     }
-#if DEBUG_SESSION 
+#if DEBUG_SESSION
   GE_LOG (ectx,
           GE_DEBUG | GE_USER | GE_REQUEST,
           "Sending session key  to peer `%s'.\n", &enc);

Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-09-01 03:05:37 UTC 
(rev 5584)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-09-03 00:21:41 UTC 
(rev 5585)
@@ -355,7 +355,7 @@
   if (SQLITE_DONE != sqlite3_step (stmt))
     {
       LOG_SQLITE (handle,
-                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite_step");
+                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_step");
       sqlite3_finalize (stmt);
       return SYSERR;
     }
@@ -393,22 +393,26 @@
               _("Invalid data in %s (NCS).  Trying to fix (by deletion).\n"),
               _("sqlite datastore"));
       if (1)
-       abort();
+        abort ();
       if (SQLITE_OK != sqlite3_reset (stmt))
-       LOG_SQLITE (handle,
-                   GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
+        LOG_SQLITE (handle,
+                    GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
       if (sq_prepare (dbh,
-                      "DELETE FROM gn070 WHERE size < ?", &stmtd) == SQLITE_OK)
+                      "DELETE FROM gn070 WHERE size < ?",
+                      &stmtd) == SQLITE_OK)
         {
-          if (SQLITE_OK != sqlite3_bind_int (stmtd, 1, sizeof 
(Datastore_Value)))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_bind_int");       
-          if (SQLITE_DONE != sqlite3_step (stmtd)) 
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_step");
+          if (SQLITE_OK !=
+              sqlite3_bind_int (stmtd, 1, sizeof (Datastore_Value)))
+            LOG_SQLITE (handle, GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_bind_int");
+          if (SQLITE_DONE != sqlite3_step (stmtd))
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_step");
           if (SQLITE_OK != sqlite3_finalize (stmtd))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_finalize");
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_finalize");
         }
       else
         LOG_SQLITE (handle,
@@ -419,32 +423,36 @@
   if (sqlite3_column_bytes (stmt, 5) != sizeof (HashCode512) ||
       sqlite3_column_bytes (stmt, 6) != contentSize)
     {
-      sqlite3_stmt *stmt;
+      sqlite3_stmt *stmtd;
 
       GE_LOG (ectx,
               GE_WARNING | GE_BULK | GE_USER,
               _("Invalid data in %s.  Trying to fix (by deletion).\n"),
               _("sqlite datastore"));
       if (SQLITE_OK != sqlite3_reset (stmt))
-       LOG_SQLITE (handle,
-                   GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
-     if (sq_prepare (dbh,
+        LOG_SQLITE (handle,
+                    GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
+      if (sq_prepare (dbh,
                       "DELETE FROM gn070 WHERE NOT ((LENGTH(hash) = ?) AND 
(size = LENGTH(value) + ?))",
-                      &stmt) == SQLITE_OK)
+                      &stmtd) == SQLITE_OK)
         {
-          if (SQLITE_OK != sqlite3_bind_int (stmt, 1, sizeof (HashCode512)))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_bind_int");     
-         if (SQLITE_OK != sqlite3_bind_int (stmt, 2, sizeof (Datastore_Value)))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_bind_int");       
-          if (SQLITE_DONE != sqlite3_step (stmt))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_step");
-         if (SQLITE_OK != sqlite3_finalize (stmt))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_finalize");
-       }
+          if (SQLITE_OK != sqlite3_bind_int (stmtd, 1, sizeof (HashCode512)))
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_bind_int");
+          if (SQLITE_OK !=
+              sqlite3_bind_int (stmtd, 2, sizeof (Datastore_Value)))
+            LOG_SQLITE (handle, GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_bind_int");
+          if (SQLITE_DONE != sqlite3_step (stmtd))
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_step");
+          if (SQLITE_OK != sqlite3_finalize (stmtd))
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_finalize");
+        }
       else
         LOG_SQLITE (handle,
                     GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sq_prepare");
@@ -523,7 +531,10 @@
                   "DELETE FROM gn070 where hash = ?", &stmt) == SQLITE_OK)
     {
       sqlite3_bind_text (stmt, 1, key, strlen (key), SQLITE_STATIC);
-      sqlite3_step (stmt);
+      if (SQLITE_DONE != sqlite3_step (stmt))
+        LOG_SQLITE (handle,
+                    GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_step");
+
       sqlite3_finalize (stmt);
     }
 
@@ -531,13 +542,21 @@
                   "INSERT INTO gn070(hash, expire, type) VALUES (?, ?, ?)",
                   &stmt) != SQLITE_OK)
     return SYSERR;
-  sqlite3_bind_text (stmt, 1, key, strlen (key), SQLITE_STATIC);
-  sqlite3_bind_int64 (stmt, 2, val);
-  sqlite3_bind_int (stmt, 3, RESERVED_BLOCK);
+  if ((SQLITE_OK !=
+       sqlite3_bind_text (stmt, 1, key, strlen (key), SQLITE_STATIC))
+      || (SQLITE_OK != sqlite3_bind_int64 (stmt, 2, val))
+      || (SQLITE_OK != sqlite3_bind_int (stmt, 3, RESERVED_BLOCK)))
+    {
+      LOG_SQLITE (handle,
+                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                  "sqlite3_bind_xxx");
+      sqlite3_finalize (stmt);
+      return SYSERR;
+    }
   if (sqlite3_step (stmt) != SQLITE_DONE)
     {
       LOG_SQLITE (handle,
-                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite_setStat");
+                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_step");
       sqlite3_finalize (stmt);
       return SYSERR;
     }
@@ -702,9 +721,10 @@
         {
           datum = assembleDatum (handle, stmt, &key, &rowid);
           if (SQLITE_OK != sqlite3_reset (stmt))
-           LOG_SQLITE (handle,
-                       GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, 
"sqlite3_reset");
-         if (datum == NULL)
+            LOG_SQLITE (handle,
+                        GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                        "sqlite3_reset");
+          if (datum == NULL)
             continue;
 #if 0
           printf ("FOUND %4u prio %4u exp %20llu old: %4u, %20llu\n",
@@ -921,7 +941,7 @@
   unsigned int idx;
 
   if (fn == NULL)
-    return; /* already down */
+    return;                     /* already down */
 #if DEBUG_SQLITE
   GE_LOG (ectx,
           GE_DEBUG | GE_REQUEST | GE_USER, "SQLite: closing database\n");
@@ -1027,15 +1047,16 @@
           ret = sqlite3_step (stmt);
           if (ret != SQLITE_ROW)
             break;
-         if (iter == NULL) {
-           count = sqlite3_column_int (stmt, 0); 
-           sqlite3_reset (stmt);
-           sqlite3_finalize (stmt);
-           MUTEX_UNLOCK (lock);
-           return count;
-         }
-         datum = assembleDatum (handle, stmt, &rkey, &rowid);
-         last_rowid = rowid;
+          if (iter == NULL)
+            {
+              count = sqlite3_column_int (stmt, 0);
+              sqlite3_reset (stmt);
+              sqlite3_finalize (stmt);
+              MUTEX_UNLOCK (lock);
+              return count;
+            }
+          datum = assembleDatum (handle, stmt, &rkey, &rowid);
+          last_rowid = rowid;
           sqlite3_reset (stmt);
           if (datum == NULL)
             continue;
@@ -1046,9 +1067,9 @@
               FREE (datum);
               continue;
             }
-         MUTEX_UNLOCK (lock);
-         ret = iter (&rkey, datum, closure, rowid);
-         MUTEX_LOCK (lock);    
+          MUTEX_UNLOCK (lock);
+          ret = iter (&rkey, datum, closure, rowid);
+          MUTEX_LOCK (lock);
           if (ret == SYSERR)
             {
               count = SYSERR;
@@ -1113,21 +1134,27 @@
   prio = ntohl (value->prio);
   anon = ntohl (value->anonymityLevel);
   expir = ntohll (value->expirationTime);
-  if ( (SQLITE_OK != sqlite3_bind_int (stmt, 1, size)) ||
-       (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
-       (SQLITE_OK != sqlite3_bind_int (stmt, 3, prio)) ||
-       (SQLITE_OK != sqlite3_bind_int (stmt, 4, anon)) ||
-       (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expir)) ||
-       (SQLITE_OK != sqlite3_bind_blob (stmt, 6, key, sizeof (HashCode512), 
SQLITE_TRANSIENT)) ||
-       (SQLITE_OK != sqlite3_bind_blob (stmt, 7, &value[1], contentSize, 
SQLITE_TRANSIENT)) ) {
-    LOG_SQLITE (dbh,
-               GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_bind_XXXX");  
    
-    if (SQLITE_OK != sqlite3_reset (stmt))
+  if ((SQLITE_OK != sqlite3_bind_int (stmt, 1, size)) ||
+      (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
+      (SQLITE_OK != sqlite3_bind_int (stmt, 3, prio)) ||
+      (SQLITE_OK != sqlite3_bind_int (stmt, 4, anon)) ||
+      (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expir)) ||
+      (SQLITE_OK !=
+       sqlite3_bind_blob (stmt, 6, key, sizeof (HashCode512),
+                          SQLITE_TRANSIENT))
+      || (SQLITE_OK !=
+          sqlite3_bind_blob (stmt, 7, &value[1], contentSize,
+                             SQLITE_TRANSIENT)))
+    {
       LOG_SQLITE (dbh,
-                 GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");    
    
-    MUTEX_UNLOCK (lock);
-    return SYSERR;
-  }
+                  GE_ERROR | GE_ADMIN | GE_USER | GE_BULK,
+                  "sqlite3_bind_XXXX");
+      if (SQLITE_OK != sqlite3_reset (stmt))
+        LOG_SQLITE (dbh,
+                    GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
+      MUTEX_UNLOCK (lock);
+      return SYSERR;
+    }
 
   n = sqlite3_step (stmt);
   if (n != SQLITE_DONE)
@@ -1146,7 +1173,7 @@
     }
   if (SQLITE_OK != sqlite3_reset (stmt))
     LOG_SQLITE (dbh,
-               GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");      
    
+                GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_reset");
   lastSync++;
   payload += getContentDatastoreSize (value);
 #if DEBUG_SQLITE
@@ -1174,7 +1201,7 @@
   sqlite3_bind_int64 (dbh->updPrio, 3, uid);
   n = sqlite3_step (dbh->updPrio);
   if (n != SQLITE_DONE)
-    LOG_SQLITE (dbh, GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite_step");
+    LOG_SQLITE (dbh, GE_ERROR | GE_ADMIN | GE_USER | GE_BULK, "sqlite3_step");
 
   sqlite3_reset (dbh->updPrio);
 

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/server/connection.c      2007-09-03 00:21:41 UTC (rev 5585)
@@ -971,9 +971,9 @@
     {
       if (priority >= EXTREME_PRIORITY)
         return OK;              /* allow administrative msgs */
-      return SYSERR;          /* but nothing else */
+      return SYSERR;            /* but nothing else */
     }
-  if (load <= 75 + overhead) 
+  if (load <= 75 + overhead)
     return OK;
   delta = load - overhead - 75;
   /* Now delta in [0, 25] */
@@ -1022,7 +1022,7 @@
   if (be->session.mtu == 0)
     {
       msf =                     /* ms per message */
-        EXPECTED_MTU / (be->max_bpm * cronMINUTES / cronMILLIS); /* bytes per 
ms */
+        EXPECTED_MTU / (be->max_bpm * cronMINUTES / cronMILLIS);        /* 
bytes per ms */
     }
   else
     {
@@ -1526,7 +1526,7 @@
           GROW (be->sendBuffer, be->sendBufferSize, ret);
           /* calling fragment will change be->sendBuffer;
              thus we need to restart from the beginning afterwards... */
-         be->consider_transport_switch = YES;
+          be->consider_transport_switch = YES;
           fragmentation->fragment (&be->session.sender,
                                    be->session.mtu -
                                    sizeof (P2P_PACKET_HEADER), entry->pri,
@@ -1616,17 +1616,16 @@
   /* test if receiver has enough bandwidth available!  */
   updateCurBPS (be);
   totalMessageSize = selectMessagesToSend (be, &priority);
-  if ( (totalMessageSize == 0) &&
-       ( (be->sendBufferSize != 0) ||
-        (be->session.mtu != 0) || /* only if transport has congestion control! 
*/
-        (be->available_send_window < 2 * EXPECTED_MTU) ) )
+  if ((totalMessageSize == 0) && ((be->sendBufferSize != 0) || 
(be->session.mtu != 0) ||        /* only if transport has congestion control! */
+                                  (be->available_send_window <
+                                   2 * EXPECTED_MTU)))
     {
       expireSendBufferEntries (be);
       be->inSendBuffer = NO;
       return NO;                /* deferr further */
     }
-  if (totalMessageSize == 0) 
-    totalMessageSize = EXPECTED_MTU + sizeof(P2P_PACKET_HEADER);
+  if (totalMessageSize == 0)
+    totalMessageSize = EXPECTED_MTU + sizeof (P2P_PACKET_HEADER);
   GE_ASSERT (ectx, totalMessageSize > sizeof (P2P_PACKET_HEADER));
   if ((be->session.mtu != 0) && (totalMessageSize > be->session.mtu))
     {
@@ -1660,7 +1659,7 @@
 #endif
 #if STRICT_STAT_DOWN
           be->status = STAT_DOWN;
-         be->time_established = 0;
+          be->time_established = 0;
 #endif
           if (stats != NULL)
             stats->change (stat_closedTransport, 1);
@@ -1689,8 +1688,7 @@
      if so, trigger callbacks on selected entries; if either
      fails, return (but clean up garbage) */
   if (SYSERR == outgoingCheck (priority,
-                                totalMessageSize /
-                              sizeof (P2P_PACKET_HEADER)))
+                               totalMessageSize / sizeof (P2P_PACKET_HEADER)))
     {
       expireSendBufferEntries (be);
       be->inSendBuffer = NO;
@@ -1699,20 +1697,23 @@
 
   /* get permutation of SendBuffer Entries
      such that SE_FLAGS are obeyed */
-  if (0 != prepareSelectedMessages (be)) {
-    entries = permuteSendBuffer (be, &stotal);
-    if ((stotal == 0) || (entries == NULL))
-      {
-       /* no messages selected!? */
-       GE_BREAK (ectx, 0);
-       be->inSendBuffer = NO;
-       FREE (entries);
-       return NO;
-      }
-  } else {
-    entries = NULL;
-    stotal = 0;
-  }
+  if (0 != prepareSelectedMessages (be))
+    {
+      entries = permuteSendBuffer (be, &stotal);
+      if ((stotal == 0) || (entries == NULL))
+        {
+          /* no messages selected!? */
+          GE_BREAK (ectx, 0);
+          be->inSendBuffer = NO;
+          FREE (entries);
+          return NO;
+        }
+    }
+  else
+    {
+      entries = NULL;
+      stotal = 0;
+    }
 
   /* build message */
   plaintextMsg = MALLOC (totalMessageSize);
@@ -1856,7 +1857,7 @@
       be->session.tsession = NULL;
 #if STRICT_STAT_DOWN
       be->status = STAT_DOWN;
-      be->time_established = 0;      
+      be->time_established = 0;
 #endif
       if (stats != NULL)
         stats->change (stat_closedTransport, 1);
@@ -2289,7 +2290,7 @@
   if (timeDifference < MIN_SAMPLE_TIME)
     {
       earlyRun = 1;
-      if (activePeerCount > CONNECTION_MAX_HOSTS_ / 8) 
+      if (activePeerCount > CONNECTION_MAX_HOSTS_ / 8)
         {
           MUTEX_UNLOCK (lock);
           return;               /* don't update too frequently, we need at 
least some
@@ -2554,35 +2555,44 @@
   /* add the remaining MIN_BPM_PER_PEER to the minCon peers
      with the highest connection uptimes; by linking this with
      connection uptime, we reduce fluctuation */
-  if (activePeerCount > 0) {
-    if (minCon >= activePeerCount) {
-      /* in this case, just add to all peers */
-      for (u = 0; u < minCon; u++) {
-       entries[u % activePeerCount]->idealized_limit
-         += MIN_BPM_PER_PEER;
-      }
-    } else { /* minCon < activePeerCount */
-      min_uptime = get_time();
-      min_uptime_slot = -1;
-      for (v=0;v<activePeerCount;v++) 
-       entries[v]->tes_selected = NO;
-      for (u = 0; u < minCon; u++) {
-       for (v=0;v<activePeerCount;v++) {
-         if ( (entries[v]->time_established != 0) &&
-              (entries[v]->time_established < min_uptime) &&
-              (entries[v]->tes_selected == NO) ) {
-           min_uptime_slot = v;
-           min_uptime = entries[v]->time_established;
-         }
-       }
-       if (min_uptime_slot != -1) {
-         entries[min_uptime_slot]->tes_selected = YES;
-         entries[min_uptime_slot]->idealized_limit
-           += MIN_BPM_PER_PEER;          
-       }
-      } /* for minCon */
-    } /* if minCon < activePeerCount */
-  } /* if we had active peers */
+  if (activePeerCount > 0)
+    {
+      if (minCon >= activePeerCount)
+        {
+          /* in this case, just add to all peers */
+          for (u = 0; u < minCon; u++)
+            {
+              entries[u % activePeerCount]->idealized_limit
+                += MIN_BPM_PER_PEER;
+            }
+        }
+      else
+        {                       /* minCon < activePeerCount */
+          min_uptime = get_time ();
+          min_uptime_slot = -1;
+          for (v = 0; v < activePeerCount; v++)
+            entries[v]->tes_selected = NO;
+          for (u = 0; u < minCon; u++)
+            {
+              for (v = 0; v < activePeerCount; v++)
+                {
+                  if ((entries[v]->time_established != 0) &&
+                      (entries[v]->time_established < min_uptime) &&
+                      (entries[v]->tes_selected == NO))
+                    {
+                      min_uptime_slot = v;
+                      min_uptime = entries[v]->time_established;
+                    }
+                }
+              if (min_uptime_slot != -1)
+                {
+                  entries[min_uptime_slot]->tes_selected = YES;
+                  entries[min_uptime_slot]->idealized_limit
+                    += MIN_BPM_PER_PEER;
+                }
+            }                   /* for minCon */
+        }                       /* if minCon < activePeerCount */
+    }                           /* if we had active peers */
 
   /* prepare for next round */
   lastRoundStart = now;
@@ -2596,9 +2606,9 @@
               GE_DEBUG | GE_BULK | GE_USER,
               "inbound limit for peer %u: %4s set to %u bpm (ARR: %lld, 
uptime: %llus, value: %lf)\n",
               u, &enc, entries[u]->idealized_limit,
-             adjustedRR[u],
-             (get_time() - entries[u]->time_established) / cronSECONDS,
-             entries[u]->current_connection_value);
+              adjustedRR[u],
+              (get_time () - entries[u]->time_established) / cronSECONDS,
+              entries[u]->current_connection_value);
 #endif
       if ((timeDifference > 50) && (weak_randomi (timeDifference + 1) > 50))
         entries[u]->current_connection_value *= 0.9;    /* age */
@@ -2713,7 +2723,7 @@
               root = root->overflowChain;
               FREE (tmp);
               continue;         /* no need to call 'send buffer' */
-            case STAT_UP:            
+            case STAT_UP:
               updateCurBPS (root);
               total_allowed_sent += root->max_bpm;
               total_allowed_recv += root->idealized_limit;
@@ -2741,24 +2751,26 @@
                                            YES);
                   shutdownConnection (root);
                 }
-             if ( (root->consider_transport_switch == YES) &&             
-                  (load_cpu < 50) ) {
-               TSession * alternative;
+              if ((root->consider_transport_switch == YES) && (load_cpu < 50))
+                {
+                  TSession *alternative;
 
-               GE_BREAK(NULL, root->session.mtu != 0);
-               alternative = transport->connectFreely(&root->session.sender,
-                                                      NO,
-                                                      __FILE__);
-               if ( (alternative != NULL) &&
-                    (transport->getMTU(alternative->ttype) == 0) ) {
-                 transport->disconnect(root->session.tsession, __FILE__);
-                 root->session.mtu = 0;
-                 root->session.tsession = alternative;
-                 root->consider_transport_switch = NO;
-                 if (stats != NULL)
-                   stats->change (stat_transport_switches, 1);
-               }
-             }
+                  GE_BREAK (NULL, root->session.mtu != 0);
+                  alternative =
+                    transport->connectFreely (&root->session.sender, NO,
+                                              __FILE__);
+                  if ((alternative != NULL)
+                      && (transport->getMTU (alternative->ttype) == 0))
+                    {
+                      transport->disconnect (root->session.tsession,
+                                             __FILE__);
+                      root->session.mtu = 0;
+                      root->session.tsession = alternative;
+                      root->consider_transport_switch = NO;
+                      if (stats != NULL)
+                        stats->change (stat_transport_switches, 1);
+                    }
+                }
               if ((root->available_send_window > 35 * 1024) &&
                   (root->sendBufferSize < 4) &&
                   (scl_nextHead != NULL) &&
@@ -3142,7 +3154,7 @@
                   "Received confirmation that session is UP for `%s'\n",
                   &enc);
 #endif
-         be->time_established = get_time();
+          be->time_established = get_time ();
           be->status = STAT_UP;
           be->lastSequenceNumberReceived = 0;
           be->lastSequenceNumberSend = 1;
@@ -3326,10 +3338,10 @@
      to get to know each other). See also transport paper and the
      data on throughput. - CG
    */
-  if ( ( (transport->getCost (tsession->ttype) < cost) ||
-        ( (be->consider_transport_switch == YES) &&
-          (transport->getMTU(tsession->ttype) == 0) ) ) &&
-       (OK == transport->associate (tsession, __FILE__)) )
+  if (((transport->getCost (tsession->ttype) < cost) ||
+       ((be->consider_transport_switch == YES) &&
+        (transport->getMTU (tsession->ttype) == 0))) &&
+      (OK == transport->associate (tsession, __FILE__)))
     {
       GE_ASSERT (NULL,
                  OK == transport->assertAssociated (tsession, __FILE__));
@@ -3341,9 +3353,9 @@
         }
       be->session.tsession = tsession;
       be->session.mtu = transport->getMTU (tsession->ttype);
-      if ( (be->consider_transport_switch == YES) &&
-          (transport->getMTU(tsession->ttype) == 0) )
-       be->consider_transport_switch = NO;
+      if ((be->consider_transport_switch == YES) &&
+          (transport->getMTU (tsession->ttype) == 0))
+        be->consider_transport_switch = NO;
       check_invariants ();
       fragmentIfNecessary (be);
     }
@@ -3535,8 +3547,7 @@
                 ("# total number of bytes we are currently allowed to send"));
       stat_transport_switches =
         stats->
-        create (gettext_noop
-                ("# transports switched to stream transport"));
+        create (gettext_noop ("# transports switched to stream transport"));
     }
   transport->start (&core_receive);
   EXIT ();

Modified: GNUnet/src/setup/gtk/about.c
===================================================================
--- GNUnet/src/setup/gtk/about.c        2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/setup/gtk/about.c        2007-09-03 00:21:41 UTC (rev 5585)
@@ -41,7 +41,7 @@
   axml = load_xml ("aboutdialog");
   ad = glade_xml_get_widget (axml, "aboutdialog");
   gtk_dialog_run (GTK_DIALOG (ad));
-  gtk_widget_destroy(ad);
+  gtk_widget_destroy (ad);
   g_object_unref (axml);
 }
 
@@ -51,7 +51,7 @@
 void
 gtk_widget_destroy_setup_gtk (GtkWidget * dummy)
 {
-  gtk_widget_destroy(dummy);
+  gtk_widget_destroy (dummy);
 }
 
 /* end of about.c */

Modified: GNUnet/src/setup/gtk/ngconf.c
===================================================================
--- GNUnet/src/setup/gtk/ngconf.c       2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/setup/gtk/ngconf.c       2007-09-03 00:21:41 UTC (rev 5585)
@@ -37,49 +37,55 @@
 
 static const char *cfg_filename;
 
-struct P2W {
-  struct P2W * next;
-  struct GNS_Tree * pos;
-  GtkWidget * w;
+struct P2W
+{
+  struct P2W *next;
+  struct GNS_Tree *pos;
+  GtkWidget *w;
 };
 
 /**
  * Maping of GNS_tree positions to widgets
  * (used for visibility updates).
  */
-static struct P2W * pws;
+static struct P2W *pws;
 
 #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12
 #else
-static GtkTooltips * tips;
+static GtkTooltips *tips;
 #endif
 
-static void tooltip(GtkWidget * w,
-                   const char * text) {
+static void
+tooltip (GtkWidget * w, const char *text)
+{
 #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12
-  gtk_widget_set_tooltip_text(w, text);
+  gtk_widget_set_tooltip_text (w, text);
 #else
-  gtk_tooltips_set_tip(tips, w, text, NULL);
+  gtk_tooltips_set_tip (tips, w, text, NULL);
 #endif
 }
 
-static void update_visibility() {
-  struct P2W * pos;
+static void
+update_visibility ()
+{
+  struct P2W *pos;
 
   pos = pws;
-  while (pos != NULL) {
-    if (pos->pos->visible)
-      gtk_widget_show(pos->w);
-    else 
-      gtk_widget_hide(pos->w);    
-    pos = pos->next;
-  }
+  while (pos != NULL)
+    {
+      if (pos->pos->visible)
+        gtk_widget_show (pos->w);
+      else
+        gtk_widget_hide (pos->w);
+      pos = pos->next;
+    }
 }
 
-static void link_visibility(struct GNS_Tree * pos,
-                           GtkWidget * w) {
-  struct P2W * pw;
-  pw = MALLOC(sizeof(struct P2W));
+static void
+link_visibility (struct GNS_Tree *pos, GtkWidget * w)
+{
+  struct P2W *pw;
+  pw = MALLOC (sizeof (struct P2W));
   pw->pos = pos;
   pw->w = w;
   pw->next = pws;
@@ -96,71 +102,63 @@
                                      pos->option,
                                      gtk_toggle_button_get_active
                                      (togglebutton) ? "YES" : "NO");
-  update_visibility();
+  update_visibility ();
 }
 
 static void
 radio_update (GtkRadioButton * button, gpointer user_data)
 {
   struct GNS_Tree *pos = user_data;
-  const char * opt;
+  const char *opt;
 
-  opt = g_object_get_data(G_OBJECT(button),
-                         "SC-value");
+  opt = g_object_get_data (G_OBJECT (button), "SC-value");
   GC_set_configuration_value_string (cfg,
-                                    ectx,
-                                    pos->section,
-                                    pos->option,
-                                    opt);
-  update_visibility();
+                                     ectx, pos->section, pos->option, opt);
+  update_visibility ();
 }
 
 static void
-multi_update (GtkToggleButton * button,
-             gpointer user_data)
+multi_update (GtkToggleButton * button, gpointer user_data)
 {
   struct GNS_Tree *pos = user_data;
-  char * val;
-  char * opt;
-  char * ret;
-  char * v;
-  char * s;
+  char *val;
+  char *opt;
+  char *ret;
+  char *v;
+  char *s;
 
   val = NULL;
   GC_get_configuration_value_string (cfg,
-                                    pos->section, 
-                                    pos->option, 
-                                    NULL,
-                                    &val);
-  GE_ASSERT(ectx, val != NULL);
-  opt = g_object_get_data(G_OBJECT(button),
-                         "MC-value");
-  if (gtk_toggle_button_get_active (button)) {
-    ret = MALLOC(strlen(val) + strlen(opt) + 2);
-    strcpy(ret, val);
-    strcat(ret, " ");
-    strcat(ret, opt);    
-  } else {
-    v = val;
-    while ( (NULL != (s = strstr(v, opt))) &&
-           ( ( (s[strlen(opt)] != '\0') &&
-               (s[strlen(opt)] != ' ') ) ||
-             ( (s != val) &&
-               (s[-1] != ' ') ) ) )
-      v = s + 1;
-    GE_ASSERT(NULL, s != NULL);
-    ret = MALLOC(strlen(val));
-    s[0] = '\0';
-    if (s != val)
-      s[-1] = '\0'; /* kill space */
-    strcpy(ret, val);
-    strcat(ret, &s[strlen(opt)]);
-  }
+                                     pos->section, pos->option, NULL, &val);
+  GE_ASSERT (ectx, val != NULL);
+  opt = g_object_get_data (G_OBJECT (button), "MC-value");
+  if (gtk_toggle_button_get_active (button))
+    {
+      ret = MALLOC (strlen (val) + strlen (opt) + 2);
+      strcpy (ret, val);
+      strcat (ret, " ");
+      strcat (ret, opt);
+    }
+  else
+    {
+      v = val;
+      while ((NULL != (s = strstr (v, opt))) &&
+             (((s[strlen (opt)] != '\0') &&
+               (s[strlen (opt)] != ' ')) || ((s != val) && (s[-1] != ' '))))
+        v = s + 1;
+      GE_ASSERT (NULL, s != NULL);
+      ret = MALLOC (strlen (val));
+      s[0] = '\0';
+      if (s != val)
+        s[-1] = '\0';           /* kill space */
+      strcpy (ret, val);
+      strcat (ret, &s[strlen (opt)]);
+    }
   GC_set_configuration_value_string (cfg,
                                      ectx, pos->section, pos->option, ret);
   FREE (ret);
   FREE (val);
-  update_visibility();
+  update_visibility ();
 }
 
 static void
@@ -171,75 +169,69 @@
                                      ectx,
                                      pos->section,
                                      pos->option, gtk_entry_get_text (entry));
-  update_visibility();
+  update_visibility ();
 }
 
 static int
 addLeafToTree (GtkWidget * parent, struct GNS_Tree *pos)
 {
-  GtkWidget * ebox;
-  GtkWidget * box;
+  GtkWidget *ebox;
+  GtkWidget *box;
   GtkWidget *w;
-  GtkWidget * choice;
-  GtkWidget * label;
+  GtkWidget *choice;
+  GtkWidget *label;
   int i;
   char defStr[128];
-  const char * lri;
+  const char *lri;
 
   box = gtk_hbox_new (FALSE, 0);
-  link_visibility(pos, box);
+  link_visibility (pos, box);
   switch (pos->type & GNS_TypeMask)
     {
     case GNS_Boolean:
       w = gtk_check_button_new_with_label (pos->description);
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
-                                  pos->value.Boolean.val);
-      tooltip(w, pos->help);
-      g_signal_connect (w, "toggled", G_CALLBACK(&boolean_toggled), pos);
+                                    pos->value.Boolean.val);
+      tooltip (w, pos->help);
+      g_signal_connect (w, "toggled", G_CALLBACK (&boolean_toggled), pos);
       gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 10);
       break;
     case GNS_String:
       ebox = gtk_vbox_new (FALSE, 10);
       w = gtk_entry_new ();
-      label = gtk_label_new(pos->description);
-      gtk_label_set_mnemonic_widget(GTK_LABEL(label),
-                                   w);
+      label = gtk_label_new (pos->description);
+      gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
       gtk_box_pack_start (GTK_BOX (ebox), label, FALSE, FALSE, 10);
       gtk_entry_set_text (GTK_ENTRY (w), pos->value.String.val);
-      g_signal_connect (w, "changed", G_CALLBACK(&string_update), pos);
-      tooltip(w, pos->help);
+      g_signal_connect (w, "changed", G_CALLBACK (&string_update), pos);
+      tooltip (w, pos->help);
       gtk_box_pack_start (GTK_BOX (ebox), w, TRUE, TRUE, 10);
       gtk_box_pack_start (GTK_BOX (box), ebox, TRUE, TRUE, 10);
       break;
     case GNS_MC:
       i = 0;
-      label = gtk_label_new(pos->description);
+      label = gtk_label_new (pos->description);
       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 10);
-      while (NULL != (lri = pos->value.String.legalRange[i])) 
+      while (NULL != (lri = pos->value.String.legalRange[i]))
         {
-       
-          w =
-            gtk_check_button_new_with_label (lri);
-         tooltip(w, pos->help);
-         g_object_set_data(G_OBJECT(w),
-                           "MC-value",
-                           (void*) lri);
+
+          w = gtk_check_button_new_with_label (lri);
+          tooltip (w, pos->help);
+          g_object_set_data (G_OBJECT (w), "MC-value", (void *) lri);
           if ((NULL != strstr (pos->value.String.val,
-                              lri)) &&
+                               lri)) &&
               ((' ' == strstr (pos->value.String.val,
-                              lri)[strlen (lri)])
+                               lri)[strlen (lri)])
                || ('\0' ==
                    strstr (pos->value.String.val,
-                          lri)[strlen (lri)]))
+                           lri)[strlen (lri)]))
               &&
-             ((pos->value.String.val ==
-               strstr (pos->value.String.val,
-                       lri))
-              || (' ' ==
-                  strstr (pos->value.String.val,
-                          lri)[-1])))
-           gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
-          g_signal_connect (w, "toggled", G_CALLBACK(&multi_update), pos);
+              ((pos->value.String.val ==
+                strstr (pos->value.String.val,
+                        lri))
+               || (' ' == strstr (pos->value.String.val, lri)[-1])))
+            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
+          g_signal_connect (w, "toggled", G_CALLBACK (&multi_update), pos);
           gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 5);
           i++;
         }
@@ -248,60 +240,49 @@
       w = NULL;
       i = 0;
       choice = NULL;
-      label = gtk_label_new(pos->description);
+      label = gtk_label_new (pos->description);
       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 10);
-      while (NULL != (lri = pos->value.String.legalRange[i]) )
+      while (NULL != (lri = pos->value.String.legalRange[i]))
         {
-         if (w != NULL)
-           w =
-             gtk_radio_button_new_with_label_from_widget             
-            (GTK_RADIO_BUTTON(w), lri);
-         else
-           w =
-             gtk_radio_button_new_with_label         
-             (NULL, lri);
-         tooltip(w, pos->help);
-         g_object_set_data(G_OBJECT(w),
-                           "SC-value",
-                           (void*) lri);
+          if (w != NULL)
+            w =
+              gtk_radio_button_new_with_label_from_widget
+              (GTK_RADIO_BUTTON (w), lri);
+          else
+            w = gtk_radio_button_new_with_label (NULL, lri);
+          tooltip (w, pos->help);
+          g_object_set_data (G_OBJECT (w), "SC-value", (void *) lri);
           gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
-          if (0 ==
-              strcmp (lri, pos->value.String.val))
-           choice = w;
-          g_signal_connect (w, "toggled", G_CALLBACK(&radio_update), pos);
+          if (0 == strcmp (lri, pos->value.String.val))
+            choice = w;
+          g_signal_connect (w, "toggled", G_CALLBACK (&radio_update), pos);
           i++;
-       }        
+        }
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (choice), TRUE);
 
       break;
     case GNS_Double:
       SNPRINTF (defStr, 128, "%llf", pos->value.Double.val);
       w = gtk_entry_new ();
-      tooltip(w, pos->help);
-      label = gtk_label_new(pos->description);
-      gtk_label_set_mnemonic_widget(GTK_LABEL(label),
-                                   w);
+      tooltip (w, pos->help);
+      label = gtk_label_new (pos->description);
+      gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 10);
-      g_signal_connect (w, "changed", G_CALLBACK(&string_update), pos);
+      g_signal_connect (w, "changed", G_CALLBACK (&string_update), pos);
       gtk_entry_set_text (GTK_ENTRY (w), defStr);
       gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
       break;
     case GNS_UInt64:
       w = gtk_spin_button_new_with_range (pos->value.UInt64.min,
-                                         pos->value.UInt64.max,
-                                         1);
-      tooltip(w, pos->help);
-      label = gtk_label_new(pos->description);
-      gtk_label_set_mnemonic_widget(GTK_LABEL(label),
-                                   w);
+                                          pos->value.UInt64.max, 1);
+      tooltip (w, pos->help);
+      label = gtk_label_new (pos->description);
+      gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
       gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 10);
-      gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), 
-                                pos->value.UInt64.val);
-      gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (w), 
-                                  TRUE);
-      gtk_spin_button_set_digits (GTK_SPIN_BUTTON (w), 
-                                 0);
-      g_signal_connect (w, "changed", G_CALLBACK(&string_update), pos);
+      gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), pos->value.UInt64.val);
+      gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (w), TRUE);
+      gtk_spin_button_set_digits (GTK_SPIN_BUTTON (w), 0);
+      g_signal_connect (w, "changed", G_CALLBACK (&string_update), pos);
       gtk_box_pack_start (GTK_BOX (box), w, FALSE, FALSE, 0);
       break;
     default:
@@ -320,7 +301,7 @@
   GtkNotebook *notebook;
   GtkWidget *vbox;
   GtkWidget *label;
-  GtkWidget * scroll;
+  GtkWidget *scroll;
   int have;
 
   have = 0;
@@ -332,10 +313,12 @@
       switch (child->type & GNS_KindMask)
         {
         case GNS_Node:
-         if (notebook == NULL) {
-           notebook = GTK_NOTEBOOK (gtk_notebook_new ());
-           gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET(notebook), TRUE, 
TRUE, 0);
-         }
+          if (notebook == NULL)
+            {
+              notebook = GTK_NOTEBOOK (gtk_notebook_new ());
+              gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (notebook), TRUE,
+                                  TRUE, 0);
+            }
           have = have | addNodeToTree (notebook, child);
           break;
         case GNS_Leaf:
@@ -351,16 +334,15 @@
   if (have != 0)
     {
       label = gtk_label_new (pos->description);
-      gtk_widget_show_all(vbox);
-      gtk_widget_show_all(label);
-      scroll = gtk_scrolled_window_new(NULL, NULL);
-      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
-                                    GTK_POLICY_NEVER,
-                                    GTK_POLICY_AUTOMATIC);
-      link_visibility(pos, scroll);
-      link_visibility(pos, label);
-      gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll),
-                                           vbox);
+      gtk_widget_show_all (vbox);
+      gtk_widget_show_all (label);
+      scroll = gtk_scrolled_window_new (NULL, NULL);
+      gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
+                                      GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+      link_visibility (pos, scroll);
+      link_visibility (pos, label);
+      gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll),
+                                             vbox);
       gtk_notebook_append_page (parent, scroll, label);
     }
   else
@@ -374,10 +356,10 @@
 initView (struct GNS_Context *gns)
 {
   GtkNotebook *notebook;
-  notebook = GTK_NOTEBOOK(lookup_widget ("configNotebook"));
-  addNodeToTree (notebook, GNS_get_tree(gns));
-  gtk_widget_show_all(GTK_WIDGET(notebook));
-  update_visibility();
+  notebook = GTK_NOTEBOOK (lookup_widget ("configNotebook"));
+  addNodeToTree (notebook, GNS_get_tree (gns));
+  gtk_widget_show_all (GTK_WIDGET (notebook));
+  update_visibility ();
 }
 
 
@@ -488,7 +470,7 @@
   setLibrary (self);
 #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12
 #else
-  tips = gtk_tooltips_new();
+  tips = gtk_tooltips_new ();
 #endif
   mainWindow = get_xml ("setupWindow");
   initView (gns);

Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c        2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/transports/http.c        2007-09-03 00:21:41 UTC (rev 5585)
@@ -835,8 +835,7 @@
                        const char *method,
                        const char *version,
                        const char *upload_data,
-                       unsigned int *upload_data_size,
-                      void ** unused)
+                       unsigned int *upload_data_size, void **unused)
 {
   TSession *tsession;
   struct MHD_Response *response;
@@ -1601,7 +1600,7 @@
                   if (prev == NULL)
                     pos = s->cs.client.puts;
                   else
-                    pos = pos->next;
+                    pos = prev->next;
                   continue;
                 }
               prev = pos;

Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/transports/tcp.c 2007-09-03 00:21:41 UTC (rev 5585)
@@ -292,15 +292,14 @@
     }
   haddr->port = htons (port);
   haddr->reserved = htons (0);
-  if (0 != memcmp(haddr,
-                 &last_addr,
-                 sizeof(HostAddress))) {
-    GE_LOG (ectx,
-           GE_DEBUG | GE_USER | GE_BULK,
-           "TCP uses IP address %u.%u.%u.%u.\n",
-           PRIP (ntohl (*(int *) &haddr->ip)));
-    last_addr = *haddr;
-  }
+  if (0 != memcmp (haddr, &last_addr, sizeof (HostAddress)))
+    {
+      GE_LOG (ectx,
+              GE_DEBUG | GE_USER | GE_BULK,
+              "TCP uses IP address %u.%u.%u.%u.\n",
+              PRIP (ntohl (*(int *) &haddr->ip)));
+      last_addr = *haddr;
+    }
   msg->senderAddressSize = htons (sizeof (HostAddress));
   msg->protocol = htons (TCP_PROTOCOL_NUMBER);
   msg->MTU = htonl (tcpAPI.mtu);

Modified: GNUnet/src/transports/udp.c
===================================================================
--- GNUnet/src/transports/udp.c 2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/transports/udp.c 2007-09-03 00:21:41 UTC (rev 5585)
@@ -290,15 +290,14 @@
     }
   haddr->port = htons (port);
   haddr->reserved = htons (0);
-  if (0 != memcmp(haddr,
-                 &last_addr,
-                 sizeof(HostAddress))) {
-    GE_LOG (ectx,
-           GE_DEBUG | GE_USER | GE_BULK,
-           "UDP uses IP address %u.%u.%u.%u.\n",
-           PRIP (ntohl (*(int *) &haddr->ip)));
-    last_addr = *haddr;
-  }
+  if (0 != memcmp (haddr, &last_addr, sizeof (HostAddress)))
+    {
+      GE_LOG (ectx,
+              GE_DEBUG | GE_USER | GE_BULK,
+              "UDP uses IP address %u.%u.%u.%u.\n",
+              PRIP (ntohl (*(int *) &haddr->ip)));
+      last_addr = *haddr;
+    }
   msg->senderAddressSize = htons (sizeof (HostAddress));
   msg->protocol = htons (UDP_PROTOCOL_NUMBER);
   msg->MTU = htonl (udpAPI.mtu);

Modified: GNUnet/src/transports/udp_helper.c
===================================================================
--- GNUnet/src/transports/udp_helper.c  2007-09-01 03:05:37 UTC (rev 5584)
+++ GNUnet/src/transports/udp_helper.c  2007-09-03 00:21:41 UTC (rev 5585)
@@ -173,7 +173,7 @@
 int
 udpAssociate (TSession * tsession)
 {
-  return SYSERR; /* UDP connections can never be associated */
+  return SYSERR;                /* UDP connections can never be associated */
 }
 
 /**





reply via email to

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