gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17362 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r17362 - gnunet/src/util
Date: Tue, 11 Oct 2011 11:43:04 +0200

Author: grothoff
Date: 2011-10-11 11:43:04 +0200 (Tue, 11 Oct 2011)
New Revision: 17362

Modified:
   gnunet/src/util/bandwidth.c
   gnunet/src/util/bio.c
   gnunet/src/util/client.c
   gnunet/src/util/common_allocation.c
   gnunet/src/util/common_endian.c
   gnunet/src/util/common_logging.c
   gnunet/src/util/configuration.c
   gnunet/src/util/connection.c
   gnunet/src/util/container_bloomfilter.c
   gnunet/src/util/container_heap.c
   gnunet/src/util/container_meta_data.c
   gnunet/src/util/container_multihashmap.c
   gnunet/src/util/container_slist.c
   gnunet/src/util/crypto_aes.c
   gnunet/src/util/crypto_crc.c
   gnunet/src/util/crypto_hash.c
   gnunet/src/util/crypto_hkdf.c
   gnunet/src/util/crypto_kdf.c
   gnunet/src/util/crypto_ksk.c
   gnunet/src/util/crypto_random.c
   gnunet/src/util/crypto_rsa.c
   gnunet/src/util/disk.c
   gnunet/src/util/getopt.c
   gnunet/src/util/getopt_helpers.c
   gnunet/src/util/gnunet-config-diff.c
   gnunet/src/util/gnunet-resolver.c
   gnunet/src/util/gnunet-service-resolver.c
   gnunet/src/util/load.c
   gnunet/src/util/network.c
   gnunet/src/util/os_installation.c
   gnunet/src/util/os_network.c
   gnunet/src/util/os_priority.c
   gnunet/src/util/peer.c
   gnunet/src/util/perf_crypto_hash.c
   gnunet/src/util/plugin.c
   gnunet/src/util/program.c
   gnunet/src/util/pseudonym.c
   gnunet/src/util/resolver_api.c
   gnunet/src/util/scheduler.c
   gnunet/src/util/server.c
   gnunet/src/util/server_mst.c
   gnunet/src/util/server_nc.c
   gnunet/src/util/server_tc.c
   gnunet/src/util/service.c
   gnunet/src/util/signal.c
   gnunet/src/util/strings.c
   gnunet/src/util/test_bio.c
   gnunet/src/util/test_client.c
   gnunet/src/util/test_common_allocation.c
   gnunet/src/util/test_common_logging.c
   gnunet/src/util/test_common_logging_dummy.c
   gnunet/src/util/test_common_logging_runtime_loglevels.c
   gnunet/src/util/test_configuration.c
   gnunet/src/util/test_connection.c
   gnunet/src/util/test_connection_addressing.c
   gnunet/src/util/test_connection_receive_cancel.c
   gnunet/src/util/test_connection_timeout.c
   gnunet/src/util/test_connection_timeout_no_connect.c
   gnunet/src/util/test_connection_transmit_cancel.c
   gnunet/src/util/test_container_bloomfilter.c
   gnunet/src/util/test_container_heap.c
   gnunet/src/util/test_container_meta_data.c
   gnunet/src/util/test_container_multihashmap.c
   gnunet/src/util/test_container_slist.c
   gnunet/src/util/test_crypto_aes.c
   gnunet/src/util/test_crypto_aes_weak.c
   gnunet/src/util/test_crypto_hash.c
   gnunet/src/util/test_crypto_hkdf.c
   gnunet/src/util/test_crypto_ksk.c
   gnunet/src/util/test_crypto_random.c
   gnunet/src/util/test_crypto_rsa.c
   gnunet/src/util/test_disk.c
   gnunet/src/util/test_getopt.c
   gnunet/src/util/test_os_network.c
   gnunet/src/util/test_os_priority.c
   gnunet/src/util/test_os_start_process.c
   gnunet/src/util/test_peer.c
   gnunet/src/util/test_program.c
   gnunet/src/util/test_pseudonym.c
   gnunet/src/util/test_resolver_api.c
   gnunet/src/util/test_scheduler.c
   gnunet/src/util/test_scheduler_delay.c
   gnunet/src/util/test_server.c
   gnunet/src/util/test_server_disconnect.c
   gnunet/src/util/test_server_with_client.c
   gnunet/src/util/test_server_with_client_unix.c
   gnunet/src/util/test_service.c
   gnunet/src/util/test_strings.c
   gnunet/src/util/test_time.c
   gnunet/src/util/time.c
   gnunet/src/util/winproc.c
Log:
converting to GNUNET_LOG_from*

Modified: gnunet/src/util/bandwidth.c
===================================================================
--- gnunet/src/util/bandwidth.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/bandwidth.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -29,6 +29,8 @@
 
 #define DEBUG_BANDWIDTH GNUNET_EXTRA_LOGGING
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+
 /**
  * Create a new bandwidth value.
  *
@@ -41,8 +43,8 @@
   struct GNUNET_BANDWIDTH_Value32NBO ret;
 
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initializing bandwidth of %u Bps\n",
-              (unsigned int) bytes_per_second);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Initializing bandwidth of %u Bps\n",
+       (unsigned int) bytes_per_second);
 #endif
   ret.value__ = htonl (bytes_per_second);
   return ret;
@@ -58,11 +60,11 @@
  */
 struct GNUNET_BANDWIDTH_Value32NBO
 GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
-                            struct GNUNET_BANDWIDTH_Value32NBO b2)
+                           struct GNUNET_BANDWIDTH_Value32NBO b2)
 {
   return
-      GNUNET_BANDWIDTH_value_init (GNUNET_MIN
-                                   (ntohl (b1.value__), ntohl (b2.value__)));
+    GNUNET_BANDWIDTH_value_init (GNUNET_MIN
+                                (ntohl (b1.value__), ntohl (b2.value__)));
 }
 
 
@@ -76,18 +78,18 @@
  */
 uint64_t
 GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO
-                                            bps,
-                                            struct GNUNET_TIME_Relative
-                                            deadline)
+                                           bps,
+                                           struct GNUNET_TIME_Relative
+                                           deadline)
 {
   uint64_t b;
 
   b = ntohl (bps.value__);
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Bandwidth has %llu bytes available until deadline in %llums\n",
-              (unsigned long long) ((b * deadline.rel_value + 500LL) / 1000LL),
-              deadline.rel_value);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Bandwidth has %llu bytes available until deadline in %llums\n",
+       (unsigned long long) ((b * deadline.rel_value + 500LL) / 1000LL),
+       deadline.rel_value);
 #endif
   return (b * deadline.rel_value + 500LL) / 1000LL;
 }
@@ -103,25 +105,25 @@
  */
 struct GNUNET_TIME_Relative
 GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps,
-                                      uint64_t size)
+                                     uint64_t size)
 {
   uint64_t b;
   struct GNUNET_TIME_Relative ret;
 
   b = ntohl (bps.value__);
   if (b == 0)
-  {
+    {
 #if DEBUG_BANDWIDTH
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Bandwidth suggests delay of infinity (zero bandwidth)\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Bandwidth suggests delay of infinity (zero bandwidth)\n");
 #endif
-    return GNUNET_TIME_UNIT_FOREVER_REL;
-  }
+      return GNUNET_TIME_UNIT_FOREVER_REL;
+    }
   ret.rel_value = size * 1000LL / b;
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Bandwidth suggests delay of %llu ms for %llu bytes of 
traffic\n",
-              (unsigned long long) ret.rel_value, (unsigned long long) size);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Bandwidth suggests delay of %llu ms for %llu bytes of traffic\n",
+       (unsigned long long) ret.rel_value, (unsigned long long) size);
 #endif
   return ret;
 }
@@ -143,18 +145,18 @@
  */
 void
 GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
-                               struct GNUNET_BANDWIDTH_Value32NBO
-                               bytes_per_second_limit, uint32_t max_carry_s)
+                              struct GNUNET_BANDWIDTH_Value32NBO
+                              bytes_per_second_limit, uint32_t max_carry_s)
 {
   av->consumption_since_last_update__ = 0;
   av->last_update__ = GNUNET_TIME_absolute_get ();
   av->available_bytes_per_s__ = ntohl (bytes_per_second_limit.value__);
   av->max_carry_s__ = max_carry_s;
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tracker %p initialized with %u Bps and max carry %u\n", av,
-              (unsigned int) av->available_bytes_per_s__,
-              (unsigned int) max_carry_s);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tracker %p initialized with %u Bps and max carry %u\n", av,
+       (unsigned int) av->available_bytes_per_s__,
+       (unsigned int) max_carry_s);
 #endif
 }
 
@@ -177,26 +179,26 @@
   now = GNUNET_TIME_absolute_get ();
   delta_time = now.abs_value - av->last_update__.abs_value;
   delta_avail =
-      (delta_time * ((unsigned long long) av->available_bytes_per_s__) +
-       500LL) / 1000LL;
+    (delta_time * ((unsigned long long) av->available_bytes_per_s__) +
+     500LL) / 1000LL;
   av->consumption_since_last_update__ -= delta_avail;
   av->last_update__ = now;
   if (av->consumption_since_last_update__ < 0)
-  {
-    left_bytes = -av->consumption_since_last_update__;
-    max_carry = av->available_bytes_per_s__ * av->max_carry_s__;
-    if (max_carry < GNUNET_SERVER_MAX_MESSAGE_SIZE)
-      max_carry = GNUNET_SERVER_MAX_MESSAGE_SIZE;
-    if (max_carry > left_bytes)
-      av->consumption_since_last_update__ = -left_bytes;
-    else
-      av->consumption_since_last_update__ = -max_carry;
-  }
+    {
+      left_bytes = -av->consumption_since_last_update__;
+      max_carry = av->available_bytes_per_s__ * av->max_carry_s__;
+      if (max_carry < GNUNET_SERVER_MAX_MESSAGE_SIZE)
+       max_carry = GNUNET_SERVER_MAX_MESSAGE_SIZE;
+      if (max_carry > left_bytes)
+       av->consumption_since_last_update__ = -left_bytes;
+      else
+       av->consumption_since_last_update__ = -max_carry;
+    }
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tracker %p  updated, have %u Bps, last update was %llu ms 
ago\n",
-              av, (unsigned int) av->available_bytes_per_s__,
-              (unsigned long long) delta_time);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tracker %p  updated, have %u Bps, last update was %llu ms ago\n",
+       av, (unsigned int) av->available_bytes_per_s__,
+       (unsigned long long) delta_time);
 #endif
 
 }
@@ -215,38 +217,38 @@
  */
 int
 GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
-                                  ssize_t size)
+                                 ssize_t size)
 {
   int64_t nc;
 
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Tracker %p consumes %d bytes\n", av,
-              (int) size);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Tracker %p consumes %d bytes\n", av,
+       (int) size);
 #endif
   if (size > 0)
-  {
-    nc = av->consumption_since_last_update__ + size;
-    if (nc < av->consumption_since_last_update__)
     {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-    av->consumption_since_last_update__ = nc;
-    update_tracker (av);
-    if (av->consumption_since_last_update__ > 0)
-    {
+      nc = av->consumption_since_last_update__ + size;
+      if (nc < av->consumption_since_last_update__)
+       {
+         GNUNET_break (0);
+         return GNUNET_SYSERR;
+       }
+      av->consumption_since_last_update__ = nc;
+      update_tracker (av);
+      if (av->consumption_since_last_update__ > 0)
+       {
 #if DEBUG_BANDWIDTH
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Tracker %p consumption %llu bytes above limit\n", av,
-                  (unsigned long long) av->consumption_since_last_update__);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Tracker %p consumption %llu bytes above limit\n", av,
+              (unsigned long long) av->consumption_since_last_update__);
 #endif
-      return GNUNET_YES;
+         return GNUNET_YES;
+       }
     }
-  }
   else
-  {
-    av->consumption_since_last_update__ += size;
-  }
+    {
+      av->consumption_since_last_update__ += size;
+    }
   return GNUNET_NO;
 }
 
@@ -262,35 +264,35 @@
  */
 struct GNUNET_TIME_Relative
 GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av,
-                                    size_t size)
+                                   size_t size)
 {
   struct GNUNET_TIME_Relative ret;
   int64_t bytes_needed;
 
   if (av->available_bytes_per_s__ == 0)
-  {
+    {
 #if DEBUG_BANDWIDTH
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Tracker %p delay is infinity\n", av);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Tracker %p delay is infinity\n", av);
 #endif
-    return GNUNET_TIME_UNIT_FOREVER_REL;
-  }
+      return GNUNET_TIME_UNIT_FOREVER_REL;
+    }
   update_tracker (av);
   bytes_needed = size + av->consumption_since_last_update__;
   if (bytes_needed <= 0)
-  {
+    {
 #if DEBUG_BANDWIDTH
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Tracker %p delay for %u bytes is zero\n", av,
-                (unsigned int) size);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Tracker %p delay for %u bytes is zero\n", av,
+          (unsigned int) size);
 #endif
-    return GNUNET_TIME_UNIT_ZERO;
-  }
+      return GNUNET_TIME_UNIT_ZERO;
+    }
   ret.rel_value =
-      1000LL * bytes_needed / (unsigned long long) av->available_bytes_per_s__;
+    1000LL * bytes_needed / (unsigned long long) av->available_bytes_per_s__;
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tracker %p delay for %u bytes is %llu ms\n", av,
-              (unsigned int) size, (unsigned long long) ret.rel_value);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tracker %p delay for %u bytes is %llu ms\n", av,
+       (unsigned int) size, (unsigned long long) ret.rel_value);
 #endif
   return ret;
 }
@@ -313,14 +315,14 @@
   update_tracker (av);
   bps = GNUNET_BANDWIDTH_value_init (av->available_bytes_per_s__);
   avail =
-      GNUNET_BANDWIDTH_value_get_available_until (bps,
-                                                  
GNUNET_TIME_absolute_get_duration
-                                                  (av->last_update__));
+    GNUNET_BANDWIDTH_value_get_available_until (bps,
+                                               
GNUNET_TIME_absolute_get_duration
+                                               (av->last_update__));
   used = av->consumption_since_last_update__;
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tracker %p  available bandwidth is %lld bytes\n", av,
-              (long long) (int64_t) (avail - used));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tracker %p  available bandwidth is %lld bytes\n", av,
+       (long long) (int64_t) (avail - used));
 #endif
   return (int64_t) (avail - used);
 }
@@ -334,23 +336,23 @@
  */
 void
 GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av,
-                                       struct GNUNET_BANDWIDTH_Value32NBO
-                                       bytes_per_second_limit)
+                                      struct GNUNET_BANDWIDTH_Value32NBO
+                                      bytes_per_second_limit)
 {
   uint32_t old_limit;
   uint32_t new_limit;
 
   new_limit = ntohl (bytes_per_second_limit.value__);
 #if DEBUG_BANDWIDTH
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tracker %p bandwidth changed to %u Bps\n", av,
-              (unsigned int) new_limit);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tracker %p bandwidth changed to %u Bps\n", av,
+       (unsigned int) new_limit);
 #endif
   update_tracker (av);
   old_limit = av->available_bytes_per_s__;
   av->available_bytes_per_s__ = new_limit;
   if (old_limit > new_limit)
-    update_tracker (av);        /* maximum excess might be less now */
+    update_tracker (av);       /* maximum excess might be less now */
 }
 
 

Modified: gnunet/src/util/bio.c
===================================================================
--- gnunet/src/util/bio.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/bio.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -26,6 +26,8 @@
 #include "gnunet_bio_lib.h"
 #include "gnunet_disk_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+
 #define BIO_BUFFER_SIZE 65536
 
 #define MAX_META_DATA (1024 * 1024)
@@ -56,7 +58,8 @@
   struct GNUNET_DISK_FileHandle *fd;
   struct GNUNET_BIO_ReadHandle *h;
 
-  fd = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ, 
GNUNET_DISK_PERM_NONE);
+  fd =
+    GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE);
   if (NULL == fd)
     return NULL;
   h = GNUNET_malloc (sizeof (struct GNUNET_BIO_ReadHandle) + BIO_BUFFER_SIZE);
@@ -102,7 +105,7 @@
  */
 int
 GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what,
-                 void *result, size_t len)
+                void *result, size_t len)
 {
   char *dst = result;
   size_t min;
@@ -113,38 +116,38 @@
     return GNUNET_SYSERR;
   pos = 0;
   do
-  {
-    /* first, use buffer */
-    min = h->have - h->pos;
-    if (min > 0)
     {
-      if (min > len - pos)
-        min = len - pos;
-      memcpy (&dst[pos], &h->buffer[h->pos], min);
-      h->pos += min;
-      pos += min;
+      /* first, use buffer */
+      min = h->have - h->pos;
+      if (min > 0)
+       {
+         if (min > len - pos)
+           min = len - pos;
+         memcpy (&dst[pos], &h->buffer[h->pos], min);
+         h->pos += min;
+         pos += min;
+       }
+      if (pos == len)
+       return GNUNET_OK;       /* done! */
+      GNUNET_assert (h->have == h->pos);
+      /* fill buffer */
+      ret = GNUNET_DISK_file_read (h->fd, h->buffer, h->size);
+      if (ret == -1)
+       {
+         GNUNET_asprintf (&h->emsg, _("Error reading `%s': %s"), what,
+                          STRERROR (errno));
+         return GNUNET_SYSERR;
+       }
+      if (ret == 0)
+       {
+         GNUNET_asprintf (&h->emsg, _("Error reading `%s': %s"), what,
+                          _("End of file"));
+         return GNUNET_SYSERR;
+       }
+      h->pos = 0;
+      h->have = ret;
     }
-    if (pos == len)
-      return GNUNET_OK;         /* done! */
-    GNUNET_assert (h->have == h->pos);
-    /* fill buffer */
-    ret = GNUNET_DISK_file_read (h->fd, h->buffer, h->size);
-    if (ret == -1)
-    {
-      GNUNET_asprintf (&h->emsg, _("Error reading `%s': %s"), what,
-                       STRERROR (errno));
-      return GNUNET_SYSERR;
-    }
-    if (ret == 0)
-    {
-      GNUNET_asprintf (&h->emsg, _("Error reading `%s': %s"), what,
-                       _("End of file"));
-      return GNUNET_SYSERR;
-    }
-    h->pos = 0;
-    h->have = ret;
-  }
-  while (pos < len);            /* should always be true */
+  while (pos < len);           /* should always be true */
   return GNUNET_OK;
 }
 
@@ -160,8 +163,8 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
 int
-GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int 
line,
-                    void *result, size_t len)
+GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file,
+                   int line, void *result, size_t len)
 {
   char what[1024];
 
@@ -182,39 +185,41 @@
  */
 int
 GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
-                        char **result, size_t maxLen)
+                       char **result, size_t maxLen)
 {
   char *buf;
   uint32_t big;
 
   if (GNUNET_OK != GNUNET_BIO_read_int32 (h, &big))
-  {
-    GNUNET_free_non_null (h->emsg);
-    GNUNET_asprintf (&h->emsg, _("Error reading length of string `%s'"), what);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free_non_null (h->emsg);
+      GNUNET_asprintf (&h->emsg, _("Error reading length of string `%s'"),
+                      what);
+      return GNUNET_SYSERR;
+    }
   if (big == 0)
-  {
-    *result = NULL;
-    return GNUNET_OK;
-  }
+    {
+      *result = NULL;
+      return GNUNET_OK;
+    }
   if (big > maxLen)
-  {
-    GNUNET_asprintf (&h->emsg, _("String `%s' longer than allowed (%u > %u)"),
-                     what, big, maxLen);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_asprintf (&h->emsg,
+                      _("String `%s' longer than allowed (%u > %u)"), what,
+                      big, maxLen);
+      return GNUNET_SYSERR;
+    }
   buf = GNUNET_malloc (big);
   *result = buf;
   buf[--big] = '\0';
   if (big == 0)
     return GNUNET_OK;
   if (GNUNET_OK != GNUNET_BIO_read (h, what, buf, big))
-  {
-    GNUNET_free (buf);
-    *result = NULL;
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (buf);
+      *result = NULL;
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 
@@ -229,7 +234,7 @@
  */
 int
 GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what,
-                           struct GNUNET_CONTAINER_MetaData **result)
+                          struct GNUNET_CONTAINER_MetaData **result)
 {
   uint32_t size;
   char *buf;
@@ -238,30 +243,32 @@
   if (GNUNET_BIO_read_int32 (h, (int32_t *) & size) != GNUNET_OK)
     return GNUNET_SYSERR;
   if (size == 0)
-  {
-    *result = NULL;
-    return GNUNET_OK;
-  }
+    {
+      *result = NULL;
+      return GNUNET_OK;
+    }
   if (size > MAX_META_DATA)
-  {
-    GNUNET_asprintf (&h->emsg,
-                     _("Serialized metadata `%s' larger than allowed (%u>%u)"),
-                     what, size, MAX_META_DATA);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_asprintf (&h->emsg,
+                      _
+                      ("Serialized metadata `%s' larger than allowed (%u>%u)"),
+                      what, size, MAX_META_DATA);
+      return GNUNET_SYSERR;
+    }
   buf = GNUNET_malloc (size);
   if (GNUNET_OK != GNUNET_BIO_read (h, what, buf, size))
-  {
-    GNUNET_free (buf);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (buf);
+      return GNUNET_SYSERR;
+    }
   meta = GNUNET_CONTAINER_meta_data_deserialize (buf, size);
   if (meta == NULL)
-  {
-    GNUNET_free (buf);
-    GNUNET_asprintf (&h->emsg, _("Metadata `%s' failed to deserialize"), what);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (buf);
+      GNUNET_asprintf (&h->emsg, _("Metadata `%s' failed to deserialize"),
+                      what);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (buf);
   *result = meta;
   return GNUNET_OK;
@@ -279,7 +286,7 @@
  */
 int
 GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
-                         int line, int32_t * i)
+                        int line, int32_t * i)
 {
   int32_t big;
 
@@ -301,7 +308,7 @@
  */
 int
 GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
-                         int line, int64_t * i)
+                        int line, int64_t * i)
 {
   int64_t big;
 
@@ -337,13 +344,15 @@
   struct GNUNET_BIO_WriteHandle *h;
 
   fd = GNUNET_DISK_file_open (fn,
-                              GNUNET_DISK_OPEN_WRITE | 
GNUNET_DISK_OPEN_TRUNCATE
-                              | GNUNET_DISK_OPEN_CREATE,
-                              GNUNET_DISK_PERM_USER_READ |
-                              GNUNET_DISK_PERM_USER_WRITE);
+                             GNUNET_DISK_OPEN_WRITE |
+                             GNUNET_DISK_OPEN_TRUNCATE |
+                             GNUNET_DISK_OPEN_CREATE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   if (NULL == fd)
     return NULL;
-  h = GNUNET_malloc (sizeof (struct GNUNET_BIO_WriteHandle) + BIO_BUFFER_SIZE);
+  h =
+    GNUNET_malloc (sizeof (struct GNUNET_BIO_WriteHandle) + BIO_BUFFER_SIZE);
   h->buffer = (char *) &h[1];
   h->size = BIO_BUFFER_SIZE;
   h->fd = fd;
@@ -365,18 +374,18 @@
   int ret;
 
   if (NULL == h->fd)
-  {
-    ret = GNUNET_SYSERR;
-  }
+    {
+      ret = GNUNET_SYSERR;
+    }
   else
-  {
-    wrt = GNUNET_DISK_file_write (h->fd, h->buffer, h->have);
-    if (wrt == h->have)
-      ret = GNUNET_OK;
-    else
-      ret = GNUNET_SYSERR;
-    GNUNET_DISK_file_close (h->fd);
-  }
+    {
+      wrt = GNUNET_DISK_file_write (h->fd, h->buffer, h->have);
+      if (wrt == h->have)
+       ret = GNUNET_OK;
+      else
+       ret = GNUNET_SYSERR;
+      GNUNET_DISK_file_close (h->fd);
+    }
   GNUNET_free (h);
   return ret;
 }
@@ -392,7 +401,7 @@
  */
 int
 GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer,
-                  size_t n)
+                 size_t n)
 {
   const char *src = buffer;
   size_t min;
@@ -403,27 +412,27 @@
     return GNUNET_SYSERR;
   pos = 0;
   do
-  {
-    /* first, just use buffer */
-    min = h->size - h->have;
-    if (min > n - pos)
-      min = n - pos;
-    memcpy (&h->buffer[h->have], &src[pos], min);
-    pos += min;
-    h->have += min;
-    if (pos == n)
-      return GNUNET_OK;         /* done */
-    GNUNET_assert (h->have == h->size);
-    ret = GNUNET_DISK_file_write (h->fd, h->buffer, h->size);
-    if (ret != h->size)
     {
-      GNUNET_DISK_file_close (h->fd);
-      h->fd = NULL;
-      return GNUNET_SYSERR;     /* error */
+      /* first, just use buffer */
+      min = h->size - h->have;
+      if (min > n - pos)
+       min = n - pos;
+      memcpy (&h->buffer[h->have], &src[pos], min);
+      pos += min;
+      h->have += min;
+      if (pos == n)
+       return GNUNET_OK;       /* done */
+      GNUNET_assert (h->have == h->size);
+      ret = GNUNET_DISK_file_write (h->fd, h->buffer, h->size);
+      if (ret != h->size)
+       {
+         GNUNET_DISK_file_close (h->fd);
+         h->fd = NULL;
+         return GNUNET_SYSERR; /* error */
+       }
+      h->have = 0;
     }
-    h->have = 0;
-  }
-  while (pos < n);              /* should always be true */
+  while (pos < n);             /* should always be true */
   GNUNET_break (0);
   return GNUNET_OK;
 }
@@ -459,7 +468,7 @@
  */
 int
 GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
-                            const struct GNUNET_CONTAINER_MetaData *m)
+                           const struct GNUNET_CONTAINER_MetaData *m)
 {
   ssize_t size;
   char *buf;
@@ -468,19 +477,19 @@
     return GNUNET_BIO_write_int32 (h, 0);
   buf = NULL;
   size =
-      GNUNET_CONTAINER_meta_data_serialize (m, &buf, MAX_META_DATA,
-                                            
GNUNET_CONTAINER_META_DATA_SERIALIZE_PART);
+    GNUNET_CONTAINER_meta_data_serialize (m, &buf, MAX_META_DATA,
+                                         
GNUNET_CONTAINER_META_DATA_SERIALIZE_PART);
   if (size == -1)
-  {
-    GNUNET_free (buf);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (buf);
+      return GNUNET_SYSERR;
+    }
   if ((GNUNET_OK != GNUNET_BIO_write_int32 (h, (uint32_t) size)) ||
       (GNUNET_OK != GNUNET_BIO_write (h, buf, size)))
-  {
-    GNUNET_free (buf);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (buf);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (buf);
   return GNUNET_OK;
 }

Modified: gnunet/src/util/client.c
===================================================================
--- gnunet/src/util/client.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/client.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -43,6 +43,8 @@
  */
 #define MAX_ATTEMPTS 50
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+
 /**
  * Handle for a transmission request.
  */
@@ -262,7 +264,8 @@
  */
 static struct GNUNET_CONNECTION_Handle *
 do_connect (const char *service_name,
-            const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int 
attempt)
+           const struct GNUNET_CONFIGURATION_Handle *cfg,
+           unsigned int attempt)
 {
   struct GNUNET_CONNECTION_Handle *sock;
   char *hostname;
@@ -272,79 +275,80 @@
   sock = NULL;
 #if AF_UNIX
   if (0 == (attempt % 2))
-  {
-    /* on even rounds, try UNIX */
-    unixpath = NULL;
-    if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, 
service_name, "UNIXPATH", &unixpath)) && (0 < strlen (unixpath)))     /* We 
have a non-NULL unixpath, does that mean it's valid? */
     {
-      sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath);
-      if (sock != NULL)
-      {
+      /* on even rounds, try UNIX */
+      unixpath = NULL;
+      if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, 
service_name, "UNIXPATH", &unixpath)) && (0 < strlen (unixpath)))  /* We have a 
non-NULL unixpath, does that mean it's valid? */
+       {
+         sock =
+           GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath);
+         if (sock != NULL)
+           {
 #if DEBUG_CLIENT
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to unixpath `%s'!\n",
-                    unixpath);
+             LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to unixpath `%s'!\n",
+                  unixpath);
 #endif
-        GNUNET_free (unixpath);
-        return sock;
-      }
+             GNUNET_free (unixpath);
+             return sock;
+           }
+       }
+      GNUNET_free_non_null (unixpath);
     }
-    GNUNET_free_non_null (unixpath);
-  }
 #endif
 
   if ((GNUNET_OK !=
-       GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "PORT", 
&port))
-      || (port > 65535) ||
-      (GNUNET_OK !=
-       GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "HOSTNAME",
-                                              &hostname)))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _
-                ("Could not determine valid hostname and port for service `%s' 
from configuration.\n"),
-                service_name);
-    return NULL;
-  }
+       GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "PORT",
+                                             &port)) || (port > 65535)
+      || (GNUNET_OK !=
+         GNUNET_CONFIGURATION_get_value_string (cfg, service_name,
+                                                "HOSTNAME", &hostname)))
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _
+          ("Could not determine valid hostname and port for service `%s' from 
configuration.\n"),
+          service_name);
+      return NULL;
+    }
   if (0 == strlen (hostname))
-  {
-    GNUNET_free (hostname);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("Need a non-empty hostname for service `%s'.\n"),
-                service_name);
-    return NULL;
-  }
+    {
+      GNUNET_free (hostname);
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("Need a non-empty hostname for service `%s'.\n"), service_name);
+      return NULL;
+    }
   if (port == 0)
-  {
+    {
 #if AF_UNIX
-    if (0 != (attempt % 2))
-    {
-      /* try UNIX */
-      unixpath = NULL;
-      if ((GNUNET_OK ==
-           GNUNET_CONFIGURATION_get_value_string (cfg, service_name, 
"UNIXPATH",
-                                                  &unixpath)) &&
-          (0 < strlen (unixpath)))
-      {
-        sock =
-            GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, unixpath);
-        if (sock != NULL)
-        {
-          GNUNET_free (unixpath);
-          GNUNET_free (hostname);
-          return sock;
-        }
-      }
-      GNUNET_free_non_null (unixpath);
-    }
+      if (0 != (attempt % 2))
+       {
+         /* try UNIX */
+         unixpath = NULL;
+         if ((GNUNET_OK ==
+              GNUNET_CONFIGURATION_get_value_string (cfg, service_name,
+                                                     "UNIXPATH", &unixpath))
+             && (0 < strlen (unixpath)))
+           {
+             sock =
+               GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg,
+                                                                  unixpath);
+             if (sock != NULL)
+               {
+                 GNUNET_free (unixpath);
+                 GNUNET_free (hostname);
+                 return sock;
+               }
+           }
+         GNUNET_free_non_null (unixpath);
+       }
 #endif
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Port is 0 for service `%s', UNIXPATH did not work, returning 
NULL!\n",
-                service_name);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Port is 0 for service `%s', UNIXPATH did not work, returning 
NULL!\n",
+          service_name);
 #endif
-    GNUNET_free (hostname);
-    return NULL;
-  }
+      GNUNET_free (hostname);
+      return NULL;
+    }
 
   sock = GNUNET_CONNECTION_create_from_connect (cfg, hostname, port);
   GNUNET_free (hostname);
@@ -361,7 +365,7 @@
  */
 struct GNUNET_CLIENT_Connection *
 GNUNET_CLIENT_connect (const char *service_name,
-                       const struct GNUNET_CONFIGURATION_Handle *cfg)
+                      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_CLIENT_Connection *ret;
   struct GNUNET_CONNECTION_Handle *sock;
@@ -385,7 +389,7 @@
  */
 void
 GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
-                               int do_ignore)
+                              int do_ignore)
 {
   h->ignore_shutdown = do_ignore;
   if (h->sock != NULL)
@@ -410,33 +414,33 @@
  */
 void
 GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
-                          int finish_pending_write)
+                         int finish_pending_write)
 {
   if (sock->in_receive == GNUNET_YES)
-  {
-    GNUNET_CONNECTION_receive_cancel (sock->sock);
-    sock->in_receive = GNUNET_NO;
-  }
+    {
+      GNUNET_CONNECTION_receive_cancel (sock->sock);
+      sock->in_receive = GNUNET_NO;
+    }
   if (sock->th != NULL)
-  {
-    GNUNET_CLIENT_notify_transmit_ready_cancel (sock->th);
-    sock->th = NULL;
-  }
+    {
+      GNUNET_CLIENT_notify_transmit_ready_cancel (sock->th);
+      sock->th = NULL;
+    }
   if (NULL != sock->sock)
-  {
-    GNUNET_CONNECTION_destroy (sock->sock, finish_pending_write);
-    sock->sock = NULL;
-  }
+    {
+      GNUNET_CONNECTION_destroy (sock->sock, finish_pending_write);
+      sock->sock = NULL;
+    }
   if (sock->receive_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (sock->receive_task);
-    sock->receive_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (sock->receive_task);
+      sock->receive_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   if (sock->tag != NULL)
-  {
-    GNUNET_free (sock->tag);
-    sock->tag = NULL;
-  }
+    {
+      GNUNET_free (sock->tag);
+      sock->tag = NULL;
+    }
   sock->receiver_handler = NULL;
   GNUNET_array_grow (sock->received_buf, sock->received_size, 0);
   GNUNET_free (sock->service_name);
@@ -453,7 +457,7 @@
   if ((conn->received_pos >= sizeof (struct GNUNET_MessageHeader)) &&
       (conn->received_pos >=
        ntohs (((const struct GNUNET_MessageHeader *) conn->received_buf)->
-              size)))
+             size)))
     conn->msg_complete = GNUNET_YES;
 }
 
@@ -472,7 +476,7 @@
  */
 static void
 receive_helper (void *cls, const void *buf, size_t available,
-                const struct sockaddr *addr, socklen_t addrlen, int errCode)
+               const struct sockaddr *addr, socklen_t addrlen, int errCode)
 {
   struct GNUNET_CLIENT_Connection *conn = cls;
   struct GNUNET_TIME_Relative remaining;
@@ -482,22 +486,22 @@
   GNUNET_assert (conn->msg_complete == GNUNET_NO);
   conn->in_receive = GNUNET_NO;
   if ((available == 0) || (conn->sock == NULL) || (errCode != 0))
-  {
-    /* signal timeout! */
+    {
+      /* signal timeout! */
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Timeout in receive_helper, available %u, conn->sock %s, 
errCode `%s'\n",
-                (unsigned int) available,
-                conn->sock == NULL ? "NULL" : "non-NULL", STRERROR (errCode));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Timeout in receive_helper, available %u, conn->sock %s, errCode 
`%s'\n",
+          (unsigned int) available,
+          conn->sock == NULL ? "NULL" : "non-NULL", STRERROR (errCode));
 #endif
-    if (NULL != (receive_handler = conn->receiver_handler))
-    {
-      receive_handler_cls = conn->receiver_handler_cls;
-      conn->receiver_handler = NULL;
-      receive_handler (receive_handler_cls, NULL);
+      if (NULL != (receive_handler = conn->receiver_handler))
+       {
+         receive_handler_cls = conn->receiver_handler_cls;
+         conn->receiver_handler = NULL;
+         receive_handler (receive_handler_cls, NULL);
+       }
+      return;
     }
-    return;
-  }
 
   /* FIXME: optimize for common fast case where buf contains the
    * entire message and we need no copying... */
@@ -506,22 +510,22 @@
   /* slow path: append to array */
   if (conn->received_size < conn->received_pos + available)
     GNUNET_array_grow (conn->received_buf, conn->received_size,
-                       conn->received_pos + available);
+                      conn->received_pos + available);
   memcpy (&conn->received_buf[conn->received_pos], buf, available);
   conn->received_pos += available;
   check_complete (conn);
   /* check for timeout */
   remaining = GNUNET_TIME_absolute_get_remaining (conn->receive_timeout);
   if (remaining.rel_value == 0)
-  {
-    /* signal timeout! */
-    if (NULL != conn->receiver_handler)
-      conn->receiver_handler (conn->receiver_handler_cls, NULL);
-    return;
-  }
+    {
+      /* signal timeout! */
+      if (NULL != conn->receiver_handler)
+       conn->receiver_handler (conn->receiver_handler_cls, NULL);
+      return;
+    }
   /* back to receive -- either for more data or to call callback! */
   GNUNET_CLIENT_receive (conn, conn->receiver_handler,
-                         conn->receiver_handler_cls, remaining);
+                        conn->receiver_handler_cls, remaining);
 }
 
 
@@ -537,23 +541,23 @@
   struct GNUNET_CLIENT_Connection *sock = cls;
   GNUNET_CLIENT_MessageHandler handler = sock->receiver_handler;
   const struct GNUNET_MessageHeader *cmsg =
-      (const struct GNUNET_MessageHeader *) sock->received_buf;
+    (const struct GNUNET_MessageHeader *) sock->received_buf;
   void *handler_cls = sock->receiver_handler_cls;
   uint16_t msize = ntohs (cmsg->size);
   char mbuf[msize];
   struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader *) mbuf;
 
 #if DEBUG_CLIENT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Received message of type %u and size %u\n", ntohs (cmsg->type),
-              msize);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Received message of type %u and size %u\n", ntohs (cmsg->type),
+       msize);
 #endif
   sock->receive_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_assert (GNUNET_YES == sock->msg_complete);
   GNUNET_assert (sock->received_pos >= msize);
   memcpy (msg, cmsg, msize);
   memmove (sock->received_buf, &sock->received_buf[msize],
-           sock->received_pos - msize);
+          sock->received_pos - msize);
   sock->received_pos -= msize;
   sock->msg_complete = GNUNET_NO;
   sock->receiver_handler = NULL;
@@ -573,35 +577,36 @@
  */
 void
 GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
-                       GNUNET_CLIENT_MessageHandler handler, void *handler_cls,
-                       struct GNUNET_TIME_Relative timeout)
+                      GNUNET_CLIENT_MessageHandler handler,
+                      void *handler_cls, struct GNUNET_TIME_Relative timeout)
 {
   if (sock->sock == NULL)
-  {
-    /* already disconnected, fail instantly! */
-    GNUNET_break (0);           /* this should not happen in well-written 
code! */
-    if (NULL != handler)
-      handler (handler_cls, NULL);
-    return;
-  }
+    {
+      /* already disconnected, fail instantly! */
+      GNUNET_break (0);                /* this should not happen in 
well-written code! */
+      if (NULL != handler)
+       handler (handler_cls, NULL);
+      return;
+    }
   sock->receiver_handler = handler;
   sock->receiver_handler_cls = handler_cls;
   sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout);
   if (GNUNET_YES == sock->msg_complete)
-  {
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->receive_task);
-    sock->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, sock);
-  }
+    {
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->receive_task);
+      sock->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, sock);
+    }
   else
-  {
-    GNUNET_assert (sock->in_receive == GNUNET_NO);
-    sock->in_receive = GNUNET_YES;
+    {
+      GNUNET_assert (sock->in_receive == GNUNET_NO);
+      sock->in_receive = GNUNET_YES;
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "calling 
GNUNET_CONNECTION_receive\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "calling GNUNET_CONNECTION_receive\n");
 #endif
-    GNUNET_CONNECTION_receive (sock->sock, GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                               timeout, &receive_helper, sock);
-  }
+      GNUNET_CONNECTION_receive (sock->sock,
+                                GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, timeout,
+                                &receive_helper, sock);
+    }
 }
 
 
@@ -612,7 +617,7 @@
 service_test_error (GNUNET_SCHEDULER_Task task, void *task_cls)
 {
   GNUNET_SCHEDULER_add_continuation (task, task_cls,
-                                     GNUNET_SCHEDULER_REASON_TIMEOUT);
+                                    GNUNET_SCHEDULER_REASON_TIMEOUT);
 }
 
 
@@ -631,18 +636,18 @@
    * detail in the future, for example, is this the
    * correct service? FIXME! */
   if (msg != NULL)
-  {
+    {
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Received confirmation that service is running.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Received confirmation that service is running.\n");
 #endif
-    GNUNET_SCHEDULER_add_continuation (conn->test_cb, conn->test_cb_cls,
-                                       GNUNET_SCHEDULER_REASON_PREREQ_DONE);
-  }
+      GNUNET_SCHEDULER_add_continuation (conn->test_cb, conn->test_cb_cls,
+                                        GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+    }
   else
-  {
-    service_test_error (conn->test_cb, conn->test_cb_cls);
-  }
+    {
+      service_test_error (conn->test_cb, conn->test_cb_cls);
+    }
   GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
 }
 
@@ -663,24 +668,23 @@
   struct GNUNET_MessageHeader *msg;
 
   if (size < sizeof (struct GNUNET_MessageHeader))
-  {
+    {
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                _("Failure to transmit TEST request.\n"));
+      LOG (GNUNET_ERROR_TYPE_DEBUG, _("Failure to transmit TEST request.\n"));
 #endif
-    service_test_error (conn->test_cb, conn->test_cb_cls);
-    GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
-    return 0;                   /* client disconnected */
-  }
+      service_test_error (conn->test_cb, conn->test_cb_cls);
+      GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
+      return 0;                        /* client disconnected */
+    }
 #if DEBUG_CLIENT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "TEST");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "TEST");
 #endif
   msg = (struct GNUNET_MessageHeader *) buf;
   msg->type = htons (GNUNET_MESSAGE_TYPE_TEST);
   msg->size = htons (sizeof (struct GNUNET_MessageHeader));
   GNUNET_CLIENT_receive (conn, &confirm_handler, conn,
-                         GNUNET_TIME_absolute_get_remaining
-                         (conn->test_deadline));
+                        GNUNET_TIME_absolute_get_remaining
+                        (conn->test_deadline));
   return sizeof (struct GNUNET_MessageHeader);
 }
 
@@ -700,9 +704,9 @@
  */
 void
 GNUNET_CLIENT_service_test (const char *service,
-                            const struct GNUNET_CONFIGURATION_Handle *cfg,
-                            struct GNUNET_TIME_Relative timeout,
-                            GNUNET_SCHEDULER_Task task, void *task_cls)
+                           const struct GNUNET_CONFIGURATION_Handle *cfg,
+                           struct GNUNET_TIME_Relative timeout,
+                           GNUNET_SCHEDULER_Task task, void *task_cls)
 {
   char *hostname;
   unsigned long long port;
@@ -710,8 +714,8 @@
   struct GNUNET_CLIENT_Connection *conn;
 
 #if DEBUG_CLIENT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing if service `%s' is running.\n",
-              service);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Testing if service `%s' is running.\n",
+       service);
 #endif
 #ifdef AF_UNIX
   {
@@ -721,49 +725,50 @@
     char *unixpath;
 
     unixpath = NULL;
-    if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service, 
"UNIXPATH", &unixpath)) && (0 < strlen (unixpath)))  /* We have a non-NULL 
unixpath, does that mean it's valid? */
-    {
-      if (strlen (unixpath) >= sizeof (s_un.sun_path))
+    if ((GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, service, 
"UNIXPATH", &unixpath)) && (0 < strlen (unixpath))) /* We have a non-NULL 
unixpath, does that mean it's valid? */
       {
-        GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                    _("UNIXPATH `%s' too long, maximum length is %llu\n"),
-                    unixpath, sizeof (s_un.sun_path));
-      }
-      else
-      {
-        sock = GNUNET_NETWORK_socket_create (PF_UNIX, SOCK_STREAM, 0);
-        if (sock != NULL)
-        {
-          memset (&s_un, 0, sizeof (s_un));
-          s_un.sun_family = AF_UNIX;
-          slen = strlen (unixpath) + 1;
-          if (slen >= sizeof (s_un.sun_path))
-            slen = sizeof (s_un.sun_path) - 1;
-          memcpy (s_un.sun_path, unixpath, slen);
-          s_un.sun_path[slen] = '\0';
-          slen = sizeof (struct sockaddr_un);
+       if (strlen (unixpath) >= sizeof (s_un.sun_path))
+         {
+           LOG (GNUNET_ERROR_TYPE_WARNING,
+                _("UNIXPATH `%s' too long, maximum length is %llu\n"),
+                unixpath, sizeof (s_un.sun_path));
+         }
+       else
+         {
+           sock = GNUNET_NETWORK_socket_create (PF_UNIX, SOCK_STREAM, 0);
+           if (sock != NULL)
+             {
+               memset (&s_un, 0, sizeof (s_un));
+               s_un.sun_family = AF_UNIX;
+               slen = strlen (unixpath) + 1;
+               if (slen >= sizeof (s_un.sun_path))
+                 slen = sizeof (s_un.sun_path) - 1;
+               memcpy (s_un.sun_path, unixpath, slen);
+               s_un.sun_path[slen] = '\0';
+               slen = sizeof (struct sockaddr_un);
 #if LINUX
-          s_un.sun_path[0] = '\0';
+               s_un.sun_path[0] = '\0';
 #endif
 #if HAVE_SOCKADDR_IN_SIN_LEN
-          s_un.sun_len = (u_char) slen;
+               s_un.sun_len = (u_char) slen;
 #endif
-          if (GNUNET_OK !=
-              GNUNET_NETWORK_socket_bind (sock, (const struct sockaddr *) 
&s_un,
-                                          slen))
-          {
-            /* failed to bind => service must be running */
-            GNUNET_free (unixpath);
-            (void) GNUNET_NETWORK_socket_close (sock);
-            GNUNET_SCHEDULER_add_continuation (task, task_cls,
-                                               
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
-            return;
-          }
-          (void) GNUNET_NETWORK_socket_close (sock);
-        }
-        /* let's try IP */
+               if (GNUNET_OK !=
+                   GNUNET_NETWORK_socket_bind (sock,
+                                               (const struct sockaddr *)
+                                               &s_un, slen))
+                 {
+                   /* failed to bind => service must be running */
+                   GNUNET_free (unixpath);
+                   (void) GNUNET_NETWORK_socket_close (sock);
+                   GNUNET_SCHEDULER_add_continuation (task, task_cls,
+                                                      
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+                   return;
+                 }
+               (void) GNUNET_NETWORK_socket_close (sock);
+             }
+           /* let's try IP */
+         }
       }
-    }
     GNUNET_free_non_null (unixpath);
   }
 #endif
@@ -774,121 +779,124 @@
       (port > 65535) ||
       (GNUNET_OK !=
        GNUNET_CONFIGURATION_get_value_string (cfg, service, "HOSTNAME",
-                                              &hostname)))
-  {
-    /* UNIXPATH failed (if possible) AND IP failed => error */
-    service_test_error (task, task_cls);
-    return;
-  }
+                                             &hostname)))
+    {
+      /* UNIXPATH failed (if possible) AND IP failed => error */
+      service_test_error (task, task_cls);
+      return;
+    }
 
   if (0 == strcmp ("localhost", hostname)
 #if !LINUX
       && 0
 #endif
-      )
-  {
-    /* can test using 'bind' */
-    struct sockaddr_in s_in;
+    )
+    {
+      /* can test using 'bind' */
+      struct sockaddr_in s_in;
 
-    memset (&s_in, 0, sizeof (s_in));
+      memset (&s_in, 0, sizeof (s_in));
 #if HAVE_SOCKADDR_IN_SIN_LEN
-    s_in.sin_len = sizeof (struct sockaddr_in);
+      s_in.sin_len = sizeof (struct sockaddr_in);
 #endif
-    s_in.sin_family = AF_INET;
-    s_in.sin_port = htons (port);
+      s_in.sin_family = AF_INET;
+      s_in.sin_port = htons (port);
 
-    sock = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0);
-    if (sock != NULL)
-    {
-      if (GNUNET_OK !=
-          GNUNET_NETWORK_socket_bind (sock, (const struct sockaddr *) &s_in,
-                                      sizeof (s_in)))
-      {
-        /* failed to bind => service must be running */
-        GNUNET_free (hostname);
-        (void) GNUNET_NETWORK_socket_close (sock);
-        GNUNET_SCHEDULER_add_continuation (task, task_cls,
-                                           
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
-        return;
-      }
-      (void) GNUNET_NETWORK_socket_close (sock);
+      sock = GNUNET_NETWORK_socket_create (AF_INET, SOCK_STREAM, 0);
+      if (sock != NULL)
+       {
+         if (GNUNET_OK !=
+             GNUNET_NETWORK_socket_bind (sock,
+                                         (const struct sockaddr *) &s_in,
+                                         sizeof (s_in)))
+           {
+             /* failed to bind => service must be running */
+             GNUNET_free (hostname);
+             (void) GNUNET_NETWORK_socket_close (sock);
+             GNUNET_SCHEDULER_add_continuation (task, task_cls,
+                                                
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+             return;
+           }
+         (void) GNUNET_NETWORK_socket_close (sock);
+       }
     }
-  }
 
   if (0 == strcmp ("ip6-localhost", hostname)
 #if !LINUX
       && 0
 #endif
-      )
-  {
-    /* can test using 'bind' */
-    struct sockaddr_in6 s_in6;
+    )
+    {
+      /* can test using 'bind' */
+      struct sockaddr_in6 s_in6;
 
-    memset (&s_in6, 0, sizeof (s_in6));
+      memset (&s_in6, 0, sizeof (s_in6));
 #if HAVE_SOCKADDR_IN_SIN_LEN
-    s_in6.sin6_len = sizeof (struct sockaddr_in6);
+      s_in6.sin6_len = sizeof (struct sockaddr_in6);
 #endif
-    s_in6.sin6_family = AF_INET6;
-    s_in6.sin6_port = htons (port);
+      s_in6.sin6_family = AF_INET6;
+      s_in6.sin6_port = htons (port);
 
-    sock = GNUNET_NETWORK_socket_create (AF_INET6, SOCK_STREAM, 0);
-    if (sock != NULL)
-    {
-      if (GNUNET_OK !=
-          GNUNET_NETWORK_socket_bind (sock, (const struct sockaddr *) &s_in6,
-                                      sizeof (s_in6)))
-      {
-        /* failed to bind => service must be running */
-        GNUNET_free (hostname);
-        (void) GNUNET_NETWORK_socket_close (sock);
-        GNUNET_SCHEDULER_add_continuation (task, task_cls,
-                                           
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
-        return;
-      }
-      (void) GNUNET_NETWORK_socket_close (sock);
+      sock = GNUNET_NETWORK_socket_create (AF_INET6, SOCK_STREAM, 0);
+      if (sock != NULL)
+       {
+         if (GNUNET_OK !=
+             GNUNET_NETWORK_socket_bind (sock,
+                                         (const struct sockaddr *) &s_in6,
+                                         sizeof (s_in6)))
+           {
+             /* failed to bind => service must be running */
+             GNUNET_free (hostname);
+             (void) GNUNET_NETWORK_socket_close (sock);
+             GNUNET_SCHEDULER_add_continuation (task, task_cls,
+                                                
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+             return;
+           }
+         (void) GNUNET_NETWORK_socket_close (sock);
+       }
     }
-  }
 
   if (((0 == strcmp ("localhost", hostname)) ||
        (0 == strcmp ("ip6-localhost", hostname)))
 #if !LINUX
       && 0
 #endif
-      )
-  {
-    /* all binds succeeded => claim service not running right now */
-    GNUNET_free_non_null (hostname);
-    service_test_error (task, task_cls);
-    return;
-  }
+    )
+    {
+      /* all binds succeeded => claim service not running right now */
+      GNUNET_free_non_null (hostname);
+      service_test_error (task, task_cls);
+      return;
+    }
   GNUNET_free_non_null (hostname);
 
   /* non-localhost, try 'connect' method */
   conn = GNUNET_CLIENT_connect (service, cfg);
   if (conn == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Could not connect to service `%s', must not be running.\n"),
-                service);
-    service_test_error (task, task_cls);
-    return;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Could not connect to service `%s', must not be running.\n"),
+          service);
+      service_test_error (task, task_cls);
+      return;
+    }
   conn->test_cb = task;
   conn->test_cb_cls = task_cls;
   conn->test_deadline = GNUNET_TIME_relative_to_absolute (timeout);
 
   if (NULL ==
       GNUNET_CLIENT_notify_transmit_ready (conn,
-                                           sizeof (struct 
GNUNET_MessageHeader),
-                                           timeout, GNUNET_YES, &write_test,
-                                           conn))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("Failure to transmit request to service `%s'\n"), service);
-    service_test_error (task, task_cls);
-    GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
-    return;
-  }
+                                          sizeof (struct
+                                                  GNUNET_MessageHeader),
+                                          timeout, GNUNET_YES, &write_test,
+                                          conn))
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("Failure to transmit request to service `%s'\n"), service);
+      service_test_error (task, task_cls);
+      GNUNET_CLIENT_disconnect (conn, GNUNET_NO);
+      return;
+    }
 }
 
 
@@ -902,8 +910,7 @@
  * @param buf where to write them
  * @return number of bytes written to buf
  */
-static size_t
-client_notify (void *cls, size_t size, void *buf);
+static size_t client_notify (void *cls, size_t size, void *buf);
 
 
 /**
@@ -914,59 +921,60 @@
  * @param tc unused
  */
 static void
-client_delayed_retry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_delayed_retry (void *cls,
+                     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_CLIENT_TransmitHandle *th = cls;
   struct GNUNET_TIME_Relative delay;
 
   th->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-  {
+    {
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Transmission failed due to shutdown.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmission failed due to shutdown.\n");
 #endif
-    th->sock->th = NULL;
-    th->notify (th->notify_cls, 0, NULL);
-    GNUNET_free (th);
-    return;
-  }
+      th->sock->th = NULL;
+      th->notify (th->notify_cls, 0, NULL);
+      GNUNET_free (th);
+      return;
+    }
   th->sock->sock =
-      do_connect (th->sock->service_name, th->sock->cfg, th->sock->attempts++);
+    do_connect (th->sock->service_name, th->sock->cfg, th->sock->attempts++);
   if (NULL == th->sock->sock)
-  {
-    /* could happen if we're out of sockets */
-    delay =
-        GNUNET_TIME_relative_min (GNUNET_TIME_absolute_get_remaining
-                                  (th->timeout), th->sock->back_off);
-    th->sock->back_off =
-        GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply
-                                  (th->sock->back_off, 2),
-                                  GNUNET_TIME_UNIT_SECONDS);
+    {
+      /* could happen if we're out of sockets */
+      delay =
+       GNUNET_TIME_relative_min (GNUNET_TIME_absolute_get_remaining
+                                 (th->timeout), th->sock->back_off);
+      th->sock->back_off =
+       GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply
+                                 (th->sock->back_off, 2),
+                                 GNUNET_TIME_UNIT_SECONDS);
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Transmission failed %u times, trying again in %llums.\n",
-                MAX_ATTEMPTS - th->attempts_left,
-                (unsigned long long) delay.rel_value);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Transmission failed %u times, trying again in %llums.\n",
+          MAX_ATTEMPTS - th->attempts_left,
+          (unsigned long long) delay.rel_value);
 #endif
-    th->reconnect_task =
-        GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
-    return;
-  }
-  GNUNET_CONNECTION_ignore_shutdown (th->sock->sock, 
th->sock->ignore_shutdown);
+      th->reconnect_task =
+       GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
+      return;
+    }
+  GNUNET_CONNECTION_ignore_shutdown (th->sock->sock,
+                                    th->sock->ignore_shutdown);
   th->th =
-      GNUNET_CONNECTION_notify_transmit_ready (th->sock->sock, th->size,
-                                               
GNUNET_TIME_absolute_get_remaining
-                                               (th->timeout), &client_notify,
-                                               th);
+    GNUNET_CONNECTION_notify_transmit_ready (th->sock->sock, th->size,
+                                            GNUNET_TIME_absolute_get_remaining
+                                            (th->timeout), &client_notify,
+                                            th);
   if (th->th == NULL)
-  {
-    GNUNET_break (0);
-    th->sock->th = NULL;
-    th->notify (th->notify_cls, 0, NULL);
-    GNUNET_free (th);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      th->sock->th = NULL;
+      th->notify (th->notify_cls, 0, NULL);
+      GNUNET_free (th);
+      return;
+    }
 }
 
 
@@ -989,47 +997,47 @@
   th->th = NULL;
   th->sock->th = NULL;
   if (buf == NULL)
-  {
-    delay = GNUNET_TIME_absolute_get_remaining (th->timeout);
-    delay.rel_value /= 2;
-    if ((0 !=
-         (GNUNET_SCHEDULER_REASON_SHUTDOWN & GNUNET_SCHEDULER_get_reason ())) 
||
-        (GNUNET_YES != th->auto_retry) || (0 == --th->attempts_left) ||
-        (delay.rel_value < 1))
     {
+      delay = GNUNET_TIME_absolute_get_remaining (th->timeout);
+      delay.rel_value /= 2;
+      if ((0 !=
+          (GNUNET_SCHEDULER_REASON_SHUTDOWN &
+           GNUNET_SCHEDULER_get_reason ())) || (GNUNET_YES != th->auto_retry)
+         || (0 == --th->attempts_left) || (delay.rel_value < 1))
+       {
 #if DEBUG_CLIENT
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Transmission failed %u times, giving up.\n",
-                  MAX_ATTEMPTS - th->attempts_left);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Transmission failed %u times, giving up.\n",
+              MAX_ATTEMPTS - th->attempts_left);
 #endif
-      GNUNET_break (0 == th->notify (th->notify_cls, 0, NULL));
-      GNUNET_free (th);
-      return 0;
-    }
-    /* auto-retry */
+         GNUNET_break (0 == th->notify (th->notify_cls, 0, NULL));
+         GNUNET_free (th);
+         return 0;
+       }
+      /* auto-retry */
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Failed to connect to `%s', automatically trying again.\n",
-                th->sock->service_name);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Failed to connect to `%s', automatically trying again.\n",
+          th->sock->service_name);
 #endif
-    GNUNET_CONNECTION_destroy (th->sock->sock, GNUNET_NO);
-    th->sock->sock = NULL;
-    delay = GNUNET_TIME_relative_min (delay, th->sock->back_off);
-    th->sock->back_off =
-        GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply
-                                  (th->sock->back_off, 2),
-                                  GNUNET_TIME_UNIT_SECONDS);
+      GNUNET_CONNECTION_destroy (th->sock->sock, GNUNET_NO);
+      th->sock->sock = NULL;
+      delay = GNUNET_TIME_relative_min (delay, th->sock->back_off);
+      th->sock->back_off =
+       GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply
+                                 (th->sock->back_off, 2),
+                                 GNUNET_TIME_UNIT_SECONDS);
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Transmission failed %u times, trying again in %llums.\n",
-                MAX_ATTEMPTS - th->attempts_left,
-                (unsigned long long) delay.rel_value);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Transmission failed %u times, trying again in %llums.\n",
+          MAX_ATTEMPTS - th->attempts_left,
+          (unsigned long long) delay.rel_value);
 #endif
-    th->sock->th = th;
-    th->reconnect_task =
-        GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
-    return 0;
-  }
+      th->sock->th = th;
+      th->reconnect_task =
+       GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
+      return 0;
+    }
   GNUNET_assert (size >= th->size);
   ret = th->notify (th->notify_cls, size, buf);
   GNUNET_free (th);
@@ -1058,21 +1066,21 @@
  */
 struct GNUNET_CLIENT_TransmitHandle *
 GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock,
-                                     size_t size,
-                                     struct GNUNET_TIME_Relative timeout,
-                                     int auto_retry,
-                                     GNUNET_CONNECTION_TransmitReadyNotify
-                                     notify, void *notify_cls)
+                                    size_t size,
+                                    struct GNUNET_TIME_Relative timeout,
+                                    int auto_retry,
+                                    GNUNET_CONNECTION_TransmitReadyNotify
+                                    notify, void *notify_cls)
 {
   struct GNUNET_CLIENT_TransmitHandle *th;
 
   if (NULL != sock->th)
-  {
-    /* If this breaks, you most likley called this function twice without 
waiting
-     * for completion or canceling the request */
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      /* If this breaks, you most likley called this function twice without 
waiting
+       * for completion or canceling the request */
+      GNUNET_break (0);
+      return NULL;
+    }
   th = GNUNET_malloc (sizeof (struct GNUNET_CLIENT_TransmitHandle));
   th->sock = sock;
   th->size = size;
@@ -1083,25 +1091,25 @@
   th->attempts_left = MAX_ATTEMPTS;
   sock->th = th;
   if (sock->sock == NULL)
-  {
-    th->reconnect_task =
-        GNUNET_SCHEDULER_add_delayed (sock->back_off, &client_delayed_retry,
-                                      th);
+    {
+      th->reconnect_task =
+       GNUNET_SCHEDULER_add_delayed (sock->back_off, &client_delayed_retry,
+                                     th);
 
-  }
+    }
   else
-  {
-    th->th =
-        GNUNET_CONNECTION_notify_transmit_ready (sock->sock, size, timeout,
-                                                 &client_notify, th);
-    if (NULL == th->th)
     {
-      GNUNET_break (0);
-      GNUNET_free (th);
-      sock->th = NULL;
-      return NULL;
+      th->th =
+       GNUNET_CONNECTION_notify_transmit_ready (sock->sock, size, timeout,
+                                                &client_notify, th);
+      if (NULL == th->th)
+       {
+         GNUNET_break (0);
+         GNUNET_free (th);
+         sock->th = NULL;
+         return NULL;
+       }
     }
-  }
   return th;
 }
 
@@ -1112,20 +1120,20 @@
  * @param th handle from the original request.
  */
 void
-GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle
-                                            *th)
+GNUNET_CLIENT_notify_transmit_ready_cancel (struct
+                                           GNUNET_CLIENT_TransmitHandle *th)
 {
   if (th->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_assert (NULL == th->th);
-    GNUNET_SCHEDULER_cancel (th->reconnect_task);
-    th->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_assert (NULL == th->th);
+      GNUNET_SCHEDULER_cancel (th->reconnect_task);
+      th->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   else
-  {
-    GNUNET_assert (NULL != th->th);
-    GNUNET_CONNECTION_notify_transmit_ready_cancel (th->th);
-  }
+    {
+      GNUNET_assert (NULL != th->th);
+      GNUNET_CONNECTION_notify_transmit_ready_cancel (th->th);
+    }
   th->sock->th = NULL;
   GNUNET_free (th);
 }
@@ -1151,21 +1159,21 @@
   tc->sock->tag = NULL;
   msize = ntohs (tc->hdr->size);
   if (NULL == buf)
-  {
+    {
 #if DEBUG_CLIENT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                _
-                ("Could not submit request, not expecting to receive a 
response.\n"));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          _
+          ("Could not submit request, not expecting to receive a 
response.\n"));
 #endif
-    if (NULL != tc->rn)
-      tc->rn (tc->rn_cls, NULL);
-    GNUNET_free (tc);
-    return 0;
-  }
+      if (NULL != tc->rn)
+       tc->rn (tc->rn_cls, NULL);
+      GNUNET_free (tc);
+      return 0;
+    }
   GNUNET_assert (size >= msize);
   memcpy (buf, tc->hdr, msize);
   GNUNET_CLIENT_receive (tc->sock, tc->rn, tc->rn_cls,
-                         GNUNET_TIME_absolute_get_remaining (tc->timeout));
+                        GNUNET_TIME_absolute_get_remaining (tc->timeout));
   GNUNET_free (tc);
   return msize;
 }
@@ -1193,12 +1201,14 @@
  *         is already pending
  */
 int
-GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock,
-                                         const struct GNUNET_MessageHeader 
*hdr,
-                                         struct GNUNET_TIME_Relative timeout,
-                                         int auto_retry,
-                                         GNUNET_CLIENT_MessageHandler rn,
-                                         void *rn_cls)
+GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection
+                                        *sock,
+                                        const struct GNUNET_MessageHeader
+                                        *hdr,
+                                        struct GNUNET_TIME_Relative timeout,
+                                        int auto_retry,
+                                        GNUNET_CLIENT_MessageHandler rn,
+                                        void *rn_cls)
 {
   struct TransmitGetResponseContext *tc;
   uint16_t msize;
@@ -1216,12 +1226,12 @@
   tc->rn_cls = rn_cls;
   if (NULL ==
       GNUNET_CLIENT_notify_transmit_ready (sock, msize, timeout, auto_retry,
-                                           &transmit_for_response, tc))
-  {
-    GNUNET_break (0);
-    GNUNET_free (tc);
-    return GNUNET_SYSERR;
-  }
+                                          &transmit_for_response, tc))
+    {
+      GNUNET_break (0);
+      GNUNET_free (tc);
+      return GNUNET_SYSERR;
+    }
   sock->tag = tc;
   return GNUNET_OK;
 }

Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/common_allocation.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -27,6 +27,10 @@
 #include "platform.h"
 #include "gnunet_common.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 #ifndef INT_MAX
 #define INT_MAX 0x7FFFFFFF
 #endif
@@ -61,10 +65,10 @@
   GNUNET_assert_at (size <= GNUNET_MAX_MALLOC_CHECKED, filename, linenumber);
   ret = GNUNET_xmalloc_unchecked_ (size, filename, linenumber);
   if (ret == NULL)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "malloc");
-    abort ();
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "malloc");
+      abort ();
+    }
   return ret;
 }
 
@@ -82,7 +86,7 @@
  */
 void *
 GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename,
-                 int linenumber)
+                int linenumber)
 {
   void *ret;
 
@@ -97,10 +101,10 @@
   GNUNET_assert_at (size < INT_MAX, filename, linenumber);
   ret = malloc (size);
   if (ret == NULL)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "malloc");
-    abort ();
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "malloc");
+      abort ();
+    }
 #ifdef W32_MEM_LIMIT
   *((size_t *) ret) = size;
   ret = &((size_t *) ret)[1];
@@ -168,10 +172,10 @@
 #endif
   ptr = realloc (ptr, n);
   if ((NULL == ptr) && (n > 0))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "realloc");
-    abort ();
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "realloc");
+      abort ();
+    }
 #ifdef W32_MEM_LIMIT
   ptr = &((size_t *) ptr)[1];
 #endif
@@ -229,7 +233,7 @@
  */
 char *
 GNUNET_xstrndup_ (const char *str, size_t len, const char *filename,
-                  int linenumber)
+                 int linenumber)
 {
   char *res;
 
@@ -256,7 +260,7 @@
  */
 void
 GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount,
-               unsigned int newCount, const char *filename, int linenumber)
+              unsigned int newCount, const char *filename, int linenumber)
 {
   void *tmp;
   size_t size;
@@ -264,22 +268,22 @@
   GNUNET_assert_at (INT_MAX / elementSize > newCount, filename, linenumber);
   size = newCount * elementSize;
   if (size == 0)
-  {
-    tmp = NULL;
-  }
+    {
+      tmp = NULL;
+    }
   else
-  {
-    tmp = GNUNET_xmalloc_ (size, filename, linenumber);
-    memset (tmp, 0, size);      /* client code should not rely on this, 
though... */
-    if (*oldCount > newCount)
-      *oldCount = newCount;     /* shrink is also allowed! */
-    memcpy (tmp, *old, elementSize * (*oldCount));
-  }
+    {
+      tmp = GNUNET_xmalloc_ (size, filename, linenumber);
+      memset (tmp, 0, size);   /* client code should not rely on this, 
though... */
+      if (*oldCount > newCount)
+       *oldCount = newCount;   /* shrink is also allowed! */
+      memcpy (tmp, *old, elementSize * (*oldCount));
+    }
 
   if (*old != NULL)
-  {
-    GNUNET_xfree_ (*old, filename, linenumber);
-  }
+    {
+      GNUNET_xfree_ (*old, filename, linenumber);
+    }
   *old = tmp;
   *oldCount = newCount;
 }

Modified: gnunet/src/util/common_endian.c
===================================================================
--- gnunet/src/util/common_endian.c     2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/common_endian.c     2011-10-11 09:43:04 UTC (rev 17362)
@@ -27,6 +27,8 @@
 #include "platform.h"
 #include "gnunet_common.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+
 unsigned long long
 GNUNET_ntohll (unsigned long long n)
 {

Modified: gnunet/src/util/common_logging.c
===================================================================
--- gnunet/src/util/common_logging.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/common_logging.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -251,6 +251,7 @@
     return GNUNET_ERROR_TYPE_NONE;
   return GNUNET_ERROR_TYPE_INVALID;
 }
+
 #if !defined(GNUNET_CULL_LOGGING)
 /**
  * Utility function - reallocates logdefs array to be twice as large.
@@ -258,8 +259,8 @@
 static void
 resize_logdefs ()
 {
-  logdefs_size  = (logdefs_size + 1) * 2;
-  logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof (struct LogDef));  
+  logdefs_size = (logdefs_size + 1) * 2;
+  logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof (struct LogDef));
 }
 
 /**
@@ -274,7 +275,8 @@
  * @param force see struct LogDef
  */
 static void
-add_definition (char *component, char *file, char *function, int from_line, 
int to_line, int level, int force)
+add_definition (char *component, char *file, char *function, int from_line,
+               int to_line, int level, int force)
 {
   if (logdefs_size == logdefs_len)
     resize_logdefs ();
@@ -283,10 +285,10 @@
   if (strlen (component) > 0 && component[0] != '*')
     n.component = strdup (component);
   if (strlen (file) > 0 && file[0] != '*')
-  {
-    n.file = strdup (file);
-    n.strlen_file = strlen (file);
-  }
+    {
+      n.file = strdup (file);
+      n.strlen_file = strlen (file);
+    }
   if (strlen (function) > 0 && function[0] != '*')
     n.function = strdup (function);
   n.from_line = from_line;
@@ -310,8 +312,9 @@
  * @param line line at which the call is made, usually __LINE__
  * @return 0 to disallow the call, 1 to allow it
  */
-int 
-GNUNET_get_log_call_status (int caller_level, const char *comp, const char 
*file, const char *function, int line)
+int
+GNUNET_get_log_call_status (int caller_level, const char *comp,
+                           const char *file, const char *function, int line)
 {
   struct LogDef *ld;
   int i;
@@ -332,21 +335,20 @@
   force_only = min_level >= 0;
   strlen_file = strlen (file);
   for (i = 0; i < logdefs_len; i++)
-  {
-    ld = &logdefs[i];
-    if ((!force_only || ld->force) &&
-        (line >= ld->from_line && line <= ld->to_line) &&
-        (ld->component == NULL || strcmp (comp, ld->component) == 0) &&
-        (ld->file == NULL ||
-         (ld->strlen_file <= strlen_file &&
-          strcmp (&file[strlen_file - ld->strlen_file], ld->file) == 0)) &&
-        (ld->function == NULL || strcmp (function, ld->function) == 0)
-       )
     {
-      /* We're finished */
-      return caller_level <= ld->level;
+      ld = &logdefs[i];
+      if ((!force_only || ld->force) &&
+         (line >= ld->from_line && line <= ld->to_line) &&
+         (ld->component == NULL || strcmp (comp, ld->component) == 0) &&
+         (ld->file == NULL ||
+          (ld->strlen_file <= strlen_file &&
+           strcmp (&file[strlen_file - ld->strlen_file], ld->file) == 0)) &&
+         (ld->function == NULL || strcmp (function, ld->function) == 0))
+       {
+         /* We're finished */
+         return caller_level <= ld->level;
+       }
     }
-  }
   /* No matches - use global level, if defined */
   if (min_level >= 0)
     return caller_level <= min_level;
@@ -404,83 +406,85 @@
   from_line = 0;
   to_line = INT_MAX;
   for (p = def, state = 0, start = def; keep_looking; p++)
-  {
-    switch (p[0])
     {
-    case ';': /* found a field separator */
-      p[0] = '\0';
-      switch (state)
-      {
-      case 0: /* within a component name */
-        comp = start;
-        break;
-      case 1: /* within a file name */
-        file = start;
-        break;
-      case 2: /* within a function name */
-        /* after a file name there must be a function name */
-        function = start;
-        break;
-      case 3: /* within a from-to line range */
-        if (strlen (start) > 0)
-        {
-          errno = 0;
-          from_line = strtol (start, &t, 10);
-          if (errno != 0 || from_line < 0)
-          {
-            free (def);
-            return counter;
-          }
-          if (t < p && t[0] == '-')
-          {
-            errno = 0;
-            start = t + 1;
-            to_line = strtol (start, &t, 10);
-            if (errno != 0 || to_line < 0 || t != p)
-            {
-              free (def);
-              return counter;
-            }
-          }
-          else /* one number means "match this line only" */
-            to_line = from_line;
-        }
-        else /* default to 0-max */
-        {
-          from_line = 0;
-          to_line = INT_MAX;
-        }
-        break;
-      }
-      start = p + 1;
-      state += 1;
-      break;
-    case '\0': /* found EOL */
-      keep_looking = 0;
-      /* fall through to '/' */
-    case '/': /* found a definition separator */
-      switch (state)
-      {
-      case 4: /* within a log level */
-        p[0] = '\0';
-        state = 0;
-        level = get_type ((const char *) start);
-        if (level == GNUNET_ERROR_TYPE_INVALID || level == 
GNUNET_ERROR_TYPE_UNSPECIFIED)
-        {
-          free (def);
-          return counter;
-        }
-        add_definition (comp, file, function, from_line, to_line, level, 
force);
-        counter += 1;
-        start = p + 1;
-        break;
-      default:
-        break;
-      }
-    default:
-      break;
+      switch (p[0])
+       {
+       case ';':               /* found a field separator */
+         p[0] = '\0';
+         switch (state)
+           {
+           case 0:             /* within a component name */
+             comp = start;
+             break;
+           case 1:             /* within a file name */
+             file = start;
+             break;
+           case 2:             /* within a function name */
+             /* after a file name there must be a function name */
+             function = start;
+             break;
+           case 3:             /* within a from-to line range */
+             if (strlen (start) > 0)
+               {
+                 errno = 0;
+                 from_line = strtol (start, &t, 10);
+                 if (errno != 0 || from_line < 0)
+                   {
+                     free (def);
+                     return counter;
+                   }
+                 if (t < p && t[0] == '-')
+                   {
+                     errno = 0;
+                     start = t + 1;
+                     to_line = strtol (start, &t, 10);
+                     if (errno != 0 || to_line < 0 || t != p)
+                       {
+                         free (def);
+                         return counter;
+                       }
+                   }
+                 else          /* one number means "match this line only" */
+                   to_line = from_line;
+               }
+             else              /* default to 0-max */
+               {
+                 from_line = 0;
+                 to_line = INT_MAX;
+               }
+             break;
+           }
+         start = p + 1;
+         state += 1;
+         break;
+       case '\0':              /* found EOL */
+         keep_looking = 0;
+         /* fall through to '/' */
+       case '/':               /* found a definition separator */
+         switch (state)
+           {
+           case 4:             /* within a log level */
+             p[0] = '\0';
+             state = 0;
+             level = get_type ((const char *) start);
+             if (level == GNUNET_ERROR_TYPE_INVALID
+                 || level == GNUNET_ERROR_TYPE_UNSPECIFIED)
+               {
+                 free (def);
+                 return counter;
+               }
+             add_definition (comp, file, function, from_line, to_line, level,
+                             force);
+             counter += 1;
+             start = p + 1;
+             break;
+           default:
+             break;
+           }
+       default:
+         break;
+       }
     }
-  }
   free (def);
   return counter;
 }
@@ -495,7 +499,8 @@
     parse_definitions ("GNUNET_LOG", 0);
   gnunet_log_parsed = GNUNET_YES;
   if (gnunet_force_log_parsed == GNUNET_NO)
-    gnunet_force_log_present = parse_definitions ("GNUNET_FORCE_LOG", 1) > 0 ? 
GNUNET_YES : GNUNET_NO;
+    gnunet_force_log_present =
+      parse_definitions ("GNUNET_FORCE_LOG", 1) > 0 ? GNUNET_YES : GNUNET_NO;
   gnunet_force_log_parsed = GNUNET_YES;
 }
 #endif
@@ -539,15 +544,16 @@
   dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
   altlog = FOPEN (fn, "a");
   if (altlog == NULL)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
-    if (dirwarn)
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("Failed to create or access directory for log file 
`%s'\n"),
-                  fn);
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", fn);
+      if (dirwarn)
+       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                   _
+                   ("Failed to create or access directory for log file 
`%s'\n"),
+                   fn);
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (fn);
   if (GNUNET_stderr != NULL)
     fclose (GNUNET_stderr);
@@ -588,11 +594,11 @@
   prev = NULL;
   pos = loggers;
   while ((pos != NULL) &&
-         ((pos->logger != logger) || (pos->logger_cls != logger_cls)))
-  {
-    prev = pos;
-    pos = pos->next;
-  }
+        ((pos->logger != logger) || (pos->logger_cls != logger_cls)))
+    {
+      prev = pos;
+      pos = pos->next;
+    }
   GNUNET_assert (pos != NULL);
   if (prev == NULL)
     loggers = pos->next;
@@ -612,22 +618,22 @@
  */
 static void
 output_message (enum GNUNET_ErrorType kind, const char *comp,
-                const char *datestr, const char *msg)
+               const char *datestr, const char *msg)
 {
   struct CustomLogger *pos;
 
   if (GNUNET_stderr != NULL)
-  {
-    fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp,
-             GNUNET_error_type_to_string (kind), msg);
-    fflush (GNUNET_stderr);
-  }
+    {
+      fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp,
+              GNUNET_error_type_to_string (kind), msg);
+      fflush (GNUNET_stderr);
+    }
   pos = loggers;
   while (pos != NULL)
-  {
-    pos->logger (pos->logger_cls, kind, comp, datestr, msg);
-    pos = pos->next;
-  }
+    {
+      pos->logger (pos->logger_cls, kind, comp, datestr, msg);
+      pos = pos->next;
+    }
 }
 
 
@@ -653,15 +659,16 @@
   else if (last != last_bulk)
     last--;
   if (last[0] == '\n')
-  {
-    rev = 1;
-    last[0] = '\0';
-  }
-  ft = GNUNET_STRINGS_relative_time_to_string 
(GNUNET_TIME_absolute_get_duration
-                                               (last_bulk_time));
+    {
+      rev = 1;
+      last[0] = '\0';
+    }
+  ft =
+    GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration
+                                           (last_bulk_time));
   snprintf (msg, sizeof (msg),
-            _("Message `%.*s' repeated %u times in the last %s\n"),
-            BULK_TRACK_SIZE, last_bulk, last_bulk_repeat, ft);
+           _("Message `%.*s' repeated %u times in the last %s\n"),
+           BULK_TRACK_SIZE, last_bulk, last_bulk_repeat, ft);
   GNUNET_free (ft);
   if (rev == 1)
     last[0] = '\n';
@@ -681,14 +688,14 @@
 GNUNET_log_skip (unsigned int n, int check_reset)
 {
   if (n == 0)
-  {
-    int ok;
+    {
+      int ok;
 
-    ok = (0 == skip_log);
-    skip_log = 0;
-    if (check_reset)
-      GNUNET_assert (ok);
-  }
+      ok = (0 == skip_log);
+      skip_log = 0;
+      if (check_reset)
+       GNUNET_assert (ok);
+    }
   else
     skip_log += n;
 }
@@ -720,40 +727,42 @@
   va_end (vacp);
   buf = malloc (size);
   if (buf == NULL)
-    return;                     /* oops */
+    return;                    /* oops */
   VSNPRINTF (buf, size, message, va);
   time (&timetmp);
   memset (date, 0, DATE_STR_SIZE);
   tmptr = localtime (&timetmp);
   gettimeofday (&timeofday, NULL);
   if (NULL != tmptr)
-  {
+    {
 #ifdef WINDOWS
-    LARGE_INTEGER pc;
+      LARGE_INTEGER pc;
 
-    pc.QuadPart = 0;
-    QueryPerformanceCounter (&pc);
-    strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%020llu", tmptr);
-    snprintf (date, sizeof (date), date2,
-              (long long) (pc.QuadPart /
-                           (performance_frequency.QuadPart / 1000)));
+      pc.QuadPart = 0;
+      QueryPerformanceCounter (&pc);
+      strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%020llu", tmptr);
+      snprintf (date, sizeof (date), date2,
+               (long long) (pc.QuadPart /
+                            (performance_frequency.QuadPart / 1000)));
 #else
-    strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr);
-    snprintf (date, sizeof (date), date2, timeofday.tv_usec);
+      strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr);
+      snprintf (date, sizeof (date), date2, timeofday.tv_usec);
 #endif
-  }
+    }
   else
     strcpy (date, "localtime error");
-  if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && (last_bulk_time.abs_value != 0)
+  if ((0 != (kind & GNUNET_ERROR_TYPE_BULK))
+      && (last_bulk_time.abs_value != 0)
       && (0 == strncmp (buf, last_bulk, sizeof (last_bulk))))
-  {
-    last_bulk_repeat++;
-    if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value >
-         BULK_DELAY_THRESHOLD) || (last_bulk_repeat > BULK_REPEAT_THRESHOLD))
-      flush_bulk (date);
-    free (buf);
-    return;
-  }
+    {
+      last_bulk_repeat++;
+      if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value >
+          BULK_DELAY_THRESHOLD)
+         || (last_bulk_repeat > BULK_REPEAT_THRESHOLD))
+       flush_bulk (date);
+      free (buf);
+      return;
+    }
   flush_bulk (date);
   strncpy (last_bulk, buf, sizeof (last_bulk));
   last_bulk_repeat = 0;
@@ -794,7 +803,7 @@
  */
 void
 GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, const char *comp,
-                 const char *message, ...)
+                        const char *message, ...)
 {
   va_list va;
   char comp_w_pid[128];
@@ -912,44 +921,44 @@
   if (addr == NULL)
     return _("unknown address");
   switch (addr->sa_family)
-  {
-  case AF_INET:
-    if (addrlen != sizeof (struct sockaddr_in))
-      return "<invalid v4 address>";
-    v4 = (const struct sockaddr_in *) addr;
-    inet_ntop (AF_INET, &v4->sin_addr, buf, INET_ADDRSTRLEN);
-    if (0 == ntohs (v4->sin_port))
+    {
+    case AF_INET:
+      if (addrlen != sizeof (struct sockaddr_in))
+       return "<invalid v4 address>";
+      v4 = (const struct sockaddr_in *) addr;
+      inet_ntop (AF_INET, &v4->sin_addr, buf, INET_ADDRSTRLEN);
+      if (0 == ntohs (v4->sin_port))
+       return buf;
+      strcat (buf, ":");
+      GNUNET_snprintf (b2, sizeof (b2), "%u", ntohs (v4->sin_port));
+      strcat (buf, b2);
       return buf;
-    strcat (buf, ":");
-    GNUNET_snprintf (b2, sizeof (b2), "%u", ntohs (v4->sin_port));
-    strcat (buf, b2);
-    return buf;
-  case AF_INET6:
-    if (addrlen != sizeof (struct sockaddr_in6))
-      return "<invalid v4 address>";
-    v6 = (const struct sockaddr_in6 *) addr;
-    buf[0] = '[';
-    inet_ntop (AF_INET6, &v6->sin6_addr, &buf[1], INET6_ADDRSTRLEN);
-    if (0 == ntohs (v6->sin6_port))
-      return &buf[1];
-    strcat (buf, "]:");
-    GNUNET_snprintf (b2, sizeof (b2), "%u", ntohs (v6->sin6_port));
-    strcat (buf, b2);
-    return buf;
-  case AF_UNIX:
-    if (addrlen <= sizeof (sa_family_t))
-      return "<unbound UNIX client>";
-    un = (const struct sockaddr_un *) addr;
-    off = 0;
-    if (un->sun_path[0] == '\0')
-      off++;
-    snprintf (buf, sizeof (buf), "%s%.*s", (off == 1) ? "@" : "",
-              (int) (addrlen - sizeof (sa_family_t) - 1 - off),
-              &un->sun_path[off]);
-    return buf;
-  default:
-    return _("invalid address");
-  }
+    case AF_INET6:
+      if (addrlen != sizeof (struct sockaddr_in6))
+       return "<invalid v4 address>";
+      v6 = (const struct sockaddr_in6 *) addr;
+      buf[0] = '[';
+      inet_ntop (AF_INET6, &v6->sin6_addr, &buf[1], INET6_ADDRSTRLEN);
+      if (0 == ntohs (v6->sin6_port))
+       return &buf[1];
+      strcat (buf, "]:");
+      GNUNET_snprintf (b2, sizeof (b2), "%u", ntohs (v6->sin6_port));
+      strcat (buf, b2);
+      return buf;
+    case AF_UNIX:
+      if (addrlen <= sizeof (sa_family_t))
+       return "<unbound UNIX client>";
+      un = (const struct sockaddr_un *) addr;
+      off = 0;
+      if (un->sun_path[0] == '\0')
+       off++;
+      snprintf (buf, sizeof (buf), "%s%.*s", (off == 1) ? "@" : "",
+               (int) (addrlen - sizeof (sa_family_t) - 1 - off),
+               &un->sun_path[off]);
+      return buf;
+    default:
+      return _("invalid address");
+    }
 }
 
 

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/configuration.c     2011-10-11 09:43:04 UTC (rev 17362)
@@ -33,7 +33,10 @@
 #include "gnunet_os_lib.h"
 #include "gnunet_strings_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 /**
  * @brief configuration entry
  */
@@ -149,7 +152,7 @@
  */
 int
 GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
-                            const char *filename)
+                           const char *filename)
 {
   int dirty;
   char line[256];
@@ -166,87 +169,89 @@
   fn = GNUNET_STRINGS_filename_expand (filename);
   if (fn == NULL)
     return GNUNET_SYSERR;
-  dirty = cfg->dirty;           /* back up value! */
+  dirty = cfg->dirty;          /* back up value! */
   if (NULL == (fp = FOPEN (fn, "r")))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (fn);
   ret = GNUNET_OK;
   section = GNUNET_strdup ("");
   memset (line, 0, 256);
   nr = 0;
   while (NULL != fgets (line, 255, fp))
-  {
-    nr++;
-    for (i = 0; i < 255; i++)
-      if (line[i] == '\t')
-        line[i] = ' ';
-    if (line[0] == '\n' || line[0] == '#' || line[0] == '%' || line[0] == '\r')
-      continue;
-    emptyline = 1;
-    for (i = 0; (i < 255 && line[i] != 0); i++)
-      if (line[i] != ' ' && line[i] != '\n' && line[i] != '\r')
-        emptyline = 0;
-    if (emptyline == 1)
-      continue;
-    /* remove tailing whitespace */
-    for (i = strlen (line) - 1; (i >= 0) && (isspace ((unsigned char) 
line[i]));
-         i--)
-      line[i] = '\0';
-    if (1 == sscanf (line, "@INLINE@ %191[^\n]", value))
     {
-      /* @INLINE@ value */
-      if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value))
-        ret = GNUNET_SYSERR;    /* failed to parse included config */
+      nr++;
+      for (i = 0; i < 255; i++)
+       if (line[i] == '\t')
+         line[i] = ' ';
+      if (line[0] == '\n' || line[0] == '#' || line[0] == '%'
+         || line[0] == '\r')
+       continue;
+      emptyline = 1;
+      for (i = 0; (i < 255 && line[i] != 0); i++)
+       if (line[i] != ' ' && line[i] != '\n' && line[i] != '\r')
+         emptyline = 0;
+      if (emptyline == 1)
+       continue;
+      /* remove tailing whitespace */
+      for (i = strlen (line) - 1;
+          (i >= 0) && (isspace ((unsigned char) line[i])); i--)
+       line[i] = '\0';
+      if (1 == sscanf (line, "@INLINE@ %191[^\n]", value))
+       {
+         /* @INLINE@ value */
+         if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, value))
+           ret = GNUNET_SYSERR;        /* failed to parse included config */
+       }
+      else if (1 == sscanf (line, "[%99[^]]]", value))
+       {
+         /* [value] */
+         GNUNET_free (section);
+         section = GNUNET_strdup (value);
+       }
+      else if (2 == sscanf (line, " %63[^= ] = %191[^\n]", tag, value))
+       {
+         /* tag = value */
+         /* Strip LF */
+         i = strlen (value) - 1;
+         while ((i >= 0) && (isspace ((unsigned char) value[i])))
+           value[i--] = '\0';
+         /* remove quotes */
+         i = 0;
+         if (value[0] == '"')
+           {
+             i = 1;
+             while ((value[i] != '\0') && (value[i] != '"'))
+               i++;
+             if (value[i] == '"')
+               {
+                 value[i] = '\0';
+                 i = 1;
+               }
+             else
+               i = 0;
+           }
+         GNUNET_CONFIGURATION_set_value_string (cfg, section, tag,
+                                                &value[i]);
+       }
+      else if (1 == sscanf (line, " %63[^= ] =[^\n]", tag))
+       {
+         /* tag = */
+         GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, "");
+       }
+      else
+       {
+         /* parse error */
+         LOG (GNUNET_ERROR_TYPE_WARNING,
+              _("Syntax error in configuration file `%s' at line %u.\n"),
+              filename, nr);
+         ret = GNUNET_SYSERR;
+         break;
+       }
     }
-    else if (1 == sscanf (line, "[%99[^]]]", value))
-    {
-      /* [value] */
-      GNUNET_free (section);
-      section = GNUNET_strdup (value);
-    }
-    else if (2 == sscanf (line, " %63[^= ] = %191[^\n]", tag, value))
-    {
-      /* tag = value */
-      /* Strip LF */
-      i = strlen (value) - 1;
-      while ((i >= 0) && (isspace ((unsigned char) value[i])))
-        value[i--] = '\0';
-      /* remove quotes */
-      i = 0;
-      if (value[0] == '"')
-      {
-        i = 1;
-        while ((value[i] != '\0') && (value[i] != '"'))
-          i++;
-        if (value[i] == '"')
-        {
-          value[i] = '\0';
-          i = 1;
-        }
-        else
-          i = 0;
-      }
-      GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, &value[i]);
-    }
-    else if (1 == sscanf (line, " %63[^= ] =[^\n]", tag))
-    {
-      /* tag = */
-      GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, "");
-    }
-    else
-    {
-      /* parse error */
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("Syntax error in configuration file `%s' at line %u.\n"),
-                  filename, nr);
-      ret = GNUNET_SYSERR;
-      break;
-    }
-  }
   GNUNET_assert (0 == fclose (fp));
   /* restore dirty flag - anything we set in the meantime
    * came from disk */
@@ -279,7 +284,7 @@
  */
 int
 GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
-                            const char *filename)
+                           const char *filename)
 {
   struct ConfigSection *sec;
   struct ConfigEntry *ent;
@@ -293,67 +298,67 @@
   if (fn == NULL)
     return GNUNET_SYSERR;
   if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn))
-  {
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   if (NULL == (fp = FOPEN (fn, "w")))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (fn);
   error = 0;
   sec = cfg->sections;
   while (sec != NULL)
-  {
-    if (0 > fprintf (fp, "[%s]\n", sec->name))
     {
-      error = 1;
-      break;
+      if (0 > fprintf (fp, "[%s]\n", sec->name))
+       {
+         error = 1;
+         break;
+       }
+      ent = sec->entries;
+      while (ent != NULL)
+       {
+         if (ent->val != NULL)
+           {
+             val = GNUNET_malloc (strlen (ent->val) * 2 + 1);
+             strcpy (val, ent->val);
+             while (NULL != (pos = strstr (val, "\n")))
+               {
+                 memmove (&pos[2], &pos[1], strlen (&pos[1]));
+                 pos[0] = '\\';
+                 pos[1] = 'n';
+               }
+             if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
+               {
+                 error = 1;
+                 GNUNET_free (val);
+                 break;
+               }
+             GNUNET_free (val);
+           }
+         ent = ent->next;
+       }
+      if (error != 0)
+       break;
+      if (0 > fprintf (fp, "\n"))
+       {
+         error = 1;
+         break;
+       }
+      sec = sec->next;
     }
-    ent = sec->entries;
-    while (ent != NULL)
-    {
-      if (ent->val != NULL)
-      {
-        val = GNUNET_malloc (strlen (ent->val) * 2 + 1);
-        strcpy (val, ent->val);
-        while (NULL != (pos = strstr (val, "\n")))
-        {
-          memmove (&pos[2], &pos[1], strlen (&pos[1]));
-          pos[0] = '\\';
-          pos[1] = 'n';
-        }
-        if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
-        {
-          error = 1;
-          GNUNET_free (val);
-          break;
-        }
-        GNUNET_free (val);
-      }
-      ent = ent->next;
-    }
-    if (error != 0)
-      break;
-    if (0 > fprintf (fp, "\n"))
-    {
-      error = 1;
-      break;
-    }
-    sec = sec->next;
-  }
   if (error != 0)
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fprintf", filename);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fprintf", filename);
   GNUNET_assert (0 == fclose (fp));
   if (error != 0)
-  {
-    cfg->dirty = GNUNET_SYSERR; /* last write failed */
-    return GNUNET_SYSERR;
-  }
-  cfg->dirty = GNUNET_NO;       /* last write succeeded */
+    {
+      cfg->dirty = GNUNET_SYSERR;      /* last write failed */
+      return GNUNET_SYSERR;
+    }
+  cfg->dirty = GNUNET_NO;      /* last write succeeded */
   return GNUNET_OK;
 }
 
@@ -367,23 +372,23 @@
  */
 void
 GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                              GNUNET_CONFIGURATION_Iterator iter,
-                              void *iter_cls)
+                             GNUNET_CONFIGURATION_Iterator iter,
+                             void *iter_cls)
 {
   struct ConfigSection *spos;
   struct ConfigEntry *epos;
 
   spos = cfg->sections;
   while (spos != NULL)
-  {
-    epos = spos->entries;
-    while (epos != NULL)
     {
-      iter (iter_cls, spos->name, epos->key, epos->val);
-      epos = epos->next;
+      epos = spos->entries;
+      while (epos != NULL)
+       {
+         iter (iter_cls, spos->name, epos->key, epos->val);
+         epos = epos->next;
+       }
+      spos = spos->next;
     }
-    spos = spos->next;
-  }
 }
 
 
@@ -397,10 +402,10 @@
  */
 void
 GNUNET_CONFIGURATION_iterate_section_values (const struct
-                                             GNUNET_CONFIGURATION_Handle *cfg,
-                                             const char *section,
-                                             GNUNET_CONFIGURATION_Iterator 
iter,
-                                             void *iter_cls)
+                                            GNUNET_CONFIGURATION_Handle *cfg,
+                                            const char *section,
+                                            GNUNET_CONFIGURATION_Iterator
+                                            iter, void *iter_cls)
 {
   struct ConfigSection *spos;
   struct ConfigEntry *epos;
@@ -414,10 +419,10 @@
 
   epos = spos->entries;
   while (epos != NULL)
-  {
-    iter (iter_cls, spos->name, epos->key, epos->val);
-    epos = epos->next;
-  }
+    {
+      iter (iter_cls, spos->name, epos->key, epos->val);
+      epos = epos->next;
+    }
 }
 
 
@@ -429,21 +434,21 @@
  * @param iter_cls closure for iter
  */
 void
-GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle
-                                       *cfg,
-                                       GNUNET_CONFIGURATION_Section_Iterator
-                                       iter, void *iter_cls)
+GNUNET_CONFIGURATION_iterate_sections (const struct
+                                      GNUNET_CONFIGURATION_Handle *cfg,
+                                      GNUNET_CONFIGURATION_Section_Iterator
+                                      iter, void *iter_cls)
 {
   struct ConfigSection *spos;
   struct ConfigSection *next;
 
   next = cfg->sections;
   while (next != NULL)
-  {
-    spos = next;
-    next = spos->next;
-    iter (iter_cls, spos->name);
-  }
+    {
+      spos = next;
+      next = spos->next;
+      iter (iter_cls, spos->name);
+    }
 }
 
 /**
@@ -454,7 +459,7 @@
  */
 void
 GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
-                                     const char *section)
+                                    const char *section)
 {
   struct ConfigSection *spos;
   struct ConfigSection *prev;
@@ -463,28 +468,28 @@
   prev = NULL;
   spos = cfg->sections;
   while (spos != NULL)
-  {
-    if (0 == strcmp (section, spos->name))
     {
-      if (prev == NULL)
-        cfg->sections = spos->next;
-      else
-        prev->next = spos->next;
-      while (NULL != (ent = spos->entries))
-      {
-        spos->entries = ent->next;
-        GNUNET_free (ent->key);
-        GNUNET_free_non_null (ent->val);
-        GNUNET_free (ent);
-        cfg->dirty = GNUNET_YES;
-      }
-      GNUNET_free (spos->name);
-      GNUNET_free (spos);
-      return;
+      if (0 == strcmp (section, spos->name))
+       {
+         if (prev == NULL)
+           cfg->sections = spos->next;
+         else
+           prev->next = spos->next;
+         while (NULL != (ent = spos->entries))
+           {
+             spos->entries = ent->next;
+             GNUNET_free (ent->key);
+             GNUNET_free_non_null (ent->val);
+             GNUNET_free (ent);
+             cfg->dirty = GNUNET_YES;
+           }
+         GNUNET_free (spos->name);
+         GNUNET_free (spos);
+         return;
+       }
+      prev = spos;
+      spos = spos->next;
     }
-    prev = spos;
-    spos = spos->next;
-  }
 }
 
 
@@ -499,7 +504,7 @@
  */
 static void
 copy_entry (void *cls, const char *section, const char *option,
-            const char *value)
+           const char *value)
 {
   struct GNUNET_CONFIGURATION_Handle *dst = cls;
 
@@ -532,7 +537,8 @@
  * @return matching entry, NULL if not found
  */
 static struct ConfigSection *
-findSection (const struct GNUNET_CONFIGURATION_Handle *cfg, const char 
*section)
+findSection (const struct GNUNET_CONFIGURATION_Handle *cfg,
+            const char *section)
 {
   struct ConfigSection *pos;
 
@@ -553,7 +559,7 @@
  */
 static struct ConfigEntry *
 findEntry (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section,
-           const char *key)
+          const char *key)
 {
   struct ConfigSection *sec;
   struct ConfigEntry *pos;
@@ -580,7 +586,7 @@
  */
 static void
 compareEntries (void *cls, const char *section, const char *option,
-                const char *value)
+               const char *value)
 {
   struct DiffHandle *dh = cls;
   struct ConfigEntry *entNew;
@@ -601,9 +607,9 @@
  */
 int
 GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
-                                  *cfgDefault,
-                                  const struct GNUNET_CONFIGURATION_Handle
-                                  *cfgNew, const char *filename)
+                                 *cfgDefault,
+                                 const struct GNUNET_CONFIGURATION_Handle
+                                 *cfgNew, const char *filename)
 {
   int ret;
   struct DiffHandle diffHandle;
@@ -626,28 +632,28 @@
  * @param value value to set
  */
 void
-GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
-                                       const char *section, const char *option,
-                                       const char *value)
+GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle
+                                      *cfg, const char *section,
+                                      const char *option, const char *value)
 {
   struct ConfigSection *sec;
   struct ConfigEntry *e;
 
   e = findEntry (cfg, section, option);
   if (e != NULL)
-  {
-    GNUNET_free_non_null (e->val);
-    e->val = GNUNET_strdup (value);
-    return;
-  }
+    {
+      GNUNET_free_non_null (e->val);
+      e->val = GNUNET_strdup (value);
+      return;
+    }
   sec = findSection (cfg, section);
   if (sec == NULL)
-  {
-    sec = GNUNET_malloc (sizeof (struct ConfigSection));
-    sec->name = GNUNET_strdup (section);
-    sec->next = cfg->sections;
-    cfg->sections = sec;
-  }
+    {
+      sec = GNUNET_malloc (sizeof (struct ConfigSection));
+      sec->name = GNUNET_strdup (section);
+      sec->next = cfg->sections;
+      cfg->sections = sec;
+    }
   e = GNUNET_malloc (sizeof (struct ConfigEntry));
   e->key = GNUNET_strdup (option);
   e->val = GNUNET_strdup (value);
@@ -665,9 +671,10 @@
  * @param number value to set
  */
 void
-GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg,
-                                       const char *section, const char *option,
-                                       unsigned long long number)
+GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
+                                      *cfg, const char *section,
+                                      const char *option,
+                                      unsigned long long number)
 {
   char s[64];
 
@@ -686,10 +693,11 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
-                                       *cfg, const char *section,
-                                       const char *option,
-                                       unsigned long long *number)
+GNUNET_CONFIGURATION_get_value_number (const struct
+                                      GNUNET_CONFIGURATION_Handle *cfg,
+                                      const char *section,
+                                      const char *option,
+                                      unsigned long long *number)
 {
   struct ConfigEntry *e;
 
@@ -713,9 +721,9 @@
  */
 int
 GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
-                                     *cfg, const char *section,
-                                     const char *option,
-                                     struct GNUNET_TIME_Relative *time)
+                                    *cfg, const char *section,
+                                    const char *option,
+                                    struct GNUNET_TIME_Relative *time)
 {
   struct ConfigEntry *e;
   unsigned long long num;
@@ -725,10 +733,10 @@
     return GNUNET_SYSERR;
   if ((0 == strcasecmp (e->val, "infinity")) ||
       (0 == strcasecmp (e->val, "forever")))
-  {
-    *time = GNUNET_TIME_UNIT_FOREVER_REL;
-    return GNUNET_OK;
-  }
+    {
+      *time = GNUNET_TIME_UNIT_FOREVER_REL;
+      return GNUNET_OK;
+    }
   if (1 != SSCANF (e->val, "%llu", &num))
     return GNUNET_SYSERR;
   time->rel_value = (uint64_t) num;
@@ -747,18 +755,19 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
-                                       *cfg, const char *section,
-                                       const char *option, char **value)
+GNUNET_CONFIGURATION_get_value_string (const struct
+                                      GNUNET_CONFIGURATION_Handle *cfg,
+                                      const char *section,
+                                      const char *option, char **value)
 {
   struct ConfigEntry *e;
 
   e = findEntry (cfg, section, option);
   if ((e == NULL) || (e->val == NULL))
-  {
-    *value = NULL;
-    return GNUNET_SYSERR;
-  }
+    {
+      *value = NULL;
+      return GNUNET_SYSERR;
+    }
   *value = GNUNET_strdup (e->val);
   return GNUNET_OK;
 }
@@ -777,10 +786,12 @@
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
-                                       *cfg, const char *section,
-                                       const char *option, const char 
**choices,
-                                       const char **value)
+GNUNET_CONFIGURATION_get_value_choice (const struct
+                                      GNUNET_CONFIGURATION_Handle *cfg,
+                                      const char *section,
+                                      const char *option,
+                                      const char **choices,
+                                      const char **value)
 {
   struct ConfigEntry *e;
   int i;
@@ -790,19 +801,19 @@
     return GNUNET_SYSERR;
   i = 0;
   while (choices[i] != NULL)
-  {
-    if (0 == strcasecmp (choices[i], e->val))
-      break;
-    i++;
-  }
+    {
+      if (0 == strcasecmp (choices[i], e->val))
+       break;
+      i++;
+    }
   if (choices[i] == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("Configuration value '%s' for '%s'"
-                  " in section '%s' is not in set of legal choices\n"), e->val,
-                option, section);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("Configuration value '%s' for '%s'"
+            " in section '%s' is not in set of legal choices\n"), e->val,
+          option, section);
+      return GNUNET_SYSERR;
+    }
   *value = choices[i];
   return GNUNET_OK;
 }
@@ -816,8 +827,9 @@
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */
 int
-GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                 const char *section, const char *option)
+GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle
+                                *cfg, const char *section,
+                                const char *option)
 {
   struct ConfigEntry *e;
 
@@ -838,7 +850,7 @@
  */
 char *
 GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
-                                    *cfg, char *orig)
+                                   *cfg, char *orig)
 {
   int i;
   char *prefix;
@@ -852,24 +864,25 @@
   while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0'))
     i++;
   if (orig[i] == '\0')
-  {
-    post = "";
-  }
+    {
+      post = "";
+    }
   else
-  {
-    orig[i] = '\0';
-    post = &orig[i + 1];
-  }
+    {
+      orig[i] = '\0';
+      post = &orig[i + 1];
+    }
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg, "PATHS", &orig[1], 
&prefix))
-  {
-    if (NULL == (env = getenv (&orig[1])))
+      GNUNET_CONFIGURATION_get_value_filename (cfg, "PATHS", &orig[1],
+                                              &prefix))
     {
-      orig[i] = DIR_SEPARATOR;
-      return orig;
+      if (NULL == (env = getenv (&orig[1])))
+       {
+         orig[i] = DIR_SEPARATOR;
+         return orig;
+       }
+      prefix = GNUNET_strdup (env);
     }
-    prefix = GNUNET_strdup (env);
-  }
   result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2);
   strcpy (result, prefix);
   if ((strlen (prefix) == 0) ||
@@ -894,18 +907,18 @@
  */
 int
 GNUNET_CONFIGURATION_get_value_filename (const struct
-                                         GNUNET_CONFIGURATION_Handle *cfg,
-                                         const char *section,
-                                         const char *option, char **value)
+                                        GNUNET_CONFIGURATION_Handle *cfg,
+                                        const char *section,
+                                        const char *option, char **value)
 {
   char *tmp;
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &tmp))
-  {
-    *value = NULL;
-    return GNUNET_SYSERR;
-  }
+    {
+      *value = NULL;
+      return GNUNET_SYSERR;
+    }
   tmp = GNUNET_CONFIGURATION_expand_dollar (cfg, tmp);
   *value = GNUNET_STRINGS_filename_expand (tmp);
   GNUNET_free (tmp);
@@ -926,15 +939,15 @@
  */
 int
 GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
-                                      *cfg, const char *section,
-                                      const char *option)
+                                     *cfg, const char *section,
+                                     const char *option)
 {
   static const char *yesno[] = { "YES", "NO", NULL };
   const char *val;
   int ret;
 
   ret =
-      GNUNET_CONFIGURATION_get_value_choice (cfg, section, option, yesno, 
&val);
+    GNUNET_CONFIGURATION_get_value_choice (cfg, section, option, yesno, &val);
   if (ret == GNUNET_SYSERR)
     return ret;
   if (val == yesno[0])
@@ -955,11 +968,11 @@
  */
 int
 GNUNET_CONFIGURATION_iterate_value_filenames (const struct
-                                              GNUNET_CONFIGURATION_Handle *cfg,
-                                              const char *section,
-                                              const char *option,
-                                              GNUNET_FileNameCallback cb,
-                                              void *cb_cls)
+                                             GNUNET_CONFIGURATION_Handle
+                                             *cfg, const char *section,
+                                             const char *option,
+                                             GNUNET_FileNameCallback cb,
+                                             void *cb_cls)
 {
   char *list;
   char *pos;
@@ -974,46 +987,46 @@
   ret = 0;
   pos = list;
   while (1)
-  {
-    while (pos[0] == ' ')
-      pos++;
-    if (strlen (pos) == 0)
-      break;
-    end = pos + 1;
-    while ((end[0] != ' ') && (end[0] != '\0'))
     {
-      if (end[0] == '\\')
-      {
-        switch (end[1])
-        {
-        case '\\':
-        case ' ':
-          memmove (end, &end[1], strlen (&end[1]) + 1);
-        case '\0':
-          /* illegal, but just keep it */
-          break;
-        default:
-          /* illegal, but just ignore that there was a '/' */
-          break;
-        }
-      }
-      end++;
+      while (pos[0] == ' ')
+       pos++;
+      if (strlen (pos) == 0)
+       break;
+      end = pos + 1;
+      while ((end[0] != ' ') && (end[0] != '\0'))
+       {
+         if (end[0] == '\\')
+           {
+             switch (end[1])
+               {
+               case '\\':
+               case ' ':
+                 memmove (end, &end[1], strlen (&end[1]) + 1);
+               case '\0':
+                 /* illegal, but just keep it */
+                 break;
+               default:
+                 /* illegal, but just ignore that there was a '/' */
+                 break;
+               }
+           }
+         end++;
+       }
+      old = end[0];
+      end[0] = '\0';
+      if (strlen (pos) > 0)
+       {
+         ret++;
+         if ((cb != NULL) && (GNUNET_OK != cb (cb_cls, pos)))
+           {
+             ret = GNUNET_SYSERR;
+             break;
+           }
+       }
+      if (old == '\0')
+       break;
+      pos = end + 1;
     }
-    old = end[0];
-    end[0] = '\0';
-    if (strlen (pos) > 0)
-    {
-      ret++;
-      if ((cb != NULL) && (GNUNET_OK != cb (cb_cls, pos)))
-      {
-        ret = GNUNET_SYSERR;
-        break;
-      }
-    }
-    if (old == '\0')
-      break;
-    pos = end + 1;
-  }
   GNUNET_free (list);
   return ret;
 }
@@ -1037,21 +1050,21 @@
   rpos = value;
   wpos = escaped;
   while (rpos[0] != '\0')
-  {
-    switch (rpos[0])
     {
-    case '\\':
-    case ' ':
-      wpos[0] = '\\';
-      wpos[1] = rpos[0];
-      wpos += 2;
-      break;
-    default:
-      wpos[0] = rpos[0];
-      wpos++;
+      switch (rpos[0])
+       {
+       case '\\':
+       case ' ':
+         wpos[0] = '\\';
+         wpos[1] = rpos[0];
+         wpos += 2;
+         break;
+       default:
+         wpos[0] = rpos[0];
+         wpos++;
+       }
+      rpos++;
     }
-    rpos++;
-  }
   return escaped;
 }
 
@@ -1086,9 +1099,9 @@
  */
 int
 GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
-                                            *cfg, const char *section,
-                                            const char *option,
-                                            const char *value)
+                                           *cfg, const char *section,
+                                           const char *option,
+                                           const char *value)
 {
   char *escaped;
   char *old;
@@ -1096,9 +1109,9 @@
 
   if (GNUNET_SYSERR ==
       GNUNET_CONFIGURATION_iterate_value_filenames (cfg, section, option,
-                                                    &test_match,
-                                                    (void *) value))
-    return GNUNET_NO;           /* already exists */
+                                                   &test_match,
+                                                   (void *) value))
+    return GNUNET_NO;          /* already exists */
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &old))
     old = GNUNET_strdup ("");
@@ -1130,9 +1143,9 @@
  */
 int
 GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
-                                            *cfg, const char *section,
-                                            const char *option,
-                                            const char *value)
+                                           *cfg, const char *section,
+                                           const char *option,
+                                           const char *value)
 {
   char *list;
   char *pos;
@@ -1146,55 +1159,55 @@
   match = escape_name (value);
   pos = list;
   while (1)
-  {
-    while (pos[0] == ' ')
-      pos++;
-    if (strlen (pos) == 0)
-      break;
-    end = pos + 1;
-    while ((end[0] != ' ') && (end[0] != '\0'))
     {
-      if (end[0] == '\\')
-      {
-        switch (end[1])
-        {
-        case '\\':
-        case ' ':
-          end++;
-          break;
-        case '\0':
-          /* illegal, but just keep it */
-          break;
-        default:
-          /* illegal, but just ignore that there was a '/' */
-          break;
-        }
-      }
-      end++;
+      while (pos[0] == ' ')
+       pos++;
+      if (strlen (pos) == 0)
+       break;
+      end = pos + 1;
+      while ((end[0] != ' ') && (end[0] != '\0'))
+       {
+         if (end[0] == '\\')
+           {
+             switch (end[1])
+               {
+               case '\\':
+               case ' ':
+                 end++;
+                 break;
+               case '\0':
+                 /* illegal, but just keep it */
+                 break;
+               default:
+                 /* illegal, but just ignore that there was a '/' */
+                 break;
+               }
+           }
+         end++;
+       }
+      old = end[0];
+      end[0] = '\0';
+      if (0 == strcmp (pos, match))
+       {
+         if (old != '\0')
+           memmove (pos, &end[1], strlen (&end[1]) + 1);
+         else
+           {
+             if (pos != list)
+               pos[-1] = '\0';
+             else
+               pos[0] = '\0';
+           }
+         GNUNET_CONFIGURATION_set_value_string (cfg, section, option, list);
+         GNUNET_free (list);
+         GNUNET_free (match);
+         return GNUNET_OK;
+       }
+      if (old == '\0')
+       break;
+      end[0] = old;
+      pos = end + 1;
     }
-    old = end[0];
-    end[0] = '\0';
-    if (0 == strcmp (pos, match))
-    {
-      if (old != '\0')
-        memmove (pos, &end[1], strlen (&end[1]) + 1);
-      else
-      {
-        if (pos != list)
-          pos[-1] = '\0';
-        else
-          pos[0] = '\0';
-      }
-      GNUNET_CONFIGURATION_set_value_string (cfg, section, option, list);
-      GNUNET_free (list);
-      GNUNET_free (match);
-      return GNUNET_OK;
-    }
-    if (old == '\0')
-      break;
-    end[0] = old;
-    pos = end + 1;
-  }
   GNUNET_free (list);
   GNUNET_free (match);
   return GNUNET_NO;
@@ -1211,7 +1224,7 @@
  */
 int
 GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
-                           const char *filename)
+                          const char *filename)
 {
   char *baseconfig;
   char *ipath;
@@ -1221,21 +1234,21 @@
     return GNUNET_SYSERR;
   baseconfig = NULL;
   GNUNET_asprintf (&baseconfig, "%s%s%s", ipath, DIR_SEPARATOR_STR,
-                   "defaults.conf");
+                  "defaults.conf");
   GNUNET_free (ipath);
   if ((GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, baseconfig)) ||
       (!((filename == NULL) ||
-         (GNUNET_OK == GNUNET_CONFIGURATION_parse (cfg, filename)))))
-  {
-    GNUNET_free (baseconfig);
-    return (filename == NULL) ? GNUNET_OK : GNUNET_SYSERR;
-  }
+        (GNUNET_OK == GNUNET_CONFIGURATION_parse (cfg, filename)))))
+    {
+      GNUNET_free (baseconfig);
+      return (filename == NULL) ? GNUNET_OK : GNUNET_SYSERR;
+    }
   GNUNET_free (baseconfig);
   if (((GNUNET_YES !=
-        GNUNET_CONFIGURATION_have_value (cfg, "PATHS", "DEFAULTCONFIG"))) &&
+       GNUNET_CONFIGURATION_have_value (cfg, "PATHS", "DEFAULTCONFIG"))) &&
       (filename != NULL))
     GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG",
-                                           filename);
+                                          filename);
   if ((GNUNET_YES ==
        GNUNET_CONFIGURATION_have_value (cfg, "TESTING", "WEAKRANDOM")) &&
       (GNUNET_YES ==

Modified: gnunet/src/util/connection.c
===================================================================
--- gnunet/src/util/connection.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/connection.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -41,6 +41,10 @@
 
 #define DEBUG_CONNECTION GNUNET_EXTRA_LOGGING
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 /**
  * Possible functions to call after connect failed or succeeded.
  */
@@ -329,7 +333,8 @@
  * @return the boxed socket handle
  */
 struct GNUNET_CONNECTION_Handle *
-GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket)
+GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle
+                                       *osSocket)
 {
   struct GNUNET_CONNECTION_Handle *ret;
 
@@ -352,8 +357,8 @@
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
-                                      void *access_cls,
-                                      struct GNUNET_NETWORK_Handle *lsock)
+                                     void *access_cls,
+                                     struct GNUNET_NETWORK_Handle *lsock)
 {
   struct GNUNET_CONNECTION_Handle *ret;
   char addr[128];
@@ -374,94 +379,94 @@
 
   addrlen = sizeof (addr);
   sock =
-      GNUNET_NETWORK_socket_accept (lsock, (struct sockaddr *) &addr, 
&addrlen);
+    GNUNET_NETWORK_socket_accept (lsock, (struct sockaddr *) &addr, &addrlen);
   if (NULL == sock)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "accept");
-    return NULL;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "accept");
+      return NULL;
+    }
   if ((addrlen > sizeof (addr)) || (addrlen < sizeof (sa_family_t)))
-  {
-    GNUNET_break (0);
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
+      return NULL;
+    }
 
   sa = (struct sockaddr *) addr;
   v6 = (struct sockaddr_in6 *) addr;
   if ((sa->sa_family == AF_INET6) && (IN6_IS_ADDR_V4MAPPED (&v6->sin6_addr)))
-  {
-    /* convert to V4 address */
-    v4 = GNUNET_malloc (sizeof (struct sockaddr_in));
-    memset (v4, 0, sizeof (struct sockaddr_in));
-    v4->sin_family = AF_INET;
+    {
+      /* convert to V4 address */
+      v4 = GNUNET_malloc (sizeof (struct sockaddr_in));
+      memset (v4, 0, sizeof (struct sockaddr_in));
+      v4->sin_family = AF_INET;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-    v4->sin_len = (u_char) sizeof (struct sockaddr_in);
+      v4->sin_len = (u_char) sizeof (struct sockaddr_in);
 #endif
-    memcpy (&v4->sin_addr,
-            &((char *) &v6->sin6_addr)[sizeof (struct in6_addr) -
-                                       sizeof (struct in_addr)],
-            sizeof (struct in_addr));
-    v4->sin_port = v6->sin6_port;
-    uaddr = v4;
-    addrlen = sizeof (struct sockaddr_in);
-  }
+      memcpy (&v4->sin_addr,
+             &((char *) &v6->sin6_addr)[sizeof (struct in6_addr) -
+                                        sizeof (struct in_addr)],
+             sizeof (struct in_addr));
+      v4->sin_port = v6->sin6_port;
+      uaddr = v4;
+      addrlen = sizeof (struct sockaddr_in);
+    }
   else
-  {
-    uaddr = GNUNET_malloc (addrlen);
-    memcpy (uaddr, addr, addrlen);
-  }
+    {
+      uaddr = GNUNET_malloc (addrlen);
+      memcpy (uaddr, addr, addrlen);
+    }
   gcp = NULL;
   gc.uid = 0;
   gc.gid = 0;
   if (sa->sa_family == AF_UNIX)
-  {
+    {
 #if HAVE_GETPEEREID
-    /* most BSDs */
-    if (0 == getpeereid (GNUNET_NETWORK_get_fd (sock), &gc.uid, &gc.gid))
-      gcp = &gc;
+      /* most BSDs */
+      if (0 == getpeereid (GNUNET_NETWORK_get_fd (sock), &gc.uid, &gc.gid))
+       gcp = &gc;
 #else
 #ifdef SO_PEERCRED
-    /* largely traditional GNU/Linux */
-    olen = sizeof (uc);
-    if ((0 ==
-         getsockopt (GNUNET_NETWORK_get_fd (sock), SOL_SOCKET, SO_PEERCRED, 
&uc,
-                     &olen)) && (olen == sizeof (uc)))
-    {
-      gc.uid = uc.uid;
-      gc.gid = uc.gid;
-      gcp = &gc;
-    }
+      /* largely traditional GNU/Linux */
+      olen = sizeof (uc);
+      if ((0 ==
+          getsockopt (GNUNET_NETWORK_get_fd (sock), SOL_SOCKET, SO_PEERCRED,
+                      &uc, &olen)) && (olen == sizeof (uc)))
+       {
+         gc.uid = uc.uid;
+         gc.gid = uc.gid;
+         gcp = &gc;
+       }
 #else
 #if HAVE_GETPEERUCRED
-    /* this is for Solaris 10 */
-    ucred_t *uc;
+      /* this is for Solaris 10 */
+      ucred_t *uc;
 
-    uc = NULL;
-    if (0 == getpeerucred (GNUNET_NETWORK_get_fd (sock), &uc))
-    {
-      gc.uid = ucred_geteuid (uc);
-      gc.gid = ucred_getegid (uc);
-      gcp = &gc;
-    }
-    ucred_free (uc);
+      uc = NULL;
+      if (0 == getpeerucred (GNUNET_NETWORK_get_fd (sock), &uc))
+       {
+         gc.uid = ucred_geteuid (uc);
+         gc.gid = ucred_getegid (uc);
+         gcp = &gc;
+       }
+      ucred_free (uc);
 #endif
 #endif
 #endif
-  }
+    }
 
   if ((access != NULL) &&
       (GNUNET_YES != (aret = access (access_cls, gcp, uaddr, addrlen))))
-  {
-    if (aret == GNUNET_NO)
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Access denied to `%s'\n"),
-                  GNUNET_a2s (uaddr, addrlen));
-    GNUNET_break (GNUNET_OK ==
-                  GNUNET_NETWORK_socket_shutdown (sock, SHUT_RDWR));
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
-    GNUNET_free (uaddr);
-    return NULL;
-  }
+    {
+      if (aret == GNUNET_NO)
+       LOG (GNUNET_ERROR_TYPE_INFO, _("Access denied to `%s'\n"),
+            GNUNET_a2s (uaddr, addrlen));
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_NETWORK_socket_shutdown (sock, SHUT_RDWR));
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
+      GNUNET_free (uaddr);
+      return NULL;
+    }
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
   ret->write_buffer = GNUNET_malloc (ret->write_buffer_size);
@@ -469,8 +474,8 @@
   ret->addrlen = addrlen;
   ret->sock = sock;
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Accepting connection from `%s': 
%p\n"),
-              GNUNET_a2s (uaddr, addrlen), ret);
+  LOG (GNUNET_ERROR_TYPE_INFO, _("Accepting connection from `%s': %p\n"),
+       GNUNET_a2s (uaddr, addrlen), ret);
 #endif
   return ret;
 }
@@ -485,7 +490,7 @@
  */
 int
 GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock,
-                               void **addr, size_t * addrlen)
+                              void **addr, size_t * addrlen)
 {
   if ((sock->addr == NULL) || (sock->addrlen == 0))
     return GNUNET_NO;
@@ -518,7 +523,8 @@
  * @param tc unused
  */
 static void
-destroy_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+destroy_continuation (void *cls,
+                     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_CONNECTION_Handle *sock = cls;
   GNUNET_CONNECTION_TransmitReadyNotify notify;
@@ -527,83 +533,83 @@
   sock->destroy_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_assert (sock->dns_active == NULL);
   if (0 != (sock->ccs & COCO_TRANSMIT_READY))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Destroy waits for CCS-TR to be done (%p)\n", sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Destroy waits for CCS-TR to be done (%p)\n", sock);
 #endif
-    sock->ccs |= COCO_DESTROY_CONTINUATION;
-    return;
-  }
+      sock->ccs |= COCO_DESTROY_CONTINUATION;
+      return;
+    }
   if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Destroy waits for write_task to be done (%p)\n", sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Destroy waits for write_task to be done (%p)\n", sock);
 #endif
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
-    sock->destroy_task =
-        GNUNET_SCHEDULER_add_after (sock->write_task, &destroy_continuation,
-                                    sock);
-    return;
-  }
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
+      sock->destroy_task =
+       GNUNET_SCHEDULER_add_after (sock->write_task, &destroy_continuation,
+                                   sock);
+      return;
+    }
   if (0 != (sock->ccs & COCO_RECEIVE_AGAIN))
-  {
-    sock->ccs |= COCO_DESTROY_CONTINUATION;
-    return;
-  }
+    {
+      sock->ccs |= COCO_DESTROY_CONTINUATION;
+      return;
+    }
   if (sock->sock != NULL)
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down socket (%p)\n", sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down socket (%p)\n", sock);
 #endif
-    if (sock->persist != GNUNET_YES)
+      if (sock->persist != GNUNET_YES)
+       {
+         if ((GNUNET_YES !=
+              GNUNET_NETWORK_socket_shutdown (sock->sock, SHUT_RDWR))
+             && (errno != ENOTCONN) && (errno != ECONNRESET))
+           LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "shutdown");
+       }
+    }
+  if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
     {
-      if ((GNUNET_YES != GNUNET_NETWORK_socket_shutdown (sock->sock, 
SHUT_RDWR))
-          && (errno != ENOTCONN) && (errno != ECONNRESET))
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "shutdown");
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
+      sock->destroy_task =
+       GNUNET_SCHEDULER_add_after (sock->read_task, &destroy_continuation,
+                                   sock);
+      return;
     }
-  }
-  if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
-    sock->destroy_task =
-        GNUNET_SCHEDULER_add_after (sock->read_task, &destroy_continuation,
-                                    sock);
-    return;
-  }
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroy actually runs (%p)!\n", sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Destroy actually runs (%p)!\n", sock);
 #endif
   while (NULL != (pos = sock->ap_head))
-  {
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
-    GNUNET_SCHEDULER_cancel (pos->task);
-    GNUNET_CONTAINER_DLL_remove (sock->ap_head, sock->ap_tail, pos);
-    GNUNET_free (pos);
-  }
+    {
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
+      GNUNET_SCHEDULER_cancel (pos->task);
+      GNUNET_CONTAINER_DLL_remove (sock->ap_head, sock->ap_tail, pos);
+      GNUNET_free (pos);
+    }
   GNUNET_assert (sock->nth.timeout_task == GNUNET_SCHEDULER_NO_TASK);
   GNUNET_assert (sock->ccs == COCO_NONE);
   if (NULL != (notify = sock->nth.notify_ready))
-  {
-    sock->nth.notify_ready = NULL;
-    notify (sock->nth.notify_ready_cls, 0, NULL);
-  }
+    {
+      sock->nth.notify_ready = NULL;
+      notify (sock->nth.notify_ready_cls, 0, NULL);
+    }
 
   if (sock->sock != NULL)
-  {
-    if (sock->persist != GNUNET_YES)
-      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock));
-    else
-      GNUNET_free (sock->sock); /* at least no memory leak (we deliberately
-                                 * leak the socket in this special case) ... */
-  }
+    {
+      if (sock->persist != GNUNET_YES)
+       GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock));
+      else
+       GNUNET_free (sock->sock);       /* at least no memory leak (we 
deliberately
+                                        * leak the socket in this special 
case) ... */
+    }
   GNUNET_free_non_null (sock->addr);
   GNUNET_free_non_null (sock->hostname);
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Freeing memory of connection %p.\n",
-              sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Freeing memory of connection %p.\n", sock);
 #endif
   GNUNET_free (sock->write_buffer);
   GNUNET_free (sock);
@@ -632,13 +638,13 @@
 connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
 {
 #if DEBUG_CONNECTION
-  GNUNET_log ((0 !=
-               strncmp (h->hostname, "localhost:",
-                        10)) ? GNUNET_ERROR_TYPE_INFO :
-              GNUNET_ERROR_TYPE_WARNING,
-              _
-              ("Failed to establish TCP connection to `%s:%u', no further 
addresses to try.\n"),
-              h->hostname, h->port);
+  LOG ((0 !=
+       strncmp (h->hostname, "localhost:",
+                10)) ? GNUNET_ERROR_TYPE_INFO :
+       GNUNET_ERROR_TYPE_WARNING,
+       _
+       ("Failed to establish TCP connection to `%s:%u', no further addresses 
to try.\n"),
+       h->hostname, h->port);
 #endif
   /* connect failed / timed out */
   GNUNET_break (h->ap_head == NULL);
@@ -648,40 +654,39 @@
 
   /* trigger jobs that used to wait on "connect_task" */
   if (0 != (h->ccs & COCO_RECEIVE_AGAIN))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_fail_continuation triggers receive_again (%p)\n", h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_fail_continuation triggers receive_again (%p)\n", h);
 #endif
-    h->ccs -= COCO_RECEIVE_AGAIN;
-    h->read_task = GNUNET_SCHEDULER_add_now (&receive_again, h);
-  }
+      h->ccs -= COCO_RECEIVE_AGAIN;
+      h->read_task = GNUNET_SCHEDULER_add_now (&receive_again, h);
+    }
   if (0 != (h->ccs & COCO_TRANSMIT_READY))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_fail_continuation cancels timeout_task, triggers 
transmit_ready (%p)\n",
-                h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_fail_continuation cancels timeout_task, triggers 
transmit_ready (%p)\n",
+          h);
 #endif
-    GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK);
-    GNUNET_SCHEDULER_cancel (h->nth.timeout_task);
-    h->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK;
-    h->ccs -= COCO_TRANSMIT_READY;
-    GNUNET_assert (h->nth.notify_ready != NULL);
-    GNUNET_assert (h->write_task == GNUNET_SCHEDULER_NO_TASK);
-    h->write_task = GNUNET_SCHEDULER_add_now (&transmit_ready, h);
-  }
+      GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK);
+      GNUNET_SCHEDULER_cancel (h->nth.timeout_task);
+      h->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK;
+      h->ccs -= COCO_TRANSMIT_READY;
+      GNUNET_assert (h->nth.notify_ready != NULL);
+      GNUNET_assert (h->write_task == GNUNET_SCHEDULER_NO_TASK);
+      h->write_task = GNUNET_SCHEDULER_add_now (&transmit_ready, h);
+    }
   if (0 != (h->ccs & COCO_DESTROY_CONTINUATION))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_fail_continuation runs destroy_continuation (%p)\n",
-                h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_fail_continuation runs destroy_continuation (%p)\n", h);
 #endif
-    h->ccs -= COCO_DESTROY_CONTINUATION;
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->destroy_task);
-    h->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, h);
-  }
+      h->ccs -= COCO_DESTROY_CONTINUATION;
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->destroy_task);
+      h->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, h);
+    }
 }
 
 
@@ -694,48 +699,48 @@
 connect_success_continuation (struct GNUNET_CONNECTION_Handle *h)
 {
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connection to `%s' succeeded! (%p)\n",
-              GNUNET_a2s (h->addr, h->addrlen), h);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Connection to `%s' succeeded! (%p)\n",
+       GNUNET_a2s (h->addr, h->addrlen), h);
 #endif
   /* trigger jobs that waited for the connection */
   if (0 != (h->ccs & COCO_RECEIVE_AGAIN))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_success_continuation runs receive_again (%p)\n", h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_success_continuation runs receive_again (%p)\n", h);
 #endif
-    h->ccs -= COCO_RECEIVE_AGAIN;
-    h->read_task = GNUNET_SCHEDULER_add_now (&receive_again, h);
-  }
+      h->ccs -= COCO_RECEIVE_AGAIN;
+      h->read_task = GNUNET_SCHEDULER_add_now (&receive_again, h);
+    }
   if (0 != (h->ccs & COCO_TRANSMIT_READY))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_success_continuation runs transmit_ready, cancels 
timeout_task (%p)\n",
-                h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_success_continuation runs transmit_ready, cancels 
timeout_task (%p)\n",
+          h);
 #endif
-    GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK);
-    GNUNET_SCHEDULER_cancel (h->nth.timeout_task);
-    h->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK;
-    h->ccs -= COCO_TRANSMIT_READY;
-    GNUNET_assert (h->write_task == GNUNET_SCHEDULER_NO_TASK);
-    GNUNET_assert (h->nth.notify_ready != NULL);
-    h->write_task =
-        GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining
-                                        (h->nth.transmit_timeout), h->sock,
-                                        &transmit_ready, h);
-  }
+      GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK);
+      GNUNET_SCHEDULER_cancel (h->nth.timeout_task);
+      h->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK;
+      h->ccs -= COCO_TRANSMIT_READY;
+      GNUNET_assert (h->write_task == GNUNET_SCHEDULER_NO_TASK);
+      GNUNET_assert (h->nth.notify_ready != NULL);
+      h->write_task =
+       GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining
+                                       (h->nth.transmit_timeout), h->sock,
+                                       &transmit_ready, h);
+    }
   if (0 != (h->ccs & COCO_DESTROY_CONTINUATION))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "connect_success_continuation runs destroy_continuation 
(%p)\n",
-                h);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "connect_success_continuation runs destroy_continuation (%p)\n",
+          h);
 #endif
-    h->ccs -= COCO_DESTROY_CONTINUATION;
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->destroy_task);
-    h->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, h);
-  }
+      h->ccs -= COCO_DESTROY_CONTINUATION;
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->destroy_task);
+      h->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, h);
+    }
 }
 
 
@@ -748,7 +753,7 @@
  */
 static void
 connect_probe_continuation (void *cls,
-                            const struct GNUNET_SCHEDULER_TaskContext *tc)
+                           const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct AddressProbe *ap = cls;
   struct GNUNET_CONNECTION_Handle *h = ap->h;
@@ -763,15 +768,15 @@
   error = 0;
   if ((0 == (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY)) ||
       (GNUNET_OK !=
-       GNUNET_NETWORK_socket_getsockopt (ap->sock, SOL_SOCKET, SO_ERROR, 
&error,
-                                         &len)) || (error != 0))
-  {
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock));
-    GNUNET_free (ap);
-    if ((NULL == h->ap_head) && (h->dns_active == GNUNET_NO))
-      connect_fail_continuation (h);
-    return;
-  }
+       GNUNET_NETWORK_socket_getsockopt (ap->sock, SOL_SOCKET, SO_ERROR,
+                                        &error, &len)) || (error != 0))
+    {
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock));
+      GNUNET_free (ap);
+      if ((NULL == h->ap_head) && (h->dns_active == GNUNET_NO))
+       connect_fail_continuation (h);
+      return;
+    }
   GNUNET_assert (h->sock == NULL);
   h->sock = ap->sock;
   GNUNET_assert (h->addr == NULL);
@@ -781,12 +786,12 @@
   GNUNET_free (ap);
   /* cancel all other attempts */
   while (NULL != (pos = h->ap_head))
-  {
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
-    GNUNET_SCHEDULER_cancel (pos->task);
-    GNUNET_CONTAINER_DLL_remove (h->ap_head, h->ap_tail, pos);
-    GNUNET_free (pos);
-  }
+    {
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
+      GNUNET_SCHEDULER_cancel (pos->task);
+      GNUNET_CONTAINER_DLL_remove (h->ap_head, h->ap_tail, pos);
+      GNUNET_free (pos);
+    }
   connect_success_continuation (h);
 }
 
@@ -801,28 +806,27 @@
  */
 static void
 try_connect_using_address (void *cls, const struct sockaddr *addr,
-                           socklen_t addrlen)
+                          socklen_t addrlen)
 {
   struct GNUNET_CONNECTION_Handle *h = cls;
   struct AddressProbe *ap;
   struct GNUNET_TIME_Relative delay;
 
   if (addr == NULL)
-  {
-    h->dns_active = NULL;
-    if ( (NULL == h->ap_head) &&
-        (NULL == h->sock) )
-      connect_fail_continuation (h);
-    return;
-  }
+    {
+      h->dns_active = NULL;
+      if ((NULL == h->ap_head) && (NULL == h->sock))
+       connect_fail_continuation (h);
+      return;
+    }
   if (h->sock != NULL)
-    return;                     /* already connected */
+    return;                    /* already connected */
   GNUNET_assert (h->addr == NULL);
   /* try to connect */
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Trying to connect using address `%s:%u/%s:%u'\n", h->hostname,
-              h->port, GNUNET_a2s (addr, addrlen), h->port);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Trying to connect using address `%s:%u/%s:%u'\n", h->hostname,
+       h->port, GNUNET_a2s (addr, addrlen), h->port);
 #endif
   ap = GNUNET_malloc (sizeof (struct AddressProbe) + addrlen);
   ap->addr = (const struct sockaddr *) &ap[1];
@@ -831,58 +835,59 @@
   ap->h = h;
 
   switch (ap->addr->sa_family)
-  {
-  case AF_INET:
-    ((struct sockaddr_in *) ap->addr)->sin_port = htons (h->port);
-    break;
-  case AF_INET6:
-    ((struct sockaddr_in6 *) ap->addr)->sin6_port = htons (h->port);
-    break;
-  default:
-    GNUNET_break (0);
-    GNUNET_free (ap);
-    return;                     /* not supported by us */
-  }
-  ap->sock = GNUNET_NETWORK_socket_create (ap->addr->sa_family, SOCK_STREAM, 
0);
+    {
+    case AF_INET:
+      ((struct sockaddr_in *) ap->addr)->sin_port = htons (h->port);
+      break;
+    case AF_INET6:
+      ((struct sockaddr_in6 *) ap->addr)->sin6_port = htons (h->port);
+      break;
+    default:
+      GNUNET_break (0);
+      GNUNET_free (ap);
+      return;                  /* not supported by us */
+    }
+  ap->sock =
+    GNUNET_NETWORK_socket_create (ap->addr->sa_family, SOCK_STREAM, 0);
   if (ap->sock == NULL)
-  {
-    GNUNET_free (ap);
-    return;                     /* not supported by OS */
-  }
+    {
+      GNUNET_free (ap);
+      return;                  /* not supported by OS */
+    }
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Trying to connect to `%s' (%p)\n"),
-              GNUNET_a2s (ap->addr, ap->addrlen), h);
+  LOG (GNUNET_ERROR_TYPE_INFO, _("Trying to connect to `%s' (%p)\n"),
+       GNUNET_a2s (ap->addr, ap->addrlen), h);
 #endif
   if ((GNUNET_OK !=
        GNUNET_NETWORK_socket_connect (ap->sock, ap->addr, ap->addrlen)) &&
       (errno != EINPROGRESS))
-  {
-    /* maybe refused / unsupported address, try next */
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "connect");
+    {
+      /* maybe refused / unsupported address, try next */
+      LOG_STRERROR (GNUNET_ERROR_TYPE_INFO, "connect");
 #if 0
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO, 
-               _("Failed to connect to `%s' (%p)\n"),
-               GNUNET_a2s (ap->addr, ap->addrlen), h);
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Failed to connect to `%s' (%p)\n"),
+          GNUNET_a2s (ap->addr, ap->addrlen), h);
 #endif
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock));
-    GNUNET_free (ap);
-    return;
-  }
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock));
+      GNUNET_free (ap);
+      return;
+    }
   GNUNET_CONTAINER_DLL_insert (h->ap_head, h->ap_tail, ap);
   delay = GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT;
   if (h->nth.notify_ready != NULL)
     delay =
-        GNUNET_TIME_relative_min (delay,
-                                  GNUNET_TIME_absolute_get_remaining (h->
-                                                                      
nth.transmit_timeout));
+      GNUNET_TIME_relative_min (delay,
+                               GNUNET_TIME_absolute_get_remaining (h->
+                                                                   
nth.transmit_timeout));
   if (h->receiver != NULL)
     delay =
-        GNUNET_TIME_relative_min (delay,
-                                  GNUNET_TIME_absolute_get_remaining
-                                  (h->receive_timeout));
+      GNUNET_TIME_relative_min (delay,
+                               GNUNET_TIME_absolute_get_remaining
+                               (h->receive_timeout));
   ap->task =
-      GNUNET_SCHEDULER_add_write_net (delay, ap->sock,
-                                      &connect_probe_continuation, ap);
+    GNUNET_SCHEDULER_add_write_net (delay, ap->sock,
+                                   &connect_probe_continuation, ap);
 }
 
 
@@ -897,13 +902,13 @@
  * @return the socket handle
  */
 struct GNUNET_CONNECTION_Handle *
-GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle
-                                       *cfg, const char *hostname,
-                                       uint16_t port)
+GNUNET_CONNECTION_create_from_connect (const struct
+                                      GNUNET_CONFIGURATION_Handle *cfg,
+                                      const char *hostname, uint16_t port)
 {
   struct GNUNET_CONNECTION_Handle *ret;
- 
-  GNUNET_assert (0 < strlen (hostname));        /* sanity check */
+
+  GNUNET_assert (0 < strlen (hostname));       /* sanity check */
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
   ret->cfg = cfg;
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
@@ -911,9 +916,9 @@
   ret->port = port;
   ret->hostname = GNUNET_strdup (hostname);
   ret->dns_active =
-      GNUNET_RESOLVER_ip_get (ret->hostname, AF_UNSPEC,
-                              GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT,
-                              &try_connect_using_address, ret);
+    GNUNET_RESOLVER_ip_get (ret->hostname, AF_UNSPEC,
+                           GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT,
+                           &try_connect_using_address, ret);
   return ret;
 }
 
@@ -929,15 +934,15 @@
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
-                                                   GNUNET_CONFIGURATION_Handle
-                                                   *cfg, const char *unixpath)
+                                                  GNUNET_CONFIGURATION_Handle
+                                                  *cfg, const char *unixpath)
 {
 #ifdef AF_UNIX
   struct GNUNET_CONNECTION_Handle *ret;
   struct sockaddr_un *un;
   size_t slen;
 
-  GNUNET_assert (0 < strlen (unixpath));        /* sanity check */
+  GNUNET_assert (0 < strlen (unixpath));       /* sanity check */
   un = GNUNET_malloc (sizeof (struct sockaddr_un));
   un->sun_family = AF_UNIX;
   slen = strlen (unixpath);
@@ -962,20 +967,20 @@
   ret->addrlen = slen;
   ret->sock = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0);
   if (NULL == ret->sock)
-  {
-    GNUNET_free (ret->addr);
-    GNUNET_free (ret->write_buffer);
-    GNUNET_free (ret);
-    return NULL;
-  }
+    {
+      GNUNET_free (ret->addr);
+      GNUNET_free (ret->write_buffer);
+      GNUNET_free (ret);
+      return NULL;
+    }
   if (GNUNET_OK !=
       GNUNET_NETWORK_socket_connect (ret->sock, ret->addr, ret->addrlen))
-  {
-    /* Just return; we expect everything to work eventually so don't fail HARD 
*/
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret->sock));
-    ret->sock = NULL;
-    return ret;
-  }
+    {
+      /* Just return; we expect everything to work eventually so don't fail 
HARD */
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret->sock));
+      ret->sock = NULL;
+      return ret;
+    }
   connect_success_continuation (ret);
   return ret;
 #else
@@ -996,8 +1001,8 @@
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_sockaddr (int af_family,
-                                        const struct sockaddr *serv_addr,
-                                        socklen_t addrlen)
+                                       const struct sockaddr *serv_addr,
+                                       socklen_t addrlen)
 {
   struct GNUNET_NETWORK_Handle *s;
   struct GNUNET_CONNECTION_Handle *ret;
@@ -1005,29 +1010,29 @@
 
   s = GNUNET_NETWORK_socket_create (af_family, SOCK_STREAM, 0);
   if (s == NULL)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
-                         "socket");
-    return NULL;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
+                   "socket");
+      return NULL;
+    }
   if ((GNUNET_OK != GNUNET_NETWORK_socket_connect (s, serv_addr, addrlen)) &&
       (errno != EINPROGRESS))
-  {
-    /* maybe refused / unsupported address, try next */
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "connect");
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Attempt to connect to `%s' failed\n"), GNUNET_a2s 
(serv_addr,
-                                                                      
addrlen));
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s));
-    return NULL;
-  }
+    {
+      /* maybe refused / unsupported address, try next */
+      LOG_STRERROR (GNUNET_ERROR_TYPE_INFO, "connect");
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Attempt to connect to `%s' failed\n"), GNUNET_a2s (serv_addr,
+                                                                addrlen));
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s));
+      return NULL;
+    }
   ret = GNUNET_CONNECTION_create_from_existing (s);
   ret->addr = GNUNET_malloc (addrlen);
   memcpy (ret->addr, serv_addr, addrlen);
   ret->addrlen = addrlen;
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Trying to connect to `%s' (%p)\n"),
-              GNUNET_a2s (serv_addr, addrlen), ret);
+  LOG (GNUNET_ERROR_TYPE_INFO, _("Trying to connect to `%s' (%p)\n"),
+       GNUNET_a2s (serv_addr, addrlen), ret);
 #endif
   return ret;
 }
@@ -1045,7 +1050,7 @@
 GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock)
 {
   if ((sock->ap_head != NULL) || (sock->dns_active != NULL))
-    return GNUNET_YES;          /* still trying to connect */
+    return GNUNET_YES;         /* still trying to connect */
   return (sock->sock == NULL) ? GNUNET_NO : GNUNET_YES;
 }
 
@@ -1065,23 +1070,23 @@
  */
 void
 GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
-                           int finish_pending_write)
+                          int finish_pending_write)
 {
   if (GNUNET_NO == finish_pending_write)
-  {
-    if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
     {
-      GNUNET_SCHEDULER_cancel (sock->write_task);
-      sock->write_task = GNUNET_SCHEDULER_NO_TASK;
-      sock->write_buffer_off = 0;
+      if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
+       {
+         GNUNET_SCHEDULER_cancel (sock->write_task);
+         sock->write_task = GNUNET_SCHEDULER_NO_TASK;
+         sock->write_buffer_off = 0;
+       }
+      sock->nth.notify_ready = NULL;
     }
-    sock->nth.notify_ready = NULL;
-  }
   if ((sock->write_buffer_off == 0) && (sock->dns_active != NULL))
-  {
-    GNUNET_RESOLVER_request_cancel (sock->dns_active);
-    sock->dns_active = NULL;
-  }
+    {
+      GNUNET_RESOLVER_request_cancel (sock->dns_active);
+      sock->dns_active = NULL;
+    }
 
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->destroy_task);
   sock->destroy_task = GNUNET_SCHEDULER_add_now (&destroy_continuation, sock);
@@ -1097,8 +1102,8 @@
   GNUNET_CONNECTION_Receiver receiver;
 
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Network signals time out to receiver (%p)!\n", sh);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Network signals time out to receiver (%p)!\n", sh);
 #endif
   GNUNET_assert (NULL != (receiver = sh->receiver));
   sh->receiver = NULL;
@@ -1136,63 +1141,62 @@
   sh->read_task = GNUNET_SCHEDULER_NO_TASK;
   if ((GNUNET_YES == sh->ignore_shutdown) &&
       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)))
-  {
-    /* ignore shutdown request, go again immediately */
+    {
+      /* ignore shutdown request, go again immediately */
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Ignoring shutdown signal per configuration\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Ignoring shutdown signal per configuration\n");
 #endif
-    sh->read_task =
-        GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
-                                       (sh->receive_timeout), sh->sock,
-                                       &receive_ready, sh);
-    return;
-  }
+      sh->read_task =
+       GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
+                                      (sh->receive_timeout), sh->sock,
+                                      &receive_ready, sh);
+      return;
+    }
   now = GNUNET_TIME_absolute_get ();
   if ((now.abs_value > sh->receive_timeout.abs_value) ||
       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) ||
       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)))
-  {
+    {
 #if DEBUG_CONNECTION
-    if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Receive from `%s' encounters error: time out by %llums... 
(%p)\n",
-                  GNUNET_a2s (sh->addr, sh->addrlen),
-                  GNUNET_TIME_absolute_get_duration (sh->receive_timeout).
-                  rel_value, sh);
+      if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
+       LOG (GNUNET_ERROR_TYPE_DEBUG,
+            "Receive from `%s' encounters error: time out by %llums... (%p)\n",
+            GNUNET_a2s (sh->addr, sh->addrlen),
+            GNUNET_TIME_absolute_get_duration (sh->receive_timeout).
+            rel_value, sh);
 #endif
-    signal_timeout (sh);
-    return;
-  }
+      signal_timeout (sh);
+      return;
+    }
   if (sh->sock == NULL)
-  {
-    /* connect failed for good */
+    {
+      /* connect failed for good */
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Receive encounters error, socket closed... (%p)\n", sh);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Receive encounters error, socket closed... (%p)\n", sh);
 #endif
-    signal_error (sh, ECONNREFUSED);
-    return;
-  }
+      signal_error (sh, ECONNREFUSED);
+      return;
+    }
   GNUNET_assert (GNUNET_NETWORK_fdset_isset (tc->read_ready, sh->sock));
 RETRY:
   ret = GNUNET_NETWORK_socket_recv (sh->sock, buffer, sh->max);
   if (ret == -1)
-  {
-    if (errno == EINTR)
-      goto RETRY;
+    {
+      if (errno == EINTR)
+       goto RETRY;
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error receiving: %s\n",
-                STRERROR (errno));
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Error receiving: %s\n",
+          STRERROR (errno));
 #endif
-    signal_error (sh, errno);
-    return;
-  }
+      signal_error (sh, errno);
+      return;
+    }
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "receive_ready read %u/%u bytes from `%s' (%p)!\n",
-              (unsigned int) ret, sh->max, GNUNET_a2s (sh->addr, sh->addrlen),
-              sh);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "receive_ready read %u/%u bytes from `%s' (%p)!\n",
+       (unsigned int) ret, sh->max, GNUNET_a2s (sh->addr, sh->addrlen), sh);
 #endif
   GNUNET_assert (NULL != (receiver = sh->receiver));
   sh->receiver = NULL;
@@ -1218,32 +1222,32 @@
 
   sh->read_task = GNUNET_SCHEDULER_NO_TASK;
   if (sh->sock == NULL)
-  {
-    /* not connected and no longer trying */
+    {
+      /* not connected and no longer trying */
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Receive encounters error, socket closed (%p)...\n", sh);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Receive encounters error, socket closed (%p)...\n", sh);
 #endif
-    signal_error (sh, ECONNREFUSED);
-    return;
-  }
+      signal_error (sh, ECONNREFUSED);
+      return;
+    }
   now = GNUNET_TIME_absolute_get ();
   if ((now.abs_value > sh->receive_timeout.abs_value) ||
       (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Receive encounters error: time out (%p)...\n", sh);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Receive encounters error: time out (%p)...\n", sh);
 #endif
-    signal_timeout (sh);
-    return;
-  }
+      signal_timeout (sh);
+      return;
+    }
   GNUNET_assert (sh->sock != NULL);
   /* connect succeeded, wait for data! */
   sh->read_task =
-      GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
-                                     (sh->receive_timeout), sh->sock,
-                                     &receive_ready, sh);
+    GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
+                                  (sh->receive_timeout), sh->sock,
+                                  &receive_ready, sh);
 }
 
 
@@ -1262,31 +1266,31 @@
  */
 void
 GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max,
-                           struct GNUNET_TIME_Relative timeout,
-                           GNUNET_CONNECTION_Receiver receiver,
-                           void *receiver_cls)
+                          struct GNUNET_TIME_Relative timeout,
+                          GNUNET_CONNECTION_Receiver receiver,
+                          void *receiver_cls)
 {
   struct GNUNET_SCHEDULER_TaskContext tc;
 
   GNUNET_assert ((sock->read_task == GNUNET_SCHEDULER_NO_TASK) &&
-                 (0 == (sock->ccs & COCO_RECEIVE_AGAIN)) &&
-                 (sock->receiver == NULL));
+                (0 == (sock->ccs & COCO_RECEIVE_AGAIN)) &&
+                (sock->receiver == NULL));
   sock->receiver = receiver;
   sock->receiver_cls = receiver_cls;
   sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout);
   sock->max = max;
   if (sock->sock != NULL)
-  {
-    memset (&tc, 0, sizeof (tc));
-    tc.reason = GNUNET_SCHEDULER_REASON_PREREQ_DONE;
-    receive_again (sock, &tc);
-    return;
-  }
+    {
+      memset (&tc, 0, sizeof (tc));
+      tc.reason = GNUNET_SCHEDULER_REASON_PREREQ_DONE;
+      receive_again (sock, &tc);
+      return;
+    }
   if ((sock->dns_active == NULL) && (sock->ap_head == NULL))
-  {
-    receiver (receiver_cls, NULL, 0, NULL, 0, ETIMEDOUT);
-    return;
-  }
+    {
+      receiver (receiver_cls, NULL, 0, NULL, 0, ETIMEDOUT);
+      return;
+    }
   sock->ccs += COCO_RECEIVE_AGAIN;
 }
 
@@ -1299,7 +1303,7 @@
  */
 void
 GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock,
-                                   int do_ignore)
+                                  int do_ignore)
 {
   sock->ignore_shutdown = do_ignore;
 }
@@ -1317,15 +1321,15 @@
 GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock)
 {
   if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_assert (sock == GNUNET_SCHEDULER_cancel (sock->read_task));
-    sock->read_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_assert (sock == GNUNET_SCHEDULER_cancel (sock->read_task));
+      sock->read_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   else
-  {
-    GNUNET_assert (0 != (sock->ccs & COCO_RECEIVE_AGAIN));
-    sock->ccs -= COCO_RECEIVE_AGAIN;
-  }
+    {
+      GNUNET_assert (0 != (sock->ccs & COCO_RECEIVE_AGAIN));
+      sock->ccs -= COCO_RECEIVE_AGAIN;
+    }
   sock->receiver = NULL;
   return sock->receiver_cls;
 }
@@ -1356,18 +1360,18 @@
     return GNUNET_NO;
   sock->nth.notify_ready = NULL;
   if (sock->write_buffer_size - sock->write_buffer_off < size)
-  {
-    /* need to compact */
-    memmove (sock->write_buffer, &sock->write_buffer[sock->write_buffer_pos],
-             used);
-    sock->write_buffer_off -= sock->write_buffer_pos;
-    sock->write_buffer_pos = 0;
-  }
+    {
+      /* need to compact */
+      memmove (sock->write_buffer,
+              &sock->write_buffer[sock->write_buffer_pos], used);
+      sock->write_buffer_off -= sock->write_buffer_pos;
+      sock->write_buffer_pos = 0;
+    }
   avail = sock->write_buffer_size - sock->write_buffer_off;
   GNUNET_assert (avail >= size);
   size =
-      notify (sock->nth.notify_ready_cls, avail,
-              &sock->write_buffer[sock->write_buffer_off]);
+    notify (sock->nth.notify_ready_cls, avail,
+           &sock->write_buffer[sock->write_buffer_off]);
   GNUNET_assert (size <= avail);
   sock->write_buffer_off += size;
   return GNUNET_YES;
@@ -1392,17 +1396,17 @@
   GNUNET_CONNECTION_TransmitReadyNotify notify;
 
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "transmit_timeout running (%p)\n", 
sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "transmit_timeout running (%p)\n", sock);
 #endif
   sock->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK;
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Transmit to `%s:%u/%s' fails, time out reached (%p).\n",
-              sock->hostname, sock->port, GNUNET_a2s (sock->addr,
-                                                      sock->addrlen), sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Transmit to `%s:%u/%s' fails, time out reached (%p).\n",
+       sock->hostname, sock->port, GNUNET_a2s (sock->addr,
+                                              sock->addrlen), sock);
 #endif
   GNUNET_assert (0 != (sock->ccs & COCO_TRANSMIT_READY));
-  sock->ccs -= COCO_TRANSMIT_READY;     /* remove request */
+  sock->ccs -= COCO_TRANSMIT_READY;    /* remove request */
   notify = sock->nth.notify_ready;
   sock->nth.notify_ready = NULL;
   notify (sock->nth.notify_ready_cls, 0, NULL);
@@ -1425,9 +1429,9 @@
   GNUNET_CONNECTION_TransmitReadyNotify notify;
 
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Transmission request of size %u fails (%s/%u), connection 
failed (%p).\n",
-              sock->nth.notify_size, sock->hostname, sock->port, sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Transmission request of size %u fails (%s/%u), connection failed 
(%p).\n",
+       sock->nth.notify_size, sock->hostname, sock->port, sock);
 #endif
   sock->write_task = GNUNET_SCHEDULER_NO_TASK;
   notify = sock->nth.notify_ready;
@@ -1447,20 +1451,20 @@
   GNUNET_CONNECTION_TransmitReadyNotify notify;
 
   if (NULL != sock->sock)
-  {
-    GNUNET_NETWORK_socket_shutdown (sock->sock, SHUT_RDWR);
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock));
-    sock->sock = NULL;
-  }
+    {
+      GNUNET_NETWORK_socket_shutdown (sock->sock, SHUT_RDWR);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock));
+      sock->sock = NULL;
+    }
   if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (sock->read_task);
-    sock->read_task = GNUNET_SCHEDULER_NO_TASK;
-    signal_timeout (sock);
-    return;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (sock->read_task);
+      sock->read_task = GNUNET_SCHEDULER_NO_TASK;
+      signal_timeout (sock);
+      return;
+    }
   if (sock->nth.notify_ready == NULL)
-    return;                     /* nobody to tell about it */
+    return;                    /* nobody to tell about it */
   notify = sock->nth.notify_ready;
   sock->nth.notify_ready = NULL;
   notify (sock->nth.notify_ready_cls, 0, NULL);
@@ -1484,129 +1488,129 @@
   size_t have;
 
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready running (%p).\n", sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready running (%p).\n", sock);
 #endif
   GNUNET_assert (sock->write_task != GNUNET_SCHEDULER_NO_TASK);
   sock->write_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_assert (sock->nth.timeout_task == GNUNET_SCHEDULER_NO_TASK);
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-  {
-    if (sock->ignore_shutdown == GNUNET_YES)
-      goto SCHEDULE_WRITE;      /* ignore shutdown, go again immediately */
+    {
+      if (sock->ignore_shutdown == GNUNET_YES)
+       goto SCHEDULE_WRITE;    /* ignore shutdown, go again immediately */
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Transmit to `%s' fails, shutdown happened (%p).\n",
-                GNUNET_a2s (sock->addr, sock->addrlen), sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Transmit to `%s' fails, shutdown happened (%p).\n",
+          GNUNET_a2s (sock->addr, sock->addrlen), sock);
 #endif
-    notify = sock->nth.notify_ready;
-    if (NULL != notify)
+      notify = sock->nth.notify_ready;
+      if (NULL != notify)
+       {
+         sock->nth.notify_ready = NULL;
+         notify (sock->nth.notify_ready_cls, 0, NULL);
+       }
+      return;
+    }
+  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT))
     {
+#if DEBUG_CONNECTION
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Transmit to `%s' fails, time out reached (%p).\n",
+          GNUNET_a2s (sock->addr, sock->addrlen), sock);
+#endif
+      notify = sock->nth.notify_ready;
+      GNUNET_assert (NULL != notify);
       sock->nth.notify_ready = NULL;
       notify (sock->nth.notify_ready_cls, 0, NULL);
+      return;
     }
-    return;
-  }
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT))
-  {
-#if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Transmit to `%s' fails, time out reached (%p).\n",
-                GNUNET_a2s (sock->addr, sock->addrlen), sock);
-#endif
-    notify = sock->nth.notify_ready;
-    GNUNET_assert (NULL != notify);
-    sock->nth.notify_ready = NULL;
-    notify (sock->nth.notify_ready_cls, 0, NULL);
-    return;
-  }
   GNUNET_assert (NULL != sock->sock);
   if (tc->write_ready == NULL)
-  {
-    /* special circumstances (in particular,
-     * PREREQ_DONE after connect): not yet ready to write,
-     * but no "fatal" error either.  Hence retry.  */
-    goto SCHEDULE_WRITE;
-  }
+    {
+      /* special circumstances (in particular,
+       * PREREQ_DONE after connect): not yet ready to write,
+       * but no "fatal" error either.  Hence retry.  */
+      goto SCHEDULE_WRITE;
+    }
   if (!GNUNET_NETWORK_fdset_isset (tc->write_ready, sock->sock))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _
-                ("Could not satisfy pending transmission request, socket 
closed or connect failed (%p).\n"),
-                sock);
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _
+          ("Could not satisfy pending transmission request, socket closed or 
connect failed (%p).\n"),
+          sock);
 #endif
-    transmit_error (sock);
-    return;                     /* connect failed for good, we're finished */
-  }
+      transmit_error (sock);
+      return;                  /* connect failed for good, we're finished */
+    }
   GNUNET_assert (sock->write_buffer_off >= sock->write_buffer_pos);
   if ((sock->nth.notify_ready != NULL) &&
       (sock->write_buffer_size < sock->nth.notify_size))
-  {
-    sock->write_buffer =
-        GNUNET_realloc (sock->write_buffer, sock->nth.notify_size);
-    sock->write_buffer_size = sock->nth.notify_size;
-  }
+    {
+      sock->write_buffer =
+       GNUNET_realloc (sock->write_buffer, sock->nth.notify_size);
+      sock->write_buffer_size = sock->nth.notify_size;
+    }
   process_notify (sock);
   have = sock->write_buffer_off - sock->write_buffer_pos;
   if (have == 0)
-  {
-    /* no data ready for writing, terminate write loop */
-    return;
-  }
+    {
+      /* no data ready for writing, terminate write loop */
+      return;
+    }
   GNUNET_assert (have <= sock->write_buffer_size);
   GNUNET_assert (have + sock->write_buffer_pos <= sock->write_buffer_size);
   GNUNET_assert (sock->write_buffer_pos <= sock->write_buffer_size);
 RETRY:
   ret =
-      GNUNET_NETWORK_socket_send (sock->sock,
-                                  &sock->write_buffer[sock->write_buffer_pos],
-                                  have);
+    GNUNET_NETWORK_socket_send (sock->sock,
+                               &sock->write_buffer[sock->write_buffer_pos],
+                               have);
   if (ret == -1)
-  {
-    if (errno == EINTR)
-      goto RETRY;
+    {
+      if (errno == EINTR)
+       goto RETRY;
 #if 0
-    int en = errno;
+      int en = errno;
 
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to send to `%s': %s\n"),
-                GNUNET_a2s (sock->addr, sock->addrlen), STRERROR (en));
+      LOG (GNUNET_ERROR_TYPE_ERROR, _("Failed to send to `%s': %s\n"),
+          GNUNET_a2s (sock->addr, sock->addrlen), STRERROR (en));
 #endif
 #if DEBUG_CONNECTION
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "send");
+      LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "send");
 #endif
-    transmit_error (sock);
-    return;
-  }
+      transmit_error (sock);
+      return;
+    }
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "transmit_ready transmitted %u/%u bytes to `%s' (%p)\n",
-              (unsigned int) ret, have, GNUNET_a2s (sock->addr, sock->addrlen),
-              sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "transmit_ready transmitted %u/%u bytes to `%s' (%p)\n",
+       (unsigned int) ret, have, GNUNET_a2s (sock->addr, sock->addrlen),
+       sock);
 #endif
   sock->write_buffer_pos += ret;
   if (sock->write_buffer_pos == sock->write_buffer_off)
-  {
-    /* transmitted all pending data */
-    sock->write_buffer_pos = 0;
-    sock->write_buffer_off = 0;
-  }
+    {
+      /* transmitted all pending data */
+      sock->write_buffer_pos = 0;
+      sock->write_buffer_off = 0;
+    }
   if ((sock->write_buffer_off == 0) && (NULL == sock->nth.notify_ready))
-    return;                     /* all data sent! */
+    return;                    /* all data sent! */
   /* not done writing, schedule more */
 SCHEDULE_WRITE:
 #if DEBUG_CONNECTION
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Re-scheduling transmit_ready (more to do) (%p).\n", sock);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Re-scheduling transmit_ready (more to do) (%p).\n", sock);
 #endif
   have = sock->write_buffer_off - sock->write_buffer_pos;
   GNUNET_assert ((sock->nth.notify_ready != NULL) || (have > 0));
   if (sock->write_task == GNUNET_SCHEDULER_NO_TASK)
     sock->write_task =
-        GNUNET_SCHEDULER_add_write_net ((sock->nth.notify_ready ==
-                                         NULL) ? GNUNET_TIME_UNIT_FOREVER_REL :
-                                        GNUNET_TIME_absolute_get_remaining
-                                        (sock->nth.transmit_timeout),
-                                        sock->sock, &transmit_ready, sock);
+      GNUNET_SCHEDULER_add_write_net ((sock->nth.notify_ready ==
+                                      NULL) ? GNUNET_TIME_UNIT_FOREVER_REL :
+                                     GNUNET_TIME_absolute_get_remaining
+                                     (sock->nth.transmit_timeout),
+                                     sock->sock, &transmit_ready, sock);
 }
 
 
@@ -1625,17 +1629,17 @@
  *         NULL if we are already going to notify someone else (busy)
  */
 struct GNUNET_CONNECTION_TransmitHandle *
-GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock,
-                                         size_t size,
-                                         struct GNUNET_TIME_Relative timeout,
-                                         GNUNET_CONNECTION_TransmitReadyNotify
-                                         notify, void *notify_cls)
+GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle
+                                        *sock, size_t size,
+                                        struct GNUNET_TIME_Relative timeout,
+                                        GNUNET_CONNECTION_TransmitReadyNotify
+                                        notify, void *notify_cls)
 {
   if (sock->nth.notify_ready != NULL)
-  {
-    GNUNET_assert (0);
-    return NULL;
-  }
+    {
+      GNUNET_assert (0);
+      return NULL;
+    }
   GNUNET_assert (notify != NULL);
   GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   GNUNET_assert (sock->write_buffer_off <= sock->write_buffer_size);
@@ -1649,36 +1653,36 @@
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sock->nth.timeout_task);
   if ((sock->sock == NULL) && (sock->ap_head == NULL) &&
       (sock->dns_active == NULL))
-  {
-    if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
-      GNUNET_SCHEDULER_cancel (sock->write_task);
-    sock->write_task = GNUNET_SCHEDULER_add_now (&connect_error, sock);
-    return &sock->nth;
-  }
+    {
+      if (sock->write_task != GNUNET_SCHEDULER_NO_TASK)
+       GNUNET_SCHEDULER_cancel (sock->write_task);
+      sock->write_task = GNUNET_SCHEDULER_add_now (&connect_error, sock);
+      return &sock->nth;
+    }
   if (GNUNET_SCHEDULER_NO_TASK != sock->write_task)
     return &sock->nth;
   if (sock->sock != NULL)
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Scheduling transmit_ready (%p).\n",
-                sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Scheduling transmit_ready (%p).\n",
+          sock);
 #endif
-    sock->write_task =
-        GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining
-                                        (sock->nth.transmit_timeout),
-                                        sock->sock, &transmit_ready, sock);
-  }
+      sock->write_task =
+       GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining
+                                       (sock->nth.transmit_timeout),
+                                       sock->sock, &transmit_ready, sock);
+    }
   else
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "CCS-Scheduling transmit_ready, adding timeout task (%p).\n",
-                sock);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "CCS-Scheduling transmit_ready, adding timeout task (%p).\n",
+          sock);
 #endif
-    sock->ccs |= COCO_TRANSMIT_READY;
-    sock->nth.timeout_task =
-        GNUNET_SCHEDULER_add_delayed (timeout, &transmit_timeout, sock);
-  }
+      sock->ccs |= COCO_TRANSMIT_READY;
+      sock->nth.timeout_task =
+       GNUNET_SCHEDULER_add_delayed (timeout, &transmit_timeout, sock);
+    }
   return &sock->nth;
 }
 
@@ -1690,28 +1694,28 @@
  */
 void
 GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
-                                                
GNUNET_CONNECTION_TransmitHandle
-                                                *th)
+                                               GNUNET_CONNECTION_TransmitHandle
+                                               *th)
 {
   GNUNET_assert (th->notify_ready != NULL);
   if (0 != (th->sh->ccs & COCO_TRANSMIT_READY))
-  {
+    {
 #if DEBUG_CONNECTION
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "notify_transmit_ready_cancel cancels timeout_task (%p)\n", 
th);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "notify_transmit_ready_cancel cancels timeout_task (%p)\n", th);
 #endif
-    GNUNET_SCHEDULER_cancel (th->timeout_task);
-    th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
-    th->sh->ccs -= COCO_TRANSMIT_READY;
-  }
+      GNUNET_SCHEDULER_cancel (th->timeout_task);
+      th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+      th->sh->ccs -= COCO_TRANSMIT_READY;
+    }
   else
-  {
-    if (th->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
     {
-      GNUNET_SCHEDULER_cancel (th->sh->write_task);
-      th->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
+      if (th->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
+       {
+         GNUNET_SCHEDULER_cancel (th->sh->write_task);
+         th->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
+       }
     }
-  }
   th->notify_ready = NULL;
 }
 

Modified: gnunet/src/util/container_bloomfilter.c
===================================================================
--- gnunet/src/util/container_bloomfilter.c     2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/container_bloomfilter.c     2011-10-11 09:43:04 UTC (rev 
17362)
@@ -44,6 +44,12 @@
 #include "gnunet_container_lib.h"
 #include "gnunet_disk_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 struct GNUNET_CONTAINER_BloomFilter
 {
 
@@ -83,8 +89,8 @@
  * @return number of bytes used for the data of the bloom filter
  */
 size_t
-GNUNET_CONTAINER_bloomfilter_get_size (const struct 
GNUNET_CONTAINER_BloomFilter
-                                       *bf)
+GNUNET_CONTAINER_bloomfilter_get_size (const struct
+                                      GNUNET_CONTAINER_BloomFilter *bf)
 {
   if (bf == NULL)
     return 0;
@@ -100,10 +106,10 @@
  */
 struct GNUNET_CONTAINER_BloomFilter *
 GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter
-                                   *bf)
+                                  *bf)
 {
   return GNUNET_CONTAINER_bloomfilter_init (bf->bitArray, bf->bitArraySize,
-                                            bf->addressesPerElement);
+                                           bf->addressesPerElement);
 }
 
 
@@ -175,7 +181,7 @@
  */
 static void
 incrementBit (char *bitArray, unsigned int bitIdx,
-              const struct GNUNET_DISK_FileHandle *fh)
+             const struct GNUNET_DISK_FileHandle *fh)
 {
   off_t fileSlot;
   unsigned char value;
@@ -191,25 +197,25 @@
   targetLoc = bitIdx % 2;
 
   GNUNET_assert (fileSlot ==
-                 GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET));
+                GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET));
   if (1 != GNUNET_DISK_file_read (fh, &value, 1))
     value = 0;
   low = value & 0xF;
   high = (value & (~0xF)) >> 4;
 
   if (targetLoc == 0)
-  {
-    if (low < 0xF)
-      low++;
-  }
+    {
+      if (low < 0xF)
+       low++;
+    }
   else
-  {
-    if (high < 0xF)
-      high++;
-  }
+    {
+      if (high < 0xF)
+       high++;
+    }
   value = ((high << 4) | low);
   GNUNET_assert (fileSlot ==
-                 GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET));
+                GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET));
   GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
 }
 
@@ -223,7 +229,7 @@
  */
 static void
 decrementBit (char *bitArray, unsigned int bitIdx,
-              const struct GNUNET_DISK_FileHandle *fh)
+             const struct GNUNET_DISK_FileHandle *fh)
 {
   off_t fileSlot;
   unsigned char value;
@@ -232,7 +238,7 @@
   unsigned int targetLoc;
 
   if (GNUNET_DISK_handle_invalid (fh))
-    return;                     /* cannot decrement! */
+    return;                    /* cannot decrement! */
   /* Each char slot in the counter file holds two 4 bit counters */
   fileSlot = bitIdx / 2;
   targetLoc = bitIdx % 2;
@@ -244,23 +250,23 @@
 
   /* decrement, but once we have reached the max, never go back! */
   if (targetLoc == 0)
-  {
-    if ((low > 0) && (low < 0xF))
-      low--;
-    if (low == 0)
     {
-      clearBit (bitArray, bitIdx);
+      if ((low > 0) && (low < 0xF))
+       low--;
+      if (low == 0)
+       {
+         clearBit (bitArray, bitIdx);
+       }
     }
-  }
   else
-  {
-    if ((high > 0) && (high < 0xF))
-      high--;
-    if (high == 0)
     {
-      clearBit (bitArray, bitIdx);
+      if ((high > 0) && (high < 0xF))
+       high--;
+      if (high == 0)
+       {
+         clearBit (bitArray, bitIdx);
+       }
     }
-  }
   value = ((high << 4) | low);
   GNUNET_DISK_file_seek (fh, fileSlot, GNUNET_DISK_SEEK_SET);
   GNUNET_assert (1 == GNUNET_DISK_file_write (fh, &value, 1));
@@ -289,19 +295,19 @@
   GNUNET_DISK_file_seek (fh, 0, GNUNET_DISK_SEEK_SET);
 
   while (bytesleft > 0)
-  {
-    if (bytesleft > BUFFSIZE)
     {
-      res = GNUNET_DISK_file_write (fh, buffer, BUFFSIZE);
-      bytesleft -= BUFFSIZE;
+      if (bytesleft > BUFFSIZE)
+       {
+         res = GNUNET_DISK_file_write (fh, buffer, BUFFSIZE);
+         bytesleft -= BUFFSIZE;
+       }
+      else
+       {
+         res = GNUNET_DISK_file_write (fh, buffer, bytesleft);
+         bytesleft = 0;
+       }
+      GNUNET_assert (res != GNUNET_SYSERR);
     }
-    else
-    {
-      res = GNUNET_DISK_file_write (fh, buffer, bytesleft);
-      bytesleft = 0;
-    }
-    GNUNET_assert (res != GNUNET_SYSERR);
-  }
   GNUNET_free (buffer);
   return GNUNET_OK;
 }
@@ -334,7 +340,7 @@
  */
 static void
 iterateBits (const struct GNUNET_CONTAINER_BloomFilter *bf,
-             BitIterator callback, void *arg, const GNUNET_HashCode * key)
+            BitIterator callback, void *arg, const GNUNET_HashCode * key)
 {
   GNUNET_HashCode tmp[2];
   int bitCount;
@@ -345,27 +351,27 @@
   tmp[0] = *key;
   round = 0;
   while (bitCount > 0)
-  {
-    while (slot < (sizeof (GNUNET_HashCode) / sizeof (uint32_t)))
     {
-      if (GNUNET_YES !=
-         callback (arg, bf,
-                   (((uint32_t *) & tmp[round & 1])[slot]) &
-                   ((bf->bitArraySize * 8) - 1)))
-       return;
-      slot++;
-      bitCount--;
-      if (bitCount == 0)
-        break;
+      while (slot < (sizeof (GNUNET_HashCode) / sizeof (uint32_t)))
+       {
+         if (GNUNET_YES !=
+             callback (arg, bf,
+                       (((uint32_t *) & tmp[round & 1])[slot]) &
+                       ((bf->bitArraySize * 8) - 1)))
+           return;
+         slot++;
+         bitCount--;
+         if (bitCount == 0)
+           break;
+       }
+      if (bitCount > 0)
+       {
+         GNUNET_CRYPTO_hash (&tmp[round & 1], sizeof (GNUNET_HashCode),
+                             &tmp[(round + 1) & 1]);
+         round++;
+         slot = 0;
+       }
     }
-    if (bitCount > 0)
-    {
-      GNUNET_CRYPTO_hash (&tmp[round & 1], sizeof (GNUNET_HashCode),
-                          &tmp[(round + 1) & 1]);
-      round++;
-      slot = 0;
-    }
-  }
 }
 
 
@@ -378,8 +384,9 @@
  * @return GNUNET_YES
  */
 static int
-incrementBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf,
-                      unsigned int bit)
+incrementBitCallback (void *cls,
+                     const struct GNUNET_CONTAINER_BloomFilter *bf,
+                     unsigned int bit)
 {
   struct GNUNET_CONTAINER_BloomFilter *b = cls;
 
@@ -397,8 +404,9 @@
  * @return GNUNET_YES
  */
 static int
-decrementBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf,
-                      unsigned int bit)
+decrementBitCallback (void *cls,
+                     const struct GNUNET_CONTAINER_BloomFilter *bf,
+                     unsigned int bit)
 {
   struct GNUNET_CONTAINER_BloomFilter *b = cls;
 
@@ -417,15 +425,15 @@
  */
 static int
 testBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf,
-                 unsigned int bit)
+                unsigned int bit)
 {
   int *arg = cls;
 
   if (GNUNET_NO == testBit (bf->bitArray, bit))
-  {
-    *arg = GNUNET_NO;
-    return GNUNET_NO;
-  }
+    {
+      *arg = GNUNET_NO;
+      return GNUNET_NO;
+    }
   return GNUNET_YES;
 }
 
@@ -443,7 +451,7 @@
  */
 struct GNUNET_CONTAINER_BloomFilter *
 GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size,
-                                   unsigned int k)
+                                  unsigned int k)
 {
   struct GNUNET_CONTAINER_BloomFilter *bf;
   char *rbuff;
@@ -459,32 +467,32 @@
   ui = 1;
   while (ui < size)
     ui *= 2;
-  size = ui;                    /* make sure it's a power of 2 */
+  size = ui;                   /* make sure it's a power of 2 */
 
   bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter));
   /* Try to open a bloomfilter file */
   bf->fh =
-      GNUNET_DISK_file_open (filename,
-                             GNUNET_DISK_OPEN_READWRITE |
-                             GNUNET_DISK_OPEN_CREATE,
-                             GNUNET_DISK_PERM_USER_READ |
-                             GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_file_open (filename,
+                          GNUNET_DISK_OPEN_READWRITE |
+                          GNUNET_DISK_OPEN_CREATE,
+                          GNUNET_DISK_PERM_USER_READ |
+                          GNUNET_DISK_PERM_USER_WRITE);
   if (NULL == bf->fh)
-  {
-    GNUNET_free (bf);
-    return NULL;
-  }
+    {
+      GNUNET_free (bf);
+      return NULL;
+    }
   bf->filename = GNUNET_strdup (filename);
   /* Alloc block */
   bf->bitArray = GNUNET_malloc_large (size);
   if (bf->bitArray == NULL)
-  {
-    if (bf->fh != NULL)
-      GNUNET_DISK_file_close (bf->fh);
-    GNUNET_free (bf->filename);
-    GNUNET_free (bf);
-    return NULL;
-  }
+    {
+      if (bf->fh != NULL)
+       GNUNET_DISK_file_close (bf->fh);
+      GNUNET_free (bf->filename);
+      GNUNET_free (bf);
+      return NULL;
+    }
   bf->bitArraySize = size;
   bf->addressesPerElement = k;
   memset (bf->bitArray, 0, bf->bitArraySize);
@@ -493,28 +501,27 @@
   rbuff = GNUNET_malloc (BUFFSIZE);
   pos = 0;
   while (pos < size * 8)
-  {
-    int res;
+    {
+      int res;
 
-    res = GNUNET_DISK_file_read (bf->fh, rbuff, BUFFSIZE);
-    if (res == -1)
-    {
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "read",
-                                bf->filename);
+      res = GNUNET_DISK_file_read (bf->fh, rbuff, BUFFSIZE);
+      if (res == -1)
+       {
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "read", bf->filename);
+       }
+      if (res == 0)
+       break;                  /* is ok! we just did not use that many bits 
yet */
+      for (i = 0; i < res; i++)
+       {
+         if ((rbuff[i] & 0x0F) != 0)
+           setBit (bf->bitArray, pos + i * 2);
+         if ((rbuff[i] & 0xF0) != 0)
+           setBit (bf->bitArray, pos + i * 2 + 1);
+       }
+      if (res < BUFFSIZE)
+       break;
+      pos += BUFFSIZE * 2;     /* 2 bits per byte in the buffer */
     }
-    if (res == 0)
-      break;                    /* is ok! we just did not use that many bits 
yet */
-    for (i = 0; i < res; i++)
-    {
-      if ((rbuff[i] & 0x0F) != 0)
-        setBit (bf->bitArray, pos + i * 2);
-      if ((rbuff[i] & 0xF0) != 0)
-        setBit (bf->bitArray, pos + i * 2 + 1);
-    }
-    if (res < BUFFSIZE)
-      break;
-    pos += BUFFSIZE * 2;        /* 2 bits per byte in the buffer */
-  }
   GNUNET_free (rbuff);
   return bf;
 }
@@ -535,7 +542,7 @@
  */
 struct GNUNET_CONTAINER_BloomFilter *
 GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size,
-                                   unsigned int k)
+                                  unsigned int k)
 {
   struct GNUNET_CONTAINER_BloomFilter *bf;
   size_t ui;
@@ -546,19 +553,19 @@
   while (ui < size)
     ui *= 2;
   if (size != ui)
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
   bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter));
   bf->filename = NULL;
   bf->fh = NULL;
   bf->bitArray = GNUNET_malloc_large (size);
   if (bf->bitArray == NULL)
-  {
-    GNUNET_free (bf);
-    return NULL;
-  }
+    {
+      GNUNET_free (bf);
+      return NULL;
+    }
   bf->bitArraySize = size;
   bf->addressesPerElement = k;
   if (data != NULL)
@@ -580,8 +587,8 @@
  */
 int
 GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct
-                                           GNUNET_CONTAINER_BloomFilter *bf,
-                                           char *data, size_t size)
+                                          GNUNET_CONTAINER_BloomFilter *bf,
+                                          char *data, size_t size)
 {
   if (NULL == bf)
     return GNUNET_SYSERR;
@@ -638,7 +645,7 @@
  */
 int
 GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter
-                                   *bf, const GNUNET_HashCode * e)
+                                  *bf, const GNUNET_HashCode * e)
 {
   int res;
 
@@ -658,7 +665,7 @@
  */
 void
 GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf,
-                                  const GNUNET_HashCode * e)
+                                 const GNUNET_HashCode * e)
 {
   if (NULL == bf)
     return;
@@ -678,7 +685,7 @@
  */
 int
 GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
-                                 const char *data, size_t size)
+                                const char *data, size_t size)
 {
   unsigned int i;
   unsigned int n;
@@ -712,8 +719,8 @@
  */
 int
 GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf,
-                                  const struct GNUNET_CONTAINER_BloomFilter
-                                  *to_or, size_t size)
+                                 const struct GNUNET_CONTAINER_BloomFilter
+                                 *to_or, size_t size)
 {
   unsigned int i;
   unsigned int n;
@@ -743,7 +750,7 @@
  */
 void
 GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
-                                     const GNUNET_HashCode * e)
+                                    const GNUNET_HashCode * e)
 {
   if (NULL == bf)
     return;
@@ -765,9 +772,9 @@
  */
 void
 GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
-                                     GNUNET_HashCodeIterator iterator,
-                                     void *iterator_cls, size_t size,
-                                     unsigned int k)
+                                    GNUNET_HashCodeIterator iterator,
+                                    void *iterator_cls, size_t size,
+                                    unsigned int k)
 {
   GNUNET_HashCode hc;
   unsigned int i;
@@ -776,7 +783,7 @@
   i = 1;
   while (i < size)
     i *= 2;
-  size = i;                     /* make sure it's a power of 2 */
+  size = i;                    /* make sure it's a power of 2 */
 
   bf->bitArraySize = size;
   bf->bitArray = GNUNET_malloc (size);

Modified: gnunet/src/util/container_heap.c
===================================================================
--- gnunet/src/util/container_heap.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/container_heap.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -28,6 +28,7 @@
 #include "platform.h"
 #include "gnunet_util_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
 #define DEBUG 0
 
@@ -115,10 +116,10 @@
   if (NULL == node)
     return;
   GNUNET_assert (node->tree_size ==
-                 ((node->left_child ==
-                   NULL) ? 0 : 1 + node->left_child->tree_size) +
-                 ((node->right_child ==
-                   NULL) ? 0 : 1 + node->right_child->tree_size));
+                ((node->left_child ==
+                  NULL) ? 0 : 1 + node->left_child->tree_size) +
+                ((node->right_child ==
+                  NULL) ? 0 : 1 + node->right_child->tree_size));
   check (node->left_child);
   check (node->right_child);
 }
@@ -197,7 +198,7 @@
  */
 GNUNET_CONTAINER_HeapCostType
 GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode
-                                     *node)
+                                    * node)
 {
   return node->cost;
 }
@@ -213,8 +214,8 @@
  */
 static int
 node_iterator (const struct GNUNET_CONTAINER_Heap *heap,
-               struct GNUNET_CONTAINER_HeapNode *node,
-               GNUNET_CONTAINER_HeapIterator iterator, void *iterator_cls)
+              struct GNUNET_CONTAINER_HeapNode *node,
+              GNUNET_CONTAINER_HeapIterator iterator, void *iterator_cls)
 {
   if (node == NULL)
     return GNUNET_YES;
@@ -237,8 +238,8 @@
  */
 void
 GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
-                               GNUNET_CONTAINER_HeapIterator iterator,
-                               void *iterator_cls)
+                              GNUNET_CONTAINER_HeapIterator iterator,
+                              void *iterator_cls)
 {
   (void) node_iterator (heap, heap->root, iterator, iterator_cls);
 }
@@ -268,9 +269,9 @@
     pos = heap->root;
   element = pos->element;
   heap->walk_pos =
-      (0 ==
-       GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
-                                 2)) ? pos->right_child : pos->left_child;
+    (0 ==
+     GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+                              2)) ? pos->right_child : pos->left_child;
   return element;
 }
 
@@ -285,51 +286,51 @@
  */
 static void
 insert_node (struct GNUNET_CONTAINER_Heap *heap,
-             struct GNUNET_CONTAINER_HeapNode *pos,
-             struct GNUNET_CONTAINER_HeapNode *node)
+            struct GNUNET_CONTAINER_HeapNode *pos,
+            struct GNUNET_CONTAINER_HeapNode *node)
 {
   struct GNUNET_CONTAINER_HeapNode *parent;
 
   GNUNET_assert (node->parent == NULL);
   while ((heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ? (pos->cost >=
-                                                             node->cost)
-         : (pos->cost <= node->cost))
-  {
-    /* node is descendent of pos */
-    pos->tree_size += (1 + node->tree_size);
-    if (pos->left_child == NULL)
+                                                            node->cost)
+        : (pos->cost <= node->cost))
     {
-      pos->left_child = node;
-      node->parent = pos;
-      return;
+      /* node is descendent of pos */
+      pos->tree_size += (1 + node->tree_size);
+      if (pos->left_child == NULL)
+       {
+         pos->left_child = node;
+         node->parent = pos;
+         return;
+       }
+      if (pos->right_child == NULL)
+       {
+         pos->right_child = node;
+         node->parent = pos;
+         return;
+       }
+      /* keep it balanced by descending into smaller subtree */
+      if (pos->left_child->tree_size < pos->right_child->tree_size)
+       pos = pos->left_child;
+      else
+       pos = pos->right_child;
     }
-    if (pos->right_child == NULL)
-    {
-      pos->right_child = node;
-      node->parent = pos;
-      return;
-    }
-    /* keep it balanced by descending into smaller subtree */
-    if (pos->left_child->tree_size < pos->right_child->tree_size)
-      pos = pos->left_child;
-    else
-      pos = pos->right_child;
-  }
   /* make 'node' parent of 'pos' */
   parent = pos->parent;
   pos->parent = NULL;
   node->parent = parent;
   if (NULL == parent)
-  {
-    heap->root = node;
-  }
+    {
+      heap->root = node;
+    }
   else
-  {
-    if (parent->left_child == pos)
-      parent->left_child = node;
-    else
-      parent->right_child = node;
-  }
+    {
+      if (parent->left_child == pos)
+       parent->left_child = node;
+      else
+       parent->right_child = node;
+    }
   /* insert 'pos' below 'node' */
   insert_node (heap, node, pos);
   CHECK (pos);
@@ -345,8 +346,9 @@
  * @return node for the new element
  */
 struct GNUNET_CONTAINER_HeapNode *
-GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void 
*element,
-                              GNUNET_CONTAINER_HeapCostType cost)
+GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap,
+                             void *element,
+                             GNUNET_CONTAINER_HeapCostType cost)
 {
   struct GNUNET_CONTAINER_HeapNode *node;
 
@@ -382,27 +384,27 @@
   heap->size--;
   ret = root->element;
   if (root->left_child == NULL)
-  {
-    heap->root = root->right_child;
-    if (root->right_child != NULL)
-      root->right_child->parent = NULL;
-  }
+    {
+      heap->root = root->right_child;
+      if (root->right_child != NULL)
+       root->right_child->parent = NULL;
+    }
   else if (root->right_child == NULL)
-  {
-    heap->root = root->left_child;
-    root->left_child->parent = NULL;
-  }
+    {
+      heap->root = root->left_child;
+      root->left_child->parent = NULL;
+    }
   else
-  {
-    root->left_child->parent = NULL;
-    root->right_child->parent = NULL;
-    heap->root = root->left_child;
-    insert_node (heap, heap->root, root->right_child);
-  }
+    {
+      root->left_child->parent = NULL;
+      root->right_child->parent = NULL;
+      heap->root = root->left_child;
+      insert_node (heap, heap->root, root->right_child);
+    }
   GNUNET_free (root);
 #if DEBUG
   GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
-                 (heap->size == heap->root->tree_size + 1));
+                (heap->size == heap->root->tree_size + 1));
   CHECK (heap->root);
 #endif
   return ret;
@@ -434,43 +436,43 @@
 
   /* unlink 'node' itself and insert children in its place */
   if (node->parent == NULL)
-  {
-    if (node->left_child != NULL)
     {
-      heap->root = node->left_child;
-      node->left_child->parent = NULL;
-      if (node->right_child != NULL)
-      {
-        node->right_child->parent = NULL;
-        insert_node (heap, heap->root, node->right_child);
-      }
+      if (node->left_child != NULL)
+       {
+         heap->root = node->left_child;
+         node->left_child->parent = NULL;
+         if (node->right_child != NULL)
+           {
+             node->right_child->parent = NULL;
+             insert_node (heap, heap->root, node->right_child);
+           }
+       }
+      else
+       {
+         heap->root = node->right_child;
+         if (node->right_child != NULL)
+           node->right_child->parent = NULL;
+       }
     }
-    else
+  else
     {
-      heap->root = node->right_child;
+      if (node->parent->left_child == node)
+       node->parent->left_child = NULL;
+      else
+       node->parent->right_child = NULL;
+      if (node->left_child != NULL)
+       {
+         node->left_child->parent = NULL;
+         node->parent->tree_size -= (1 + node->left_child->tree_size);
+         insert_node (heap, node->parent, node->left_child);
+       }
       if (node->right_child != NULL)
-        node->right_child->parent = NULL;
+       {
+         node->right_child->parent = NULL;
+         node->parent->tree_size -= (1 + node->right_child->tree_size);
+         insert_node (heap, node->parent, node->right_child);
+       }
     }
-  }
-  else
-  {
-    if (node->parent->left_child == node)
-      node->parent->left_child = NULL;
-    else
-      node->parent->right_child = NULL;
-    if (node->left_child != NULL)
-    {
-      node->left_child->parent = NULL;
-      node->parent->tree_size -= (1 + node->left_child->tree_size);
-      insert_node (heap, node->parent, node->left_child);
-    }
-    if (node->right_child != NULL)
-    {
-      node->right_child->parent = NULL;
-      node->parent->tree_size -= (1 + node->right_child->tree_size);
-      insert_node (heap, node->parent, node->right_child);
-    }
-  }
   node->parent = NULL;
   node->left_child = NULL;
   node->right_child = NULL;
@@ -504,7 +506,7 @@
 #if DEBUG
   CHECK (heap->root);
   GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
-                 (heap->size == heap->root->tree_size + 1));
+                (heap->size == heap->root->tree_size + 1));
 #endif
   return ret;
 }
@@ -519,19 +521,19 @@
  */
 void
 GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
-                                   struct GNUNET_CONTAINER_HeapNode *node,
-                                   GNUNET_CONTAINER_HeapCostType new_cost)
+                                  struct GNUNET_CONTAINER_HeapNode *node,
+                                  GNUNET_CONTAINER_HeapCostType new_cost)
 {
 #if DEBUG
   GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
-                 (heap->size == heap->root->tree_size + 1));
+                (heap->size == heap->root->tree_size + 1));
   CHECK (heap->root);
 #endif
   remove_node (node);
 #if DEBUG
   CHECK (heap->root);
   GNUNET_assert (((heap->size == 1) && (heap->root == NULL)) ||
-                 (heap->size == heap->root->tree_size + 2));
+                (heap->size == heap->root->tree_size + 2));
 #endif
   node->cost = new_cost;
   if (heap->root == NULL)
@@ -541,7 +543,7 @@
 #if DEBUG
   CHECK (heap->root);
   GNUNET_assert (((heap->size == 0) && (heap->root == NULL)) ||
-                 (heap->size == heap->root->tree_size + 1));
+                (heap->size == heap->root->tree_size + 1));
 #endif
 }
 

Modified: gnunet/src/util/container_meta_data.c
===================================================================
--- gnunet/src/util/container_meta_data.c       2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/container_meta_data.c       2011-10-11 09:43:04 UTC (rev 
17362)
@@ -32,6 +32,8 @@
 #include <extractor.h>
 #include <zlib.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Meta data item.
  */
@@ -160,10 +162,10 @@
   if (md == NULL)
     return;
   while (NULL != (item = md->items))
-  {
-    md->items = item->next;
-    meta_item_free (item);
-  }
+    {
+      md->items = item->next;
+      meta_item_free (item);
+    }
   GNUNET_free_non_null (md->sbuf);
   GNUNET_free (md);
 }
@@ -182,10 +184,10 @@
   if (md == NULL)
     return;
   while (NULL != (item = md->items))
-  {
-    md->items = item->next;
-    meta_item_free (item);
-  }
+    {
+      md->items = item->next;
+      meta_item_free (item);
+    }
   GNUNET_free_non_null (md->sbuf);
   memset (md, 0, sizeof (struct GNUNET_CONTAINER_MetaData));
 }
@@ -204,9 +206,9 @@
  */
 int
 GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData
-                                       *md1,
-                                       const struct GNUNET_CONTAINER_MetaData
-                                       *md2)
+                                      *md1,
+                                      const struct GNUNET_CONTAINER_MetaData
+                                      *md2)
 {
   struct MetaItem *i;
   struct MetaItem *j;
@@ -219,24 +221,24 @@
 
   i = md1->items;
   while (NULL != i)
-  {
-    found = GNUNET_NO;
-    j = md2->items;
-    while (NULL != j)
     {
-      if ((i->type == j->type) && (i->format == j->format) &&
-          (i->data_size == j->data_size) &&
-          (0 == memcmp (i->data, j->data, i->data_size)))
-      {
-        found = GNUNET_YES;
-        break;
-      }
-      j = j->next;
+      found = GNUNET_NO;
+      j = md2->items;
+      while (NULL != j)
+       {
+         if ((i->type == j->type) && (i->format == j->format) &&
+             (i->data_size == j->data_size) &&
+             (0 == memcmp (i->data, j->data, i->data_size)))
+           {
+             found = GNUNET_YES;
+             break;
+           }
+         j = j->next;
+       }
+      if (found == GNUNET_NO)
+       return GNUNET_NO;
+      i = i->next;
     }
-    if (found == GNUNET_NO)
-      return GNUNET_NO;
-    i = i->next;
-  }
   return GNUNET_YES;
 }
 
@@ -261,11 +263,11 @@
  */
 int
 GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
-                                   const char *plugin_name,
-                                   enum EXTRACTOR_MetaType type,
-                                   enum EXTRACTOR_MetaFormat format,
-                                   const char *data_mime_type, const char 
*data,
-                                   size_t data_len)
+                                  const char *plugin_name,
+                                  enum EXTRACTOR_MetaType type,
+                                  enum EXTRACTOR_MetaFormat format,
+                                  const char *data_mime_type,
+                                  const char *data, size_t data_len)
 {
   struct MetaItem *prev;
   struct MetaItem *pos;
@@ -275,28 +277,28 @@
   prev = NULL;
   pos = md->items;
   while (NULL != pos)
-  {
-    if (pos->data_size < data_len)
-      break;
-    if ((pos->type == type) && (pos->data_size == data_len) &&
-        (0 == memcmp (pos->data, data, data_len)))
     {
-      if ((pos->mime_type == NULL) && (data_mime_type != NULL))
-      {
-        pos->mime_type = GNUNET_strdup (data_mime_type);
-        invalidate_sbuf (md);
-      }
-      if ((pos->format == EXTRACTOR_METAFORMAT_C_STRING) &&
-          (format == EXTRACTOR_METAFORMAT_UTF8))
-      {
-        pos->format = EXTRACTOR_METAFORMAT_UTF8;
-        invalidate_sbuf (md);
-      }
-      return GNUNET_SYSERR;
+      if (pos->data_size < data_len)
+       break;
+      if ((pos->type == type) && (pos->data_size == data_len) &&
+         (0 == memcmp (pos->data, data, data_len)))
+       {
+         if ((pos->mime_type == NULL) && (data_mime_type != NULL))
+           {
+             pos->mime_type = GNUNET_strdup (data_mime_type);
+             invalidate_sbuf (md);
+           }
+         if ((pos->format == EXTRACTOR_METAFORMAT_C_STRING) &&
+             (format == EXTRACTOR_METAFORMAT_UTF8))
+           {
+             pos->format = EXTRACTOR_METAFORMAT_UTF8;
+             invalidate_sbuf (md);
+           }
+         return GNUNET_SYSERR;
+       }
+      prev = pos;
+      pos = pos->next;
     }
-    prev = pos;
-    pos = pos->next;
-  }
   md->item_count++;
   i = GNUNET_malloc (sizeof (struct MetaItem));
   i->type = type;
@@ -308,23 +310,23 @@
   else
     prev->next = i;
   i->mime_type =
-      (data_mime_type == NULL) ? NULL : GNUNET_strdup (data_mime_type);
+    (data_mime_type == NULL) ? NULL : GNUNET_strdup (data_mime_type);
   i->plugin_name = (plugin_name == NULL) ? NULL : GNUNET_strdup (plugin_name);
   i->data = GNUNET_malloc (data_len);
   memcpy (i->data, data, data_len);
   /* change OS native dir separators to unix '/' and others to '_' */
   if (type == EXTRACTOR_METATYPE_FILENAME)
-  {
-    p = i->data;
-    while ((*p != '\0') && (p < i->data + data_len))
     {
-      if (*p == DIR_SEPARATOR)
-        *p = '/';
-      else if (*p == '\\')
-        *p = '_';
-      p++;
+      p = i->data;
+      while ((*p != '\0') && (p < i->data + data_len))
+       {
+         if (*p == DIR_SEPARATOR)
+           *p = '/';
+         else if (*p == '\\')
+           *p = '_';
+         p++;
+       }
     }
-  }
   invalidate_sbuf (md);
   return GNUNET_OK;
 }
@@ -347,14 +349,14 @@
  * @return 0 (to continue)
  */
 static int
-merge_helper (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
-              enum EXTRACTOR_MetaFormat format, const char *data_mime_type,
-              const char *data, size_t data_len)
+merge_helper (void *cls, const char *plugin_name,
+             enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format,
+             const char *data_mime_type, const char *data, size_t data_len)
 {
   struct GNUNET_CONTAINER_MetaData *md = cls;
 
   (void) GNUNET_CONTAINER_meta_data_insert (md, plugin_name, type, format,
-                                            data_mime_type, data, data_len);
+                                           data_mime_type, data, data_len);
   return 0;
 }
 
@@ -368,7 +370,7 @@
  */
 void
 GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
-                                  const struct GNUNET_CONTAINER_MetaData *in)
+                                 const struct GNUNET_CONTAINER_MetaData *in)
 {
   GNUNET_CONTAINER_meta_data_iterate (in, &merge_helper, md);
 }
@@ -386,8 +388,8 @@
  */
 int
 GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
-                                   enum EXTRACTOR_MetaType type,
-                                   const char *data, size_t data_len)
+                                  enum EXTRACTOR_MetaType type,
+                                  const char *data, size_t data_len)
 {
   struct MetaItem *pos;
   struct MetaItem *prev;
@@ -395,24 +397,24 @@
   prev = NULL;
   pos = md->items;
   while (NULL != pos)
-  {
-    if ((pos->type == type) &&
-        ((data == NULL) ||
-         ((pos->data_size == data_len) &&
-          (0 == memcmp (pos->data, data, data_len)))))
     {
-      if (prev == NULL)
-        md->items = pos->next;
-      else
-        prev->next = pos->next;
-      meta_item_free (pos);
-      md->item_count--;
-      invalidate_sbuf (md);
-      return GNUNET_OK;
+      if ((pos->type == type) &&
+         ((data == NULL) ||
+          ((pos->data_size == data_len) &&
+           (0 == memcmp (pos->data, data, data_len)))))
+       {
+         if (prev == NULL)
+           md->items = pos->next;
+         else
+           prev->next = pos->next;
+         meta_item_free (pos);
+         md->item_count--;
+         invalidate_sbuf (md);
+         return GNUNET_OK;
+       }
+      prev = pos;
+      pos = pos->next;
     }
-    prev = pos;
-    pos = pos->next;
-  }
   return GNUNET_SYSERR;
 }
 
@@ -425,19 +427,20 @@
  */
 void
 GNUNET_CONTAINER_meta_data_add_publication_date (struct
-                                                 GNUNET_CONTAINER_MetaData *md)
+                                                GNUNET_CONTAINER_MetaData
+                                                *md)
 {
   char *dat;
   struct GNUNET_TIME_Absolute t;
 
   t = GNUNET_TIME_absolute_get ();
   GNUNET_CONTAINER_meta_data_delete (md, EXTRACTOR_METATYPE_PUBLICATION_DATE,
-                                     NULL, 0);
+                                    NULL, 0);
   dat = GNUNET_STRINGS_absolute_time_to_string (t);
   GNUNET_CONTAINER_meta_data_insert (md, "<gnunet>",
-                                     EXTRACTOR_METATYPE_PUBLICATION_DATE,
-                                     EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                     dat, strlen (dat) + 1);
+                                    EXTRACTOR_METATYPE_PUBLICATION_DATE,
+                                    EXTRACTOR_METAFORMAT_UTF8, "text/plain",
+                                    dat, strlen (dat) + 1);
   GNUNET_free (dat);
 }
 
@@ -451,9 +454,9 @@
  * @return number of entries
  */
 int
-GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md,
-                                    EXTRACTOR_MetaDataProcessor iter,
-                                    void *iter_cls)
+GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData
+                                   *md, EXTRACTOR_MetaDataProcessor iter,
+                                   void *iter_cls)
 {
   struct MetaItem *pos;
 
@@ -463,13 +466,13 @@
     return md->item_count;
   pos = md->items;
   while (NULL != pos)
-  {
-    if (0 !=
-        iter (iter_cls, pos->plugin_name, pos->type, pos->format,
-              pos->mime_type, pos->data, pos->data_size))
-      return md->item_count;
-    pos = pos->next;
-  }
+    {
+      if (0 !=
+         iter (iter_cls, pos->plugin_name, pos->type, pos->format,
+               pos->mime_type, pos->data, pos->data_size))
+       return md->item_count;
+      pos = pos->next;
+    }
   return md->item_count;
 }
 
@@ -486,7 +489,7 @@
  */
 char *
 GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData
-                                        *md, enum EXTRACTOR_MetaType type)
+                                       *md, enum EXTRACTOR_MetaType type)
 {
   struct MetaItem *pos;
 
@@ -494,13 +497,13 @@
     return NULL;
   pos = md->items;
   while (NULL != pos)
-  {
-    if ((type == pos->type) &&
-        ((pos->format == EXTRACTOR_METAFORMAT_UTF8) ||
-         (pos->format == EXTRACTOR_METAFORMAT_C_STRING)))
-      return GNUNET_strdup (pos->data);
-    pos = pos->next;
-  }
+    {
+      if ((type == pos->type) &&
+         ((pos->format == EXTRACTOR_METAFORMAT_UTF8) ||
+          (pos->format == EXTRACTOR_METAFORMAT_C_STRING)))
+       return GNUNET_strdup (pos->data);
+      pos = pos->next;
+    }
   return NULL;
 }
 
@@ -518,8 +521,8 @@
  */
 char *
 GNUNET_CONTAINER_meta_data_get_first_by_types (const struct
-                                               GNUNET_CONTAINER_MetaData *md,
-                                               ...)
+                                              GNUNET_CONTAINER_MetaData *md,
+                                              ...)
 {
   char *ret;
   va_list args;
@@ -530,15 +533,15 @@
   ret = NULL;
   va_start (args, md);
   while (1)
-  {
-    type = va_arg (args, enum EXTRACTOR_MetaType);
+    {
+      type = va_arg (args, enum EXTRACTOR_MetaType);
 
-    if (type == -1)
-      break;
-    ret = GNUNET_CONTAINER_meta_data_get_by_type (md, type);
-    if (ret != NULL)
-      break;
-  }
+      if (type == -1)
+       break;
+      ret = GNUNET_CONTAINER_meta_data_get_by_type (md, type);
+      if (ret != NULL)
+       break;
+    }
   va_end (args);
   return ret;
 }
@@ -553,8 +556,9 @@
  * @return number of bytes in thumbnail, 0 if not available
  */
 size_t
-GNUNET_CONTAINER_meta_data_get_thumbnail (const struct 
GNUNET_CONTAINER_MetaData
-                                          * md, unsigned char **thumb)
+GNUNET_CONTAINER_meta_data_get_thumbnail (const struct
+                                         GNUNET_CONTAINER_MetaData * md,
+                                         unsigned char **thumb)
 {
   struct MetaItem *pos;
   struct MetaItem *match;
@@ -564,19 +568,19 @@
   match = NULL;
   pos = md->items;
   while (NULL != pos)
-  {
-    if ((NULL != pos->mime_type) &&
-        (0 == strncasecmp ("image/", pos->mime_type, strlen ("image/"))) &&
-        (pos->format == EXTRACTOR_METAFORMAT_BINARY))
     {
-      if (match == NULL)
-        match = pos;
-      else if ((match->type != EXTRACTOR_METATYPE_THUMBNAIL) &&
-               (pos->type == EXTRACTOR_METATYPE_THUMBNAIL))
-        match = pos;
+      if ((NULL != pos->mime_type) &&
+         (0 == strncasecmp ("image/", pos->mime_type, strlen ("image/"))) &&
+         (pos->format == EXTRACTOR_METAFORMAT_BINARY))
+       {
+         if (match == NULL)
+           match = pos;
+         else if ((match->type != EXTRACTOR_METATYPE_THUMBNAIL) &&
+                  (pos->type == EXTRACTOR_METATYPE_THUMBNAIL))
+           match = pos;
+       }
+      pos = pos->next;
     }
-    pos = pos->next;
-  }
   if ((match == NULL) || (match->data_size == 0))
     return 0;
   *thumb = GNUNET_malloc (match->data_size);
@@ -593,7 +597,7 @@
  */
 struct GNUNET_CONTAINER_MetaData *
 GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData
-                                      *md)
+                                     *md)
 {
   struct GNUNET_CONTAINER_MetaData *ret;
   struct MetaItem *pos;
@@ -603,12 +607,12 @@
   ret = GNUNET_CONTAINER_meta_data_create ();
   pos = md->items;
   while (NULL != pos)
-  {
-    GNUNET_CONTAINER_meta_data_insert (ret, pos->plugin_name, pos->type,
-                                       pos->format, pos->mime_type, pos->data,
-                                       pos->data_size);
-    pos = pos->next;
-  }
+    {
+      GNUNET_CONTAINER_meta_data_insert (ret, pos->plugin_name, pos->type,
+                                        pos->format, pos->mime_type,
+                                        pos->data, pos->data_size);
+      pos = pos->next;
+    }
   return ret;
 }
 
@@ -629,7 +633,7 @@
  */
 static int
 try_compression (const char *data, size_t oldSize, char **result,
-                 size_t * newSize)
+                size_t * newSize)
 {
   char *tmp;
   uLongf dlen;
@@ -644,14 +648,14 @@
   tmp = GNUNET_malloc (dlen);
   if (Z_OK ==
       compress2 ((Bytef *) tmp, &dlen, (const Bytef *) data, oldSize, 9))
-  {
-    if (dlen < oldSize)
     {
-      *result = tmp;
-      *newSize = dlen;
-      return GNUNET_YES;
+      if (dlen < oldSize)
+       {
+         *result = tmp;
+         *newSize = dlen;
+         return GNUNET_YES;
+       }
     }
-  }
   GNUNET_free (tmp);
   return GNUNET_NO;
 }
@@ -752,10 +756,10 @@
  */
 ssize_t
 GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
-                                      *md, char **target, size_t max,
-                                      enum
-                                      
GNUNET_CONTAINER_MetaDataSerializationOptions
-                                      opt)
+                                     *md, char **target, size_t max,
+                                     enum
+                                     
GNUNET_CONTAINER_MetaDataSerializationOptions
+                                     opt)
 {
   struct GNUNET_CONTAINER_MetaData *vmd;
   struct MetaItem *pos;
@@ -777,79 +781,79 @@
   int comp;
 
   if (max < sizeof (struct MetaDataHeader))
-    return GNUNET_SYSERR;       /* far too small */
+    return GNUNET_SYSERR;      /* far too small */
   if (md == NULL)
     return 0;
 
   if (md->sbuf != NULL)
-  {
-    /* try to use serialization cache */
-    if (md->sbuf_size <= max)
     {
-      if (NULL == *target)
-        *target = GNUNET_malloc (md->sbuf_size);
-      memcpy (*target, md->sbuf, md->sbuf_size);
-      return md->sbuf_size;
+      /* try to use serialization cache */
+      if (md->sbuf_size <= max)
+       {
+         if (NULL == *target)
+           *target = GNUNET_malloc (md->sbuf_size);
+         memcpy (*target, md->sbuf, md->sbuf_size);
+         return md->sbuf_size;
+       }
+      if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART))
+       return GNUNET_SYSERR;   /* can say that this will fail */
+      /* need to compute a partial serialization, sbuf useless ... */
     }
-    if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART))
-      return GNUNET_SYSERR;     /* can say that this will fail */
-    /* need to compute a partial serialization, sbuf useless ... */
-  }
   dst = NULL;
   msize = 0;
   pos = md->items;
   while (NULL != pos)
-  {
-    msize += sizeof (struct MetaDataEntry);
-    msize += pos->data_size;
-    if (pos->plugin_name != NULL)
-      msize += strlen (pos->plugin_name) + 1;
-    if (pos->mime_type != NULL)
-      msize += strlen (pos->mime_type) + 1;
-    pos = pos->next;
-  }
+    {
+      msize += sizeof (struct MetaDataEntry);
+      msize += pos->data_size;
+      if (pos->plugin_name != NULL)
+       msize += strlen (pos->plugin_name) + 1;
+      if (pos->mime_type != NULL)
+       msize += strlen (pos->mime_type) + 1;
+      pos = pos->next;
+    }
   size = (size_t) msize;
   if (size != msize)
-  {
-    GNUNET_break (0);           /* integer overflow */
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_break (0);                /* integer overflow */
+      return GNUNET_SYSERR;
+    }
   if (size >= GNUNET_MAX_MALLOC_CHECKED)
-  {
-    /* too large to be processed */
-    return GNUNET_SYSERR;
-  }
+    {
+      /* too large to be processed */
+      return GNUNET_SYSERR;
+    }
   ent = GNUNET_malloc (size);
   mdata = (char *) &ent[md->item_count];
   off = size - (md->item_count * sizeof (struct MetaDataEntry));
   i = 0;
   pos = md->items;
   while (NULL != pos)
-  {
-    ent[i].type = htonl ((uint32_t) pos->type);
-    ent[i].format = htonl ((uint32_t) pos->format);
-    ent[i].data_size = htonl ((uint32_t) pos->data_size);
-    if (pos->plugin_name == NULL)
-      plen = 0;
-    else
-      plen = strlen (pos->plugin_name) + 1;
-    ent[i].plugin_name_len = htonl ((uint32_t) plen);
-    if (pos->mime_type == NULL)
-      mlen = 0;
-    else
-      mlen = strlen (pos->mime_type) + 1;
-    ent[i].mime_type_len = htonl ((uint32_t) mlen);
-    off -= pos->data_size;
-    memcpy (&mdata[off], pos->data, pos->data_size);
-    off -= plen;
-    if (pos->plugin_name != NULL)
-      memcpy (&mdata[off], pos->plugin_name, plen);
-    off -= mlen;
-    if (pos->mime_type != NULL)
-      memcpy (&mdata[off], pos->mime_type, mlen);
-    i++;
-    pos = pos->next;
-  }
+    {
+      ent[i].type = htonl ((uint32_t) pos->type);
+      ent[i].format = htonl ((uint32_t) pos->format);
+      ent[i].data_size = htonl ((uint32_t) pos->data_size);
+      if (pos->plugin_name == NULL)
+       plen = 0;
+      else
+       plen = strlen (pos->plugin_name) + 1;
+      ent[i].plugin_name_len = htonl ((uint32_t) plen);
+      if (pos->mime_type == NULL)
+       mlen = 0;
+      else
+       mlen = strlen (pos->mime_type) + 1;
+      ent[i].mime_type_len = htonl ((uint32_t) mlen);
+      off -= pos->data_size;
+      memcpy (&mdata[off], pos->data, pos->data_size);
+      off -= plen;
+      if (pos->plugin_name != NULL)
+       memcpy (&mdata[off], pos->plugin_name, plen);
+      off -= mlen;
+      if (pos->mime_type != NULL)
+       memcpy (&mdata[off], pos->mime_type, mlen);
+      i++;
+      pos = pos->next;
+    }
   GNUNET_assert (off == 0);
 
   clen = 0;
@@ -858,95 +862,95 @@
   i = 0;
   pos = md->items;
   while (pos != NULL)
-  {
-    comp = GNUNET_NO;
-    if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS))
-      comp = try_compression ((const char *) &ent[i], left, &cdata, &clen);
-
-    if ((md->sbuf == NULL) && (i == 0))
     {
-      /* fill 'sbuf'; this "modifies" md, but since this is only
-       * an internal cache we will cast away the 'const' instead
-       * of making the API look strange. */
-      vmd = (struct GNUNET_CONTAINER_MetaData *) md;
-      hdr = GNUNET_malloc (left + sizeof (struct MetaDataHeader));
-      hdr->size = htonl (left);
-      hdr->entries = htonl (md->item_count);
-      if (GNUNET_YES == comp)
-      {
-        GNUNET_assert (clen < left);
-        hdr->version = htonl (2 | HEADER_COMPRESSED);
-        memcpy (&hdr[1], cdata, clen);
-        vmd->sbuf_size = clen + sizeof (struct MetaDataHeader);
-      }
-      else
-      {
-        hdr->version = htonl (2);
-        memcpy (&hdr[1], &ent[0], left);
-        vmd->sbuf_size = left + sizeof (struct MetaDataHeader);
-      }
-      vmd->sbuf = (char *) hdr;
-    }
+      comp = GNUNET_NO;
+      if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS))
+       comp = try_compression ((const char *) &ent[i], left, &cdata, &clen);
 
-    if (((left + sizeof (struct MetaDataHeader)) <= max) ||
-        ((comp == GNUNET_YES) && (clen <= max)))
-    {
-      /* success, this now fits! */
-      if (GNUNET_YES == comp)
-      {
-        if (dst == NULL)
-          dst = GNUNET_malloc (clen + sizeof (struct MetaDataHeader));
-        hdr = (struct MetaDataHeader *) dst;
-        hdr->version = htonl (2 | HEADER_COMPRESSED);
-        hdr->size = htonl (left);
-        hdr->entries = htonl (md->item_count - i);
-        memcpy (&dst[sizeof (struct MetaDataHeader)], cdata, clen);
-        GNUNET_free (cdata);
-        GNUNET_free (ent);
-        rlen = clen + sizeof (struct MetaDataHeader);
-      }
-      else
-      {
-        if (dst == NULL)
-          dst = GNUNET_malloc (left + sizeof (struct MetaDataHeader));
-        hdr = (struct MetaDataHeader *) dst;
-        hdr->version = htonl (2);
-        hdr->entries = htonl (md->item_count - i);
-        hdr->size = htonl (left);
-        memcpy (&dst[sizeof (struct MetaDataHeader)], &ent[i], left);
-        GNUNET_free (ent);
-        rlen = left + sizeof (struct MetaDataHeader);
-      }
-      if (NULL != *target)
-      {
-        memcpy (*target, dst, clen + sizeof (struct MetaDataHeader));
-        GNUNET_free (dst);
-      }
-      else
-      {
-        *target = dst;
-      }
-      return rlen;
-    }
+      if ((md->sbuf == NULL) && (i == 0))
+       {
+         /* fill 'sbuf'; this "modifies" md, but since this is only
+          * an internal cache we will cast away the 'const' instead
+          * of making the API look strange. */
+         vmd = (struct GNUNET_CONTAINER_MetaData *) md;
+         hdr = GNUNET_malloc (left + sizeof (struct MetaDataHeader));
+         hdr->size = htonl (left);
+         hdr->entries = htonl (md->item_count);
+         if (GNUNET_YES == comp)
+           {
+             GNUNET_assert (clen < left);
+             hdr->version = htonl (2 | HEADER_COMPRESSED);
+             memcpy (&hdr[1], cdata, clen);
+             vmd->sbuf_size = clen + sizeof (struct MetaDataHeader);
+           }
+         else
+           {
+             hdr->version = htonl (2);
+             memcpy (&hdr[1], &ent[0], left);
+             vmd->sbuf_size = left + sizeof (struct MetaDataHeader);
+           }
+         vmd->sbuf = (char *) hdr;
+       }
 
-    if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART))
-    {
-      /* does not fit! */
-      GNUNET_free (ent);
-      return GNUNET_SYSERR;
+      if (((left + sizeof (struct MetaDataHeader)) <= max) ||
+         ((comp == GNUNET_YES) && (clen <= max)))
+       {
+         /* success, this now fits! */
+         if (GNUNET_YES == comp)
+           {
+             if (dst == NULL)
+               dst = GNUNET_malloc (clen + sizeof (struct MetaDataHeader));
+             hdr = (struct MetaDataHeader *) dst;
+             hdr->version = htonl (2 | HEADER_COMPRESSED);
+             hdr->size = htonl (left);
+             hdr->entries = htonl (md->item_count - i);
+             memcpy (&dst[sizeof (struct MetaDataHeader)], cdata, clen);
+             GNUNET_free (cdata);
+             GNUNET_free (ent);
+             rlen = clen + sizeof (struct MetaDataHeader);
+           }
+         else
+           {
+             if (dst == NULL)
+               dst = GNUNET_malloc (left + sizeof (struct MetaDataHeader));
+             hdr = (struct MetaDataHeader *) dst;
+             hdr->version = htonl (2);
+             hdr->entries = htonl (md->item_count - i);
+             hdr->size = htonl (left);
+             memcpy (&dst[sizeof (struct MetaDataHeader)], &ent[i], left);
+             GNUNET_free (ent);
+             rlen = left + sizeof (struct MetaDataHeader);
+           }
+         if (NULL != *target)
+           {
+             memcpy (*target, dst, clen + sizeof (struct MetaDataHeader));
+             GNUNET_free (dst);
+           }
+         else
+           {
+             *target = dst;
+           }
+         return rlen;
+       }
+
+      if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART))
+       {
+         /* does not fit! */
+         GNUNET_free (ent);
+         return GNUNET_SYSERR;
+       }
+
+      /* next iteration: ignore the corresponding meta data at the
+       * end and try again without it */
+      left -= sizeof (struct MetaDataEntry);
+      left -= pos->data_size;
+      if (pos->plugin_name != NULL)
+       left -= strlen (pos->plugin_name) + 1;
+      if (pos->mime_type != NULL)
+       left -= strlen (pos->mime_type) + 1;
+      pos = pos->next;
+      i++;
     }
-
-    /* next iteration: ignore the corresponding meta data at the
-     * end and try again without it */
-    left -= sizeof (struct MetaDataEntry);
-    left -= pos->data_size;
-    if (pos->plugin_name != NULL)
-      left -= strlen (pos->plugin_name) + 1;
-    if (pos->mime_type != NULL)
-      left -= strlen (pos->mime_type) + 1;
-    pos = pos->next;
-    i++;
-  }
   GNUNET_free (ent);
 
   /* nothing fit, only write header! */
@@ -968,7 +972,7 @@
  */
 ssize_t
 GNUNET_CONTAINER_meta_data_get_serialized_size (const struct
-                                                GNUNET_CONTAINER_MetaData *md)
+                                               GNUNET_CONTAINER_MetaData *md)
 {
   ssize_t ret;
   char *ptr;
@@ -977,8 +981,8 @@
     return md->sbuf_size;
   ptr = NULL;
   ret =
-      GNUNET_CONTAINER_meta_data_serialize (md, &ptr, 
GNUNET_MAX_MALLOC_CHECKED,
-                                            
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL);
+    GNUNET_CONTAINER_meta_data_serialize (md, &ptr, GNUNET_MAX_MALLOC_CHECKED,
+                                         
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL);
   if (ret != -1)
     GNUNET_free (ptr);
   return ret;
@@ -1005,14 +1009,14 @@
   output = GNUNET_malloc (olen);
   if (Z_OK ==
       uncompress ((Bytef *) output, &olen, (const Bytef *) input, inputSize))
-  {
-    return output;
-  }
+    {
+      return output;
+    }
   else
-  {
-    GNUNET_free (output);
-    return NULL;
-  }
+    {
+      GNUNET_free (output);
+      return NULL;
+    }
 }
 
 
@@ -1054,121 +1058,121 @@
   compressed = (ntohl (hdr.version) & HEADER_COMPRESSED) != 0;
 
   if (version == 1)
-    return NULL;                /* null pointer */
+    return NULL;               /* null pointer */
   if (version != 2)
-  {
-    GNUNET_break_op (0);        /* unsupported version */
-    return NULL;
-  }
+    {
+      GNUNET_break_op (0);     /* unsupported version */
+      return NULL;
+    }
 
   ic = ntohl (hdr.entries);
   dataSize = ntohl (hdr.size);
   if ((sizeof (struct MetaDataEntry) * ic) > dataSize)
-  {
-    GNUNET_break_op (0);
-    return NULL;
-  }
-
-  if (compressed)
-  {
-    if (dataSize >= GNUNET_MAX_MALLOC_CHECKED)
     {
-      /* make sure we don't blow our memory limit because of a mal-formed
-       * message... */
       GNUNET_break_op (0);
       return NULL;
     }
-    data =
-        decompress ((const char *) &input[sizeof (struct MetaDataHeader)],
-                    size - sizeof (struct MetaDataHeader), dataSize);
-    if (data == NULL)
+
+  if (compressed)
     {
-      GNUNET_break_op (0);
-      return NULL;
+      if (dataSize >= GNUNET_MAX_MALLOC_CHECKED)
+       {
+         /* make sure we don't blow our memory limit because of a mal-formed
+          * message... */
+         GNUNET_break_op (0);
+         return NULL;
+       }
+      data =
+       decompress ((const char *) &input[sizeof (struct MetaDataHeader)],
+                   size - sizeof (struct MetaDataHeader), dataSize);
+      if (data == NULL)
+       {
+         GNUNET_break_op (0);
+         return NULL;
+       }
+      cdata = data;
     }
-    cdata = data;
-  }
   else
-  {
-    data = NULL;
-    cdata = (const char *) &input[sizeof (struct MetaDataHeader)];
-    if (dataSize != size - sizeof (struct MetaDataHeader))
     {
-      GNUNET_break_op (0);
-      return NULL;
+      data = NULL;
+      cdata = (const char *) &input[sizeof (struct MetaDataHeader)];
+      if (dataSize != size - sizeof (struct MetaDataHeader))
+       {
+         GNUNET_break_op (0);
+         return NULL;
+       }
     }
-  }
 
   md = GNUNET_CONTAINER_meta_data_create ();
   left = dataSize - ic * sizeof (struct MetaDataEntry);
   mdata = &cdata[ic * sizeof (struct MetaDataEntry)];
   for (i = 0; i < ic; i++)
-  {
-    memcpy (&ent, &cdata[i * sizeof (struct MetaDataEntry)],
-            sizeof (struct MetaDataEntry));
-    format = (enum EXTRACTOR_MetaFormat) ntohl (ent.format);
-    if ((format != EXTRACTOR_METAFORMAT_UTF8) &&
-        (format != EXTRACTOR_METAFORMAT_C_STRING) &&
-        (format != EXTRACTOR_METAFORMAT_BINARY))
     {
-      GNUNET_break_op (0);
-      break;
-    }
-    dlen = ntohl (ent.data_size);
-    plen = ntohl (ent.plugin_name_len);
-    mlen = ntohl (ent.mime_type_len);
-    if (dlen > left)
-    {
-      GNUNET_break_op (0);
-      break;
-    }
-    left -= dlen;
-    meta_data = &mdata[left];
-    if ((format == EXTRACTOR_METAFORMAT_UTF8) ||
-        (format == EXTRACTOR_METAFORMAT_C_STRING))
-    {
-      if ((dlen == 0) || (mdata[left + dlen - 1] != '\0'))
-      {
-        GNUNET_break_op (0);
-        break;
-      }
-    }
-    if (plen > left)
-    {
-      GNUNET_break_op (0);
-      break;
-    }
-    left -= plen;
-    if ((plen > 0) && (mdata[left + plen - 1] != '\0'))
-    {
-      GNUNET_break_op (0);
-      break;
-    }
-    if (plen == 0)
-      plugin_name = NULL;
-    else
-      plugin_name = &mdata[left];
+      memcpy (&ent, &cdata[i * sizeof (struct MetaDataEntry)],
+             sizeof (struct MetaDataEntry));
+      format = (enum EXTRACTOR_MetaFormat) ntohl (ent.format);
+      if ((format != EXTRACTOR_METAFORMAT_UTF8) &&
+         (format != EXTRACTOR_METAFORMAT_C_STRING) &&
+         (format != EXTRACTOR_METAFORMAT_BINARY))
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      dlen = ntohl (ent.data_size);
+      plen = ntohl (ent.plugin_name_len);
+      mlen = ntohl (ent.mime_type_len);
+      if (dlen > left)
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      left -= dlen;
+      meta_data = &mdata[left];
+      if ((format == EXTRACTOR_METAFORMAT_UTF8) ||
+         (format == EXTRACTOR_METAFORMAT_C_STRING))
+       {
+         if ((dlen == 0) || (mdata[left + dlen - 1] != '\0'))
+           {
+             GNUNET_break_op (0);
+             break;
+           }
+       }
+      if (plen > left)
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      left -= plen;
+      if ((plen > 0) && (mdata[left + plen - 1] != '\0'))
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      if (plen == 0)
+       plugin_name = NULL;
+      else
+       plugin_name = &mdata[left];
 
-    if (mlen > left)
-    {
-      GNUNET_break_op (0);
-      break;
+      if (mlen > left)
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      left -= mlen;
+      if ((mlen > 0) && (mdata[left + mlen - 1] != '\0'))
+       {
+         GNUNET_break_op (0);
+         break;
+       }
+      if (mlen == 0)
+       mime_type = NULL;
+      else
+       mime_type = &mdata[left];
+      GNUNET_CONTAINER_meta_data_insert (md, plugin_name,
+                                        (enum EXTRACTOR_MetaType)
+                                        ntohl (ent.type), format, mime_type,
+                                        meta_data, dlen);
     }
-    left -= mlen;
-    if ((mlen > 0) && (mdata[left + mlen - 1] != '\0'))
-    {
-      GNUNET_break_op (0);
-      break;
-    }
-    if (mlen == 0)
-      mime_type = NULL;
-    else
-      mime_type = &mdata[left];
-    GNUNET_CONTAINER_meta_data_insert (md, plugin_name,
-                                       (enum EXTRACTOR_MetaType)
-                                       ntohl (ent.type), format, mime_type,
-                                       meta_data, dlen);
-  }
   GNUNET_free_non_null (data);
   return md;
 }

Modified: gnunet/src/util/container_multihashmap.c
===================================================================
--- gnunet/src/util/container_multihashmap.c    2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/container_multihashmap.c    2011-10-11 09:43:04 UTC (rev 
17362)
@@ -28,6 +28,8 @@
 #include "gnunet_container_lib.h"
 #include "gnunet_crypto_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * An entry in the hash map.
  */
@@ -101,19 +103,19 @@
  */
 void
 GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap
-                                       *map)
+                                      *map)
 {
   unsigned int i;
   struct MapEntry *e;
 
   for (i = 0; i < map->map_length; i++)
-  {
-    while (NULL != (e = map->map[i]))
     {
-      map->map[i] = e->next;
-      GNUNET_free (e);
+      while (NULL != (e = map->map[i]))
+       {
+         map->map[i] = e->next;
+         GNUNET_free (e);
+       }
     }
-  }
   GNUNET_free (map->map);
   GNUNET_free (map);
 }
@@ -128,7 +130,7 @@
  */
 static unsigned int
 idx_of (const struct GNUNET_CONTAINER_MultiHashMap *m,
-        const GNUNET_HashCode * key)
+       const GNUNET_HashCode * key)
 {
   GNUNET_assert (m != NULL);
   return (*(unsigned int *) key) % m->map_length;
@@ -143,7 +145,7 @@
  */
 unsigned int
 GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap
-                                    *map)
+                                   *map)
 {
   return map->size;
 }
@@ -161,17 +163,17 @@
  */
 void *
 GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap
-                                   *map, const GNUNET_HashCode * key)
+                                  *map, const GNUNET_HashCode * key)
 {
   struct MapEntry *e;
 
   e = map->map[idx_of (map, key)];
   while (e != NULL)
-  {
-    if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
-      return e->value;
-    e = e->next;
-  }
+    {
+      if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+       return e->value;
+      e = e->next;
+    }
   return NULL;
 }
 
@@ -187,9 +189,9 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_iterate (const struct
-                                       GNUNET_CONTAINER_MultiHashMap *map,
-                                       GNUNET_CONTAINER_HashMapIterator it,
-                                       void *it_cls)
+                                      GNUNET_CONTAINER_MultiHashMap *map,
+                                      GNUNET_CONTAINER_HashMapIterator it,
+                                      void *it_cls)
 {
   int count;
   unsigned int i;
@@ -200,20 +202,20 @@
   count = 0;
   GNUNET_assert (map != NULL);
   for (i = 0; i < map->map_length; i++)
-  {
-    n = map->map[i];
-    while (NULL != (e = n))
     {
-      n = e->next;
-      if (NULL != it)
-      {
-        kc = e->key;
-        if (GNUNET_OK != it (it_cls, &kc, e->value))
-          return GNUNET_SYSERR;
-      }
-      count++;
+      n = map->map[i];
+      while (NULL != (e = n))
+       {
+         n = e->next;
+         if (NULL != it)
+           {
+             kc = e->key;
+             if (GNUNET_OK != it (it_cls, &kc, e->value))
+               return GNUNET_SYSERR;
+           }
+         count++;
+       }
     }
-  }
   return count;
 }
 
@@ -230,8 +232,9 @@
  *  is not in the map
  */
 int
-GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap 
*map,
-                                      const GNUNET_HashCode * key, void *value)
+GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap
+                                     *map, const GNUNET_HashCode * key,
+                                     void *value)
 {
   struct MapEntry *e;
   struct MapEntry *p;
@@ -241,21 +244,21 @@
   p = NULL;
   e = map->map[i];
   while (e != NULL)
-  {
-    if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
-        (value == e->value))
     {
-      if (p == NULL)
-        map->map[i] = e->next;
-      else
-        p->next = e->next;
-      GNUNET_free (e);
-      map->size--;
-      return GNUNET_YES;
+      if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
+         (value == e->value))
+       {
+         if (p == NULL)
+           map->map[i] = e->next;
+         else
+           p->next = e->next;
+         GNUNET_free (e);
+         map->size--;
+         return GNUNET_YES;
+       }
+      p = e;
+      e = e->next;
     }
-    p = e;
-    e = e->next;
-  }
   return GNUNET_NO;
 }
 
@@ -270,7 +273,7 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap
-                                          *map, const GNUNET_HashCode * key)
+                                         *map, const GNUNET_HashCode * key)
 {
   struct MapEntry *e;
   struct MapEntry *p;
@@ -282,27 +285,27 @@
   p = NULL;
   e = map->map[i];
   while (e != NULL)
-  {
-    if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
     {
-      if (p == NULL)
-        map->map[i] = e->next;
+      if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+       {
+         if (p == NULL)
+           map->map[i] = e->next;
+         else
+           p->next = e->next;
+         GNUNET_free (e);
+         map->size--;
+         if (p == NULL)
+           e = map->map[i];
+         else
+           e = p->next;
+         ret++;
+       }
       else
-        p->next = e->next;
-      GNUNET_free (e);
-      map->size--;
-      if (p == NULL)
-        e = map->map[i];
-      else
-        e = p->next;
-      ret++;
+       {
+         p = e;
+         e = e->next;
+       }
     }
-    else
-    {
-      p = e;
-      e = e->next;
-    }
-  }
   return ret;
 }
 
@@ -318,18 +321,18 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_contains (const struct
-                                        GNUNET_CONTAINER_MultiHashMap *map,
-                                        const GNUNET_HashCode * key)
+                                       GNUNET_CONTAINER_MultiHashMap *map,
+                                       const GNUNET_HashCode * key)
 {
   struct MapEntry *e;
 
   e = map->map[idx_of (map, key)];
   while (e != NULL)
-  {
-    if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
-      return GNUNET_YES;
-    e = e->next;
-  }
+    {
+      if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+       return GNUNET_YES;
+      e = e->next;
+    }
   return GNUNET_NO;
 }
 
@@ -346,20 +349,21 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_contains_value (const struct
-                                              GNUNET_CONTAINER_MultiHashMap
-                                              *map, const GNUNET_HashCode * 
key,
-                                              const void *value)
+                                             GNUNET_CONTAINER_MultiHashMap
+                                             *map,
+                                             const GNUNET_HashCode * key,
+                                             const void *value)
 {
   struct MapEntry *e;
 
   e = map->map[idx_of (map, key)];
   while (e != NULL)
-  {
-    if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
-        (e->value == value))
-      return GNUNET_YES;
-    e = e->next;
-  }
+    {
+      if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
+         (e->value == value))
+       return GNUNET_YES;
+      e = e->next;
+    }
   return GNUNET_NO;
 }
 
@@ -387,15 +391,15 @@
   map->map_length = new_len;
   map->map = new_map;
   for (i = 0; i < old_len; i++)
-  {
-    while (NULL != (e = old_map[i]))
     {
-      old_map[i] = e->next;
-      idx = idx_of (map, &e->key);
-      e->next = new_map[idx];
-      new_map[idx] = e;
+      while (NULL != (e = old_map[i]))
+       {
+         old_map[i] = e->next;
+         idx = idx_of (map, &e->key);
+         e->next = new_map[idx];
+         new_map[idx] = e;
+       }
     }
-  }
   GNUNET_free (old_map);
 }
 
@@ -414,8 +418,9 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map,
-                                   const GNUNET_HashCode * key, void *value,
-                                   enum GNUNET_CONTAINER_MultiHashMapOption 
opt)
+                                  const GNUNET_HashCode * key, void *value,
+                                  enum GNUNET_CONTAINER_MultiHashMapOption
+                                  opt)
 {
   struct MapEntry *e;
   unsigned int i;
@@ -423,25 +428,25 @@
   i = idx_of (map, key);
   if ((opt != GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE) &&
       (opt != GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
-  {
-    e = map->map[i];
-    while (e != NULL)
     {
-      if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
-      {
-        if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
-          return GNUNET_SYSERR;
-        e->value = value;
-        return GNUNET_NO;
-      }
-      e = e->next;
+      e = map->map[i];
+      while (e != NULL)
+       {
+         if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+           {
+             if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
+               return GNUNET_SYSERR;
+             e->value = value;
+             return GNUNET_NO;
+           }
+         e = e->next;
+       }
     }
-  }
   if (map->size / 3 >= map->map_length / 4)
-  {
-    grow (map);
-    i = idx_of (map, key);
-  }
+    {
+      grow (map);
+      i = idx_of (map, key);
+    }
   e = GNUNET_malloc (sizeof (struct MapEntry));
   e->key = *key;
   e->value = value;
@@ -464,10 +469,10 @@
  */
 int
 GNUNET_CONTAINER_multihashmap_get_multiple (const struct
-                                            GNUNET_CONTAINER_MultiHashMap *map,
-                                            const GNUNET_HashCode * key,
-                                            GNUNET_CONTAINER_HashMapIterator 
it,
-                                            void *it_cls)
+                                           GNUNET_CONTAINER_MultiHashMap
+                                           *map, const GNUNET_HashCode * key,
+                                           GNUNET_CONTAINER_HashMapIterator
+                                           it, void *it_cls)
 {
   int count;
   struct MapEntry *e;
@@ -476,14 +481,14 @@
   count = 0;
   n = map->map[idx_of (map, key)];
   while (NULL != (e = n))
-  {
-    n = e->next;
-    if (0 != memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
-      continue;
-    if ((it != NULL) && (GNUNET_OK != it (it_cls, key, e->value)))
-      return GNUNET_SYSERR;
-    count++;
-  }
+    {
+      n = e->next;
+      if (0 != memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+       continue;
+      if ((it != NULL) && (GNUNET_OK != it (it_cls, key, e->value)))
+       return GNUNET_SYSERR;
+      count++;
+    }
   return count;
 }
 

Modified: gnunet/src/util/container_slist.c
===================================================================
--- gnunet/src/util/container_slist.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/container_slist.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -27,6 +27,8 @@
 #include "platform.h"
 #include "gnunet_container_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Element in our linked list.
  */
@@ -108,21 +110,21 @@
  */
 static struct GNUNET_CONTAINER_SList_Elem *
 create_elem (enum GNUNET_CONTAINER_SListDisposition disp, const void *buf,
-             size_t len)
+            size_t len)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
   if (disp == GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT)
-  {
-    e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem) + len);
-    memcpy (&e[1], buf, len);
-    e->elem = (void *) &e[1];
-  }
+    {
+      e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem) + len);
+      memcpy (&e[1], buf, len);
+      e->elem = (void *) &e[1];
+    }
   else
-  {
-    e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem));
-    e->elem = (void *) buf;
-  }
+    {
+      e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem));
+      e->elem = (void *) buf;
+    }
   e->disp = disp;
   e->len = len;
   return e;
@@ -138,8 +140,8 @@
  */
 void
 GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l,
-                            enum GNUNET_CONTAINER_SListDisposition disp,
-                            const void *buf, size_t len)
+                           enum GNUNET_CONTAINER_SListDisposition disp,
+                           const void *buf, size_t len)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
@@ -160,8 +162,8 @@
  */
 void
 GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l,
-                                enum GNUNET_CONTAINER_SListDisposition disp,
-                                const void *buf, size_t len)
+                               enum GNUNET_CONTAINER_SListDisposition disp,
+                               const void *buf, size_t len)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
@@ -182,7 +184,7 @@
  */
 void
 GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst,
-                               struct GNUNET_CONTAINER_SList *src)
+                              struct GNUNET_CONTAINER_SList *src)
 {
   struct GNUNET_CONTAINER_SList_Iterator *i;
 
@@ -190,14 +192,15 @@
        GNUNET_CONTAINER_slist_end (i) != GNUNET_YES;
        GNUNET_CONTAINER_slist_next (i))
 
-  {
-    GNUNET_CONTAINER_slist_add (dst,
-                                (i->elem->disp ==
-                                 GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC) ?
-                                GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC :
-                                GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                i->elem->elem, i->elem->len);
-  }
+    {
+      GNUNET_CONTAINER_slist_add (dst,
+                                 (i->elem->disp ==
+                                  GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC)
+                                 ? GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC
+                                 :
+                                 GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                 i->elem->elem, i->elem->len);
+    }
   GNUNET_CONTAINER_slist_iter_destroy (i);
 }
 
@@ -254,13 +257,13 @@
 
   e = l->head;
   while (e != NULL)
-  {
-    n = e->next;
-    if (e->disp == GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC)
-      GNUNET_free (e->elem);
-    GNUNET_free (e);
-    e = n;
-  }
+    {
+      n = e->next;
+      if (e->disp == GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC)
+       GNUNET_free (e->elem);
+      GNUNET_free (e);
+      e = n;
+    }
   l->head = NULL;
   l->tail = NULL;
   l->length = 0;
@@ -276,7 +279,7 @@
  */
 int
 GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
-                                 const void *buf, size_t len)
+                                const void *buf, size_t len)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
@@ -333,8 +336,8 @@
  */
 void
 GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator *before,
-                               enum GNUNET_CONTAINER_SListDisposition disp,
-                               const void *buf, size_t len)
+                              enum GNUNET_CONTAINER_SListDisposition disp,
+                              const void *buf, size_t len)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
@@ -387,7 +390,7 @@
  */
 void *
 GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i,
-                            size_t * len)
+                           size_t * len)
 {
   if (len)
     *len = i->elem->len;
@@ -399,7 +402,8 @@
  * @param i iterator
  */
 void
-GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator *i)
+GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator
+                                    *i)
 {
   GNUNET_free (i);
 }

Modified: gnunet/src/util/crypto_aes.c
===================================================================
--- gnunet/src/util/crypto_aes.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_aes.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -30,6 +30,8 @@
 #include "gnunet_crypto_lib.h"
 #include <gcrypt.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Create a new SessionKey (for AES-256).
  */
@@ -37,9 +39,9 @@
 GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key)
 {
   gcry_randomize (&key->key[0], GNUNET_CRYPTO_AES_KEY_LENGTH,
-                  GCRY_STRONG_RANDOM);
+                 GCRY_STRONG_RANDOM);
   key->crc32 =
-      htonl (GNUNET_CRYPTO_crc32_n (key, GNUNET_CRYPTO_AES_KEY_LENGTH));
+    htonl (GNUNET_CRYPTO_crc32_n (key, GNUNET_CRYPTO_AES_KEY_LENGTH));
 }
 
 /**
@@ -49,7 +51,7 @@
  */
 int
 GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey
-                                     *key)
+                                    *key)
 {
   uint32_t crc;
 
@@ -74,28 +76,29 @@
  */
 ssize_t
 GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len,
-                           const struct GNUNET_CRYPTO_AesSessionKey *
-                           sessionkey,
-                           const struct GNUNET_CRYPTO_AesInitializationVector *
-                           iv, void *result)
+                          const struct GNUNET_CRYPTO_AesSessionKey *
+                          sessionkey,
+                          const struct GNUNET_CRYPTO_AesInitializationVector
+                          * iv, void *result)
 {
   gcry_cipher_hd_t handle;
   int rc;
 
   if (sessionkey->crc32 !=
-      htonl (GNUNET_CRYPTO_crc32_n (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
-  {
-    GNUNET_break (0);
-    return -1;
-  }
+      htonl (GNUNET_CRYPTO_crc32_n
+            (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
+    {
+      GNUNET_break (0);
+      return -1;
+    }
   GNUNET_assert (0 ==
-                 gcry_cipher_open (&handle, GCRY_CIPHER_AES256,
-                                   GCRY_CIPHER_MODE_CFB, 0));
+                gcry_cipher_open (&handle, GCRY_CIPHER_AES256,
+                                  GCRY_CIPHER_MODE_CFB, 0));
   rc = gcry_cipher_setkey (handle, sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH);
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
   rc = gcry_cipher_setiv (handle, iv,
-                          sizeof (struct
-                                  GNUNET_CRYPTO_AesInitializationVector));
+                         sizeof (struct
+                                 GNUNET_CRYPTO_AesInitializationVector));
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
   GNUNET_assert (0 == gcry_cipher_encrypt (handle, result, len, block, len));
   gcry_cipher_close (handle);
@@ -115,30 +118,32 @@
  */
 ssize_t
 GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size,
-                           const struct GNUNET_CRYPTO_AesSessionKey *
-                           sessionkey,
-                           const struct GNUNET_CRYPTO_AesInitializationVector *
-                           iv, void *result)
+                          const struct GNUNET_CRYPTO_AesSessionKey *
+                          sessionkey,
+                          const struct GNUNET_CRYPTO_AesInitializationVector
+                          * iv, void *result)
 {
   gcry_cipher_hd_t handle;
   int rc;
 
   if (sessionkey->crc32 !=
-      htonl (GNUNET_CRYPTO_crc32_n (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
-  {
-    GNUNET_break (0);
-    return -1;
-  }
+      htonl (GNUNET_CRYPTO_crc32_n
+            (sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH)))
+    {
+      GNUNET_break (0);
+      return -1;
+    }
   GNUNET_assert (0 ==
-                 gcry_cipher_open (&handle, GCRY_CIPHER_AES256,
-                                   GCRY_CIPHER_MODE_CFB, 0));
+                gcry_cipher_open (&handle, GCRY_CIPHER_AES256,
+                                  GCRY_CIPHER_MODE_CFB, 0));
   rc = gcry_cipher_setkey (handle, sessionkey, GNUNET_CRYPTO_AES_KEY_LENGTH);
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
   rc = gcry_cipher_setiv (handle, iv,
-                          sizeof (struct
-                                  GNUNET_CRYPTO_AesInitializationVector));
+                         sizeof (struct
+                                 GNUNET_CRYPTO_AesInitializationVector));
   GNUNET_assert ((0 == rc) || ((char) rc == GPG_ERR_WEAK_KEY));
-  GNUNET_assert (0 == gcry_cipher_decrypt (handle, result, size, block, size));
+  GNUNET_assert (0 ==
+                gcry_cipher_decrypt (handle, result, size, block, size));
   gcry_cipher_close (handle);
   return size;
 }
@@ -153,8 +158,8 @@
  */
 void
 GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
-                             const struct GNUNET_CRYPTO_AesSessionKey *skey,
-                             const void *salt, size_t salt_len, ...)
+                            const struct GNUNET_CRYPTO_AesSessionKey *skey,
+                            const void *salt, size_t salt_len, ...)
 {
   va_list argp;
 
@@ -172,12 +177,14 @@
  * @param argp pairs of void * & size_t for context chunks, terminated by NULL
  */
 void
-GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector 
*iv,
-                               const struct GNUNET_CRYPTO_AesSessionKey *skey,
-                               const void *salt, size_t salt_len, va_list argp)
+GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector
+                              *iv,
+                              const struct GNUNET_CRYPTO_AesSessionKey *skey,
+                              const void *salt, size_t salt_len,
+                              va_list argp)
 {
   GNUNET_CRYPTO_kdf_v (iv->iv, sizeof (iv->iv), salt, salt_len, skey->key,
-                       sizeof (skey->key), argp);
+                      sizeof (skey->key), argp);
 }
 
 /* end of crypto_aes.c */

Modified: gnunet/src/util/crypto_crc.c
===================================================================
--- gnunet/src/util/crypto_crc.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_crc.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -32,6 +32,8 @@
 #include "gnunet_common.h"
 #include "gnunet_crypto_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /* Avoid wasting space on 8-byte longs. */
 #if UINT_MAX >= 0xffffffff
 typedef unsigned int uLong;
@@ -64,12 +66,12 @@
   once = 1;
   crc_table[0] = 0;
   for (i = 128; i; i >>= 1)
-  {
-    h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0);
-    /* h is now crc_table[i] */
-    for (j = 0; j < 256; j += 2 * i)
-      crc_table[i + j] = crc_table[j] ^ h;
-  }
+    {
+      h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0);
+      /* h is now crc_table[i] */
+      for (j = 0; j < 256; j += 2 * i)
+       crc_table[i + j] = crc_table[j] ^ h;
+    }
 }
 
 /*

Modified: gnunet/src/util/crypto_hash.c
===================================================================
--- gnunet/src/util/crypto_hash.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_hash.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -36,7 +36,10 @@
 #include "gnunet_disk_lib.h"
 #include <gcrypt.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 /**
  * Hash block of given size.
  *
@@ -116,14 +119,14 @@
  */
 static void
 file_hash_finish (struct GNUNET_CRYPTO_FileHashContext *fhc,
-                  const GNUNET_HashCode * res)
+                 const GNUNET_HashCode * res)
 {
   fhc->callback (fhc->callback_cls, res);
   GNUNET_free (fhc->filename);
   if (!GNUNET_DISK_handle_invalid (fhc->fh))
     GNUNET_break (GNUNET_OK == GNUNET_DISK_file_close (fhc->fh));
   gcry_md_close (fhc->md);
-  GNUNET_free (fhc);            /* also frees fhc->buffer */
+  GNUNET_free (fhc);           /* also frees fhc->buffer */
 }
 
 
@@ -146,19 +149,19 @@
   if (fhc->fsize - fhc->offset < delta)
     delta = fhc->fsize - fhc->offset;
   if (delta != GNUNET_DISK_file_read (fhc->fh, fhc->buffer, delta))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "read", 
fhc->filename);
-    file_hash_finish (fhc, NULL);
-    return;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "read", fhc->filename);
+      file_hash_finish (fhc, NULL);
+      return;
+    }
   gcry_md_write (fhc->md, fhc->buffer, delta);
   fhc->offset += delta;
   if (fhc->offset == fhc->fsize)
-  {
-    res = (GNUNET_HashCode *) gcry_md_read (fhc->md, GCRY_MD_SHA512);
-    file_hash_finish (fhc, res);
-    return;
-  }
+    {
+      res = (GNUNET_HashCode *) gcry_md_read (fhc->md, GCRY_MD_SHA512);
+      file_hash_finish (fhc, res);
+      return;
+    }
   fhc->task = GNUNET_SCHEDULER_add_now (&file_hash_task, fhc);
 }
 
@@ -175,43 +178,43 @@
  */
 struct GNUNET_CRYPTO_FileHashContext *
 GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority,
-                         const char *filename, size_t blocksize,
-                         GNUNET_CRYPTO_HashCompletedCallback callback,
-                         void *callback_cls)
+                        const char *filename, size_t blocksize,
+                        GNUNET_CRYPTO_HashCompletedCallback callback,
+                        void *callback_cls)
 {
   struct GNUNET_CRYPTO_FileHashContext *fhc;
 
   GNUNET_assert (blocksize > 0);
   fhc =
-      GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_FileHashContext) + 
blocksize);
+    GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_FileHashContext) + blocksize);
   fhc->callback = callback;
   fhc->callback_cls = callback_cls;
   fhc->buffer = (unsigned char *) &fhc[1];
   fhc->filename = GNUNET_strdup (filename);
   if (GPG_ERR_NO_ERROR != gcry_md_open (&fhc->md, GCRY_MD_SHA512, 0))
-  {
-    GNUNET_break (0);
-    GNUNET_free (fhc);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (fhc);
+      return NULL;
+    }
   fhc->bsize = blocksize;
   if (GNUNET_OK != GNUNET_DISK_file_size (filename, &fhc->fsize, GNUNET_NO))
-  {
-    GNUNET_free (fhc->filename);
-    GNUNET_free (fhc);
-    return NULL;
-  }
+    {
+      GNUNET_free (fhc->filename);
+      GNUNET_free (fhc);
+      return NULL;
+    }
   fhc->fh =
-      GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ,
-                             GNUNET_DISK_PERM_NONE);
+    GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ,
+                          GNUNET_DISK_PERM_NONE);
   if (!fhc->fh)
-  {
-    GNUNET_free (fhc->filename);
-    GNUNET_free (fhc);
-    return NULL;
-  }
+    {
+      GNUNET_free (fhc->filename);
+      GNUNET_free (fhc);
+      return NULL;
+    }
   fhc->task =
-      GNUNET_SCHEDULER_add_with_priority (priority, &file_hash_task, fhc);
+    GNUNET_SCHEDULER_add_with_priority (priority, &file_hash_task, fhc);
   return fhc;
 }
 
@@ -257,7 +260,7 @@
  */
 void
 GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
-                           struct GNUNET_CRYPTO_HashAsciiEncoded *result)
+                          struct GNUNET_CRYPTO_HashAsciiEncoded *result)
 {
   /**
    * 32 characters for encoding (GNUNET_CRYPTO_hash => 32 characters)
@@ -275,22 +278,23 @@
   rpos = 0;
   bits = 0;
   while ((rpos < sizeof (GNUNET_HashCode)) || (vbit > 0))
-  {
-    if ((rpos < sizeof (GNUNET_HashCode)) && (vbit < 5))
     {
-      bits = (bits << 8) | ((unsigned char *) block)[rpos++];   /* eat 8 more 
bits */
-      vbit += 8;
+      if ((rpos < sizeof (GNUNET_HashCode)) && (vbit < 5))
+       {
+         bits = (bits << 8) | ((unsigned char *) block)[rpos++];       /* eat 
8 more bits */
+         vbit += 8;
+       }
+      if (vbit < 5)
+       {
+         bits <<= (5 - vbit);  /* zero-padding */
+         GNUNET_assert (vbit == 2);    /* padding by 3: 512+3 mod 5 == 0 */
+         vbit = 5;
+       }
+      GNUNET_assert (wpos <
+                    sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1);
+      result->encoding[wpos++] = encTable__[(bits >> (vbit - 5)) & 31];
+      vbit -= 5;
     }
-    if (vbit < 5)
-    {
-      bits <<= (5 - vbit);      /* zero-padding */
-      GNUNET_assert (vbit == 2);        /* padding by 3: 512+3 mod 5 == 0 */
-      vbit = 5;
-    }
-    GNUNET_assert (wpos < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1);
-    result->encoding[wpos++] = encTable__[(bits >> (vbit - 5)) & 31];
-    vbit -= 5;
-  }
   GNUNET_assert (wpos == sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1);
   GNUNET_assert (vbit == 0);
   result->encoding[wpos] = '\0';
@@ -314,22 +318,22 @@
   if (strlen (enc) != sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1)
     return GNUNET_SYSERR;
 
-  vbit = 2;                     /* padding! */
+  vbit = 2;                    /* padding! */
   wpos = sizeof (GNUNET_HashCode);
   rpos = sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1;
   bits = getValue__ (enc[--rpos]) >> 3;
   while (wpos > 0)
-  {
-    GNUNET_assert (rpos > 0);
-    bits = (getValue__ (enc[--rpos]) << vbit) | bits;
-    vbit += 5;
-    if (vbit >= 8)
     {
-      ((unsigned char *) result)[--wpos] = (unsigned char) bits;
-      bits >>= 8;
-      vbit -= 8;
+      GNUNET_assert (rpos > 0);
+      bits = (getValue__ (enc[--rpos]) << vbit) | bits;
+      vbit += 5;
+      if (vbit >= 8)
+       {
+         ((unsigned char *) result)[--wpos] = (unsigned char) bits;
+         bits >>= 8;
+         vbit -= 8;
+       }
     }
-  }
   GNUNET_assert (rpos == 0);
   GNUNET_assert (vbit == 0);
   return GNUNET_OK;
@@ -348,7 +352,7 @@
  */
 unsigned int
 GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a,
-                                 const GNUNET_HashCode * b)
+                                const GNUNET_HashCode * b)
 {
   unsigned int x1 = (a->bits[1] - b->bits[1]) >> 16;
   unsigned int x2 = (b->bits[1] - a->bits[1]) >> 16;
@@ -358,7 +362,7 @@
 
 void
 GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
-                                  GNUNET_HashCode * result)
+                                 GNUNET_HashCode * result)
 {
   int i;
 
@@ -368,33 +372,37 @@
 
 void
 GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a,
-                               const GNUNET_HashCode * b,
-                               GNUNET_HashCode * result)
+                              const GNUNET_HashCode * b,
+                              GNUNET_HashCode * result)
 {
   int i;
 
-  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0; i--)
+  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0;
+       i--)
     result->bits[i] = b->bits[i] - a->bits[i];
 }
 
 void
 GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a,
-                        const GNUNET_HashCode * delta, GNUNET_HashCode * 
result)
+                       const GNUNET_HashCode * delta,
+                       GNUNET_HashCode * result)
 {
   int i;
 
-  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0; i--)
+  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0;
+       i--)
     result->bits[i] = delta->bits[i] + a->bits[i];
 }
 
 
 void
 GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b,
-                        GNUNET_HashCode * result)
+                       GNUNET_HashCode * result)
 {
   int i;
 
-  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0; i--)
+  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0;
+       i--)
     result->bits[i] = a->bits[i] ^ b->bits[i];
 }
 
@@ -404,17 +412,18 @@
  */
 void
 GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc,
-                               struct GNUNET_CRYPTO_AesSessionKey *skey,
-                               struct GNUNET_CRYPTO_AesInitializationVector 
*iv)
+                              struct GNUNET_CRYPTO_AesSessionKey *skey,
+                              struct GNUNET_CRYPTO_AesInitializationVector
+                              *iv)
 {
   GNUNET_assert (sizeof (GNUNET_HashCode) >=
-                 GNUNET_CRYPTO_AES_KEY_LENGTH +
-                 sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
+                GNUNET_CRYPTO_AES_KEY_LENGTH +
+                sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
   memcpy (skey, hc, GNUNET_CRYPTO_AES_KEY_LENGTH);
   skey->crc32 =
-      htonl (GNUNET_CRYPTO_crc32_n (skey, GNUNET_CRYPTO_AES_KEY_LENGTH));
+    htonl (GNUNET_CRYPTO_crc32_n (skey, GNUNET_CRYPTO_AES_KEY_LENGTH));
   memcpy (iv, &((char *) hc)[GNUNET_CRYPTO_AES_KEY_LENGTH],
-          sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
+         sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
 }
 
 
@@ -445,13 +454,13 @@
  */
 unsigned int
 GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first,
-                                  const GNUNET_HashCode * second)
+                                 const GNUNET_HashCode * second)
 {
   unsigned int i;
 
   for (i = 0; i < sizeof (GNUNET_HashCode) * 8; i++)
     if (GNUNET_CRYPTO_hash_get_bit (first, i) !=
-        GNUNET_CRYPTO_hash_get_bit (second, i))
+       GNUNET_CRYPTO_hash_get_bit (second, i))
       return i;
   return sizeof (GNUNET_HashCode) * 8;
 }
@@ -463,7 +472,8 @@
  * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
  */
 int
-GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2)
+GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1,
+                       const GNUNET_HashCode * h2)
 {
   unsigned int *i1;
   unsigned int *i2;
@@ -471,13 +481,14 @@
 
   i1 = (unsigned int *) h1;
   i2 = (unsigned int *) h2;
-  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0; i--)
-  {
-    if (i1[i] > i2[i])
-      return 1;
-    if (i1[i] < i2[i])
-      return -1;
-  }
+  for (i = (sizeof (GNUNET_HashCode) / sizeof (unsigned int)) - 1; i >= 0;
+       i--)
+    {
+      if (i1[i] > i2[i])
+       return 1;
+      if (i1[i] < i2[i])
+       return -1;
+    }
   return 0;
 }
 
@@ -489,22 +500,22 @@
  */
 int
 GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1,
-                           const GNUNET_HashCode * h2,
-                           const GNUNET_HashCode * target)
+                          const GNUNET_HashCode * h2,
+                          const GNUNET_HashCode * target)
 {
   int i;
   unsigned int d1;
   unsigned int d2;
 
   for (i = sizeof (GNUNET_HashCode) / sizeof (unsigned int) - 1; i >= 0; i--)
-  {
-    d1 = ((unsigned int *) h1)[i] ^ ((unsigned int *) target)[i];
-    d2 = ((unsigned int *) h2)[i] ^ ((unsigned int *) target)[i];
-    if (d1 > d2)
-      return 1;
-    else if (d1 < d2)
-      return -1;
-  }
+    {
+      d1 = ((unsigned int *) h1)[i] ^ ((unsigned int *) target)[i];
+      d2 = ((unsigned int *) h2)[i] ^ ((unsigned int *) target)[i];
+      if (d1 > d2)
+       return 1;
+      else if (d1 < d2)
+       return -1;
+    }
   return 0;
 }
 
@@ -519,8 +530,8 @@
  */
 void
 GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
-                               const struct GNUNET_CRYPTO_AesSessionKey *rkey,
-                               const void *salt, size_t salt_len, ...)
+                              const struct GNUNET_CRYPTO_AesSessionKey *rkey,
+                              const void *salt, size_t salt_len, ...)
 {
   va_list argp;
 
@@ -540,12 +551,12 @@
  */
 void
 GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
-                                 const struct GNUNET_CRYPTO_AesSessionKey 
*rkey,
-                                 const void *salt, size_t salt_len,
-                                 va_list argp)
+                                const struct GNUNET_CRYPTO_AesSessionKey
+                                *rkey, const void *salt, size_t salt_len,
+                                va_list argp)
 {
   GNUNET_CRYPTO_kdf_v (key->key, sizeof (key->key), salt, salt_len, rkey->key,
-                       sizeof (rkey->key), argp);
+                      sizeof (rkey->key), argp);
 }
 
 
@@ -559,14 +570,14 @@
  */
 void
 GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
-                    const void *plaintext, size_t plaintext_len,
-                    GNUNET_HashCode * hmac)
+                   const void *plaintext, size_t plaintext_len,
+                   GNUNET_HashCode * hmac)
 {
   gcry_md_hd_t md;
   const unsigned char *mc;
 
   GNUNET_assert (GPG_ERR_NO_ERROR ==
-                 gcry_md_open (&md, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC));
+                gcry_md_open (&md, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC));
   gcry_md_setkey (md, key->key, sizeof (key->key));
   gcry_md_write (md, plaintext, plaintext_len);
   mc = gcry_md_read (md, GCRY_MD_SHA512);

Modified: gnunet/src/util/crypto_hkdf.c
===================================================================
--- gnunet/src/util/crypto_hkdf.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_hkdf.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -36,6 +36,8 @@
  * - Matthias Wachs (08.10.2010)
  */
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Set this to 0 if you compile this code outside of GNUnet.
  */
@@ -72,7 +74,7 @@
  */
 static const void *
 doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf,
-        size_t buf_len)
+       size_t buf_len)
 {
   gcry_md_setkey (mac, key, key_len);
   gcry_md_write (mac, buf, buf_len);
@@ -92,7 +94,7 @@
  */
 static int
 getPRK (gcry_md_hd_t mac, const void *xts, size_t xts_len, const void *skm,
-        size_t skm_len, void *prk)
+       size_t skm_len, void *prk)
 {
   const void *ret;
 
@@ -113,9 +115,9 @@
 
   printf ("\n%s: ", src);
   for (i = 0; i < l; i++)
-  {
-    printf ("%2x", (int) ((const unsigned char *) p)[i]);
-  }
+    {
+      printf ("%2x", (int) ((const unsigned char *) p)[i]);
+    }
   printf ("\n");
 }
 #endif
@@ -135,9 +137,9 @@
  * @return GNUNET_YES on success
  */
 int
-GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo,
-                      const void *xts, size_t xts_len, const void *skm,
-                      size_t skm_len, va_list argp)
+GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo,
+                     int prf_algo, const void *xts, size_t xts_len,
+                     const void *skm, size_t skm_len, va_list argp)
 {
   const void *hc;
   unsigned long i, t, d;
@@ -156,16 +158,16 @@
     return GNUNET_SYSERR;
 
   if (gcry_md_open (&prf, prf_algo, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
-  {
-    gcry_md_close (xtr);
-    return GNUNET_SYSERR;
-  }
+    {
+      gcry_md_close (xtr);
+      return GNUNET_SYSERR;
+    }
 
   va_copy (args, argp);
 
   ctx_len = 0;
   while (NULL != va_arg (args, void *))
-         ctx_len += va_arg (args, size_t);
+      ctx_len += va_arg (args, size_t);
 
   va_end (args);
 
@@ -189,65 +191,65 @@
     dst = plain + k;
     va_copy (args, argp);
     while ((ctx = va_arg (args, void *)))
-    {
-      size_t len;
+      {
+       size_t len;
 
-      len = va_arg (args, size_t);
-      memcpy (dst, ctx, len);
-      dst += len;
-    }
+       len = va_arg (args, size_t);
+       memcpy (dst, ctx, len);
+       dst += len;
+      }
     va_end (args);
 
     if (t > 0)
-    {
-      memset (plain + k + ctx_len, 1, 1);
+      {
+       memset (plain + k + ctx_len, 1, 1);
 #if DEBUG_HKDF
-      dump ("K(1)", plain, plain_len);
+       dump ("K(1)", plain, plain_len);
 #endif
-      hc = doHMAC (prf, prk, xtr_len, &plain[k], ctx_len + 1);
-      if (hc == NULL)
-        goto hkdf_error;
-      memcpy (result, hc, k);
-      result += k;
-    }
+       hc = doHMAC (prf, prk, xtr_len, &plain[k], ctx_len + 1);
+       if (hc == NULL)
+         goto hkdf_error;
+       memcpy (result, hc, k);
+       result += k;
+      }
 
     /* K(i+1) */
     for (i = 1; i < t; i++)
-    {
-      memcpy (plain, result - k, k);
-      memset (plain + k + ctx_len, i + 1, 1);
-      gcry_md_reset (prf);
+      {
+       memcpy (plain, result - k, k);
+       memset (plain + k + ctx_len, i + 1, 1);
+       gcry_md_reset (prf);
 #if DEBUG_HKDF
-      dump ("K(i+1)", plain, plain_len);
+       dump ("K(i+1)", plain, plain_len);
 #endif
-      hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
-      if (hc == NULL)
-        goto hkdf_error;
-      memcpy (result, hc, k);
-      result += k;
-    }
+       hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
+       if (hc == NULL)
+         goto hkdf_error;
+       memcpy (result, hc, k);
+       result += k;
+      }
 
     /* K(t):d */
     if (d > 0)
-    {
-      if (t > 0)
       {
-        memcpy (plain, result - k, k);
-        i++;
-      }
-      memset (plain + k + ctx_len, i, 1);
-      gcry_md_reset (prf);
+       if (t > 0)
+         {
+           memcpy (plain, result - k, k);
+           i++;
+         }
+       memset (plain + k + ctx_len, i, 1);
+       gcry_md_reset (prf);
 #if DEBUG_HKDF
-      dump ("K(t):d", plain, plain_len);
+       dump ("K(t):d", plain, plain_len);
 #endif
-      if (t > 0)
-        hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
-      else
-        hc = doHMAC (prf, prk, xtr_len, plain + k, plain_len - k);
-      if (hc == NULL)
-        goto hkdf_error;
-      memcpy (result, hc, d);
-    }
+       if (t > 0)
+         hc = doHMAC (prf, prk, xtr_len, plain, plain_len);
+       else
+         hc = doHMAC (prf, prk, xtr_len, plain + k, plain_len - k);
+       if (hc == NULL)
+         goto hkdf_error;
+       memcpy (result, hc, d);
+      }
 #if DEBUG_HKDF
     dump ("result", result - k, out_len);
 #endif
@@ -279,16 +281,16 @@
  */
 int
 GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
-                    const void *xts, size_t xts_len, const void *skm,
-                    size_t skm_len, ...)
+                   const void *xts, size_t xts_len, const void *skm,
+                   size_t skm_len, ...)
 {
   va_list argp;
   int ret;
 
   va_start (argp, skm_len);
   ret =
-      GNUNET_CRYPTO_hkdf_v (result, out_len, xtr_algo, prf_algo, xts, xts_len,
-                            skm, skm_len, argp);
+    GNUNET_CRYPTO_hkdf_v (result, out_len, xtr_algo, prf_algo, xts, xts_len,
+                         skm, skm_len, argp);
   va_end (argp);
 
   return ret;

Modified: gnunet/src/util/crypto_kdf.c
===================================================================
--- gnunet/src/util/crypto_kdf.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_kdf.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -29,6 +29,8 @@
 #include "platform.h"
 #include "gnunet_crypto_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * @brief Derive key
  * @param result buffer for the derived key, allocated by caller
@@ -42,8 +44,8 @@
  */
 int
 GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
-                     size_t xts_len, const void *skm, size_t skm_len,
-                     va_list argp)
+                    size_t xts_len, const void *skm, size_t skm_len,
+                    va_list argp)
 {
   /*
    * "Finally, we point out to a particularly advantageous instantiation using
@@ -57,8 +59,9 @@
    * http://eprint.iacr.org/2010/264
    */
 
-  return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512, GCRY_MD_SHA256,
-                               xts, xts_len, skm, skm_len, argp);
+  return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512,
+                              GCRY_MD_SHA256, xts, xts_len, skm, skm_len,
+                              argp);
 }
 
 /**
@@ -74,13 +77,14 @@
  */
 int
 GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
-                   size_t xts_len, const void *skm, size_t skm_len, ...)
+                  size_t xts_len, const void *skm, size_t skm_len, ...)
 {
   va_list argp;
   int ret;
 
   va_start (argp, skm_len);
-  ret = GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, 
argp);
+  ret =
+    GNUNET_CRYPTO_kdf_v (result, out_len, xts, xts_len, skm, skm_len, argp);
   va_end (argp);
 
   return ret;

Modified: gnunet/src/util/crypto_ksk.c
===================================================================
--- gnunet/src/util/crypto_ksk.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_ksk.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -39,22 +39,24 @@
 #include <gcrypt.h>
 #include <limits.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' with the message given
  * by gcry_strerror(rc).
  */
-#define LOG_GCRY(level, cmd, rc) do { GNUNET_log(level, _("`%s' failed at 
%s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } 
while(0);
+#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with 
error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0);
 
 
 typedef struct
 {
-  gcry_mpi_t n;                 /* public modulus */
-  gcry_mpi_t e;                 /* public exponent */
-  gcry_mpi_t d;                 /* exponent */
-  gcry_mpi_t p;                 /* prime  p. */
-  gcry_mpi_t q;                 /* prime  q. */
-  gcry_mpi_t u;                 /* inverse of p mod q. */
+  gcry_mpi_t n;                        /* public modulus */
+  gcry_mpi_t e;                        /* public exponent */
+  gcry_mpi_t d;                        /* exponent */
+  gcry_mpi_t p;                        /* prime  p. */
+  gcry_mpi_t q;                        /* prime  q. */
+  gcry_mpi_t u;                        /* inverse of p mod q. */
 } KBlock_secret_key;
 
 /**
@@ -82,23 +84,23 @@
 
   tmp = *rnd;
   for (i = 0; i < cnt; i++)
-  {
-    int j;
+    {
+      int j;
 
-    if (i > 0)
-      GNUNET_CRYPTO_hash (&hc, sizeof (GNUNET_HashCode), &tmp);
-    for (j = 0; j < sizeof (GNUNET_HashCode) / sizeof (uint32_t); j++)
-    {
+      if (i > 0)
+       GNUNET_CRYPTO_hash (&hc, sizeof (GNUNET_HashCode), &tmp);
+      for (j = 0; j < sizeof (GNUNET_HashCode) / sizeof (uint32_t); j++)
+       {
 #if HAVE_GCRY_MPI_LSHIFT
-      gcry_mpi_lshift (n, n, sizeof (uint32_t) * 8);
+         gcry_mpi_lshift (n, n, sizeof (uint32_t) * 8);
 #else
-      gcry_mpi_mul_ui (n, n, 1 << (sizeof (uint32_t) * 4));
-      gcry_mpi_mul_ui (n, n, 1 << (sizeof (uint32_t) * 4));
+         gcry_mpi_mul_ui (n, n, 1 << (sizeof (uint32_t) * 4));
+         gcry_mpi_mul_ui (n, n, 1 << (sizeof (uint32_t) * 4));
 #endif
-      gcry_mpi_add_ui (n, n, ntohl (((uint32_t *) & tmp)[j]));
+         gcry_mpi_add_ui (n, n, ntohl (((uint32_t *) & tmp)[j]));
+       }
+      hc = tmp;
     }
-    hc = tmp;
-  }
   GNUNET_CRYPTO_hash (&hc, sizeof (GNUNET_HashCode), rnd);
   i = gcry_mpi_get_nbits (n);
   while (i > nbits)
@@ -112,10 +114,10 @@
 
   cnt = gcry_mpi_get_nbits (n);
   for (idx = 0; idx < cnt; idx++)
-  {
-    if (gcry_mpi_test_bit (n, idx) == 0)
-      return idx;
-  }
+    {
+      if (gcry_mpi_test_bit (n, idx) == 0)
+       return idx;
+    }
 
   return ULONG_MAX;
 }
@@ -162,31 +164,31 @@
   mpz_tdiv_q_2exp (q, q, k);
 
   for (i = 0; i < steps; i++)
-  {
-    if (!i)
     {
-      gcry_mpi_set_ui (x, 2);
+      if (!i)
+       {
+         gcry_mpi_set_ui (x, 2);
+       }
+      else
+       {
+         mpz_randomize (x, nbits - 1, hc);
+         GNUNET_assert (gcry_mpi_cmp (x, nminus1) < 0);
+         GNUNET_assert (gcry_mpi_cmp_ui (x, 1) > 0);
+       }
+      gcry_mpi_powm (y, x, q, n);
+      if (gcry_mpi_cmp_ui (y, 1) && gcry_mpi_cmp (y, nminus1))
+       {
+         for (j = 1; j < k && gcry_mpi_cmp (y, nminus1); j++)
+           {
+             gcry_mpi_powm (y, y, a2, n);
+             if (!gcry_mpi_cmp_ui (y, 1))
+               goto leave;     /* Not a prime. */
+           }
+         if (gcry_mpi_cmp (y, nminus1))
+           goto leave;         /* Not a prime. */
+       }
     }
-    else
-    {
-      mpz_randomize (x, nbits - 1, hc);
-      GNUNET_assert (gcry_mpi_cmp (x, nminus1) < 0);
-      GNUNET_assert (gcry_mpi_cmp_ui (x, 1) > 0);
-    }
-    gcry_mpi_powm (y, x, q, n);
-    if (gcry_mpi_cmp_ui (y, 1) && gcry_mpi_cmp (y, nminus1))
-    {
-      for (j = 1; j < k && gcry_mpi_cmp (y, nminus1); j++)
-      {
-        gcry_mpi_powm (y, y, a2, n);
-        if (!gcry_mpi_cmp_ui (y, 1))
-          goto leave;           /* Not a prime. */
-      }
-      if (gcry_mpi_cmp (y, nminus1))
-        goto leave;             /* Not a prime. */
-    }
-  }
-  rc = 1;                       /* May be a prime. */
+  rc = 1;                      /* May be a prime. */
 
 leave:
   gcry_mpi_release (x);
@@ -208,10 +210,10 @@
 adjust (unsigned char *buf, size_t size, size_t target)
 {
   if (size < target)
-  {
-    memmove (&buf[target - size], buf, size);
-    memset (buf, 0, target - size);
-  }
+    {
+      memmove (&buf[target - size], buf, size);
+      memset (buf, 0, target - size);
+    }
 }
 
 
@@ -324,70 +326,70 @@
   tmp = gcry_mpi_new (0);
   sp = gcry_mpi_new (0);
   while (1)
-  {
-    /* generate a random number */
-    mpz_randomize (prime, nbits, hc);
-    /* Set high order bit to 1, set low order bit to 1.  If we are
-     * generating a secret prime we are most probably doing that
-     * for RSA, to make sure that the modulus does have the
-     * requested key size we set the 2 high order bits. */
-    gcry_mpi_set_bit (prime, nbits - 1);
-    gcry_mpi_set_bit (prime, nbits - 2);
-    gcry_mpi_set_bit (prime, 0);
-
-    /* Calculate all remainders. */
-    for (i = 0; i < no_of_small_prime_numbers; i++)
     {
-      size_t written;
+      /* generate a random number */
+      mpz_randomize (prime, nbits, hc);
+      /* Set high order bit to 1, set low order bit to 1.  If we are
+       * generating a secret prime we are most probably doing that
+       * for RSA, to make sure that the modulus does have the
+       * requested key size we set the 2 high order bits. */
+      gcry_mpi_set_bit (prime, nbits - 1);
+      gcry_mpi_set_bit (prime, nbits - 2);
+      gcry_mpi_set_bit (prime, 0);
 
-      gcry_mpi_set_ui (sp, small_prime_numbers[i]);
-      gcry_mpi_div (NULL, tmp, prime, sp, -1);
-      mods[i] = 0;
-      written = sizeof (unsigned int);
-      GNUNET_assert (0 ==
-                     gcry_mpi_print (GCRYMPI_FMT_USG,
-                                     (unsigned char *) &mods[i], written,
-                                     &written, tmp));
-      adjust ((unsigned char *) &mods[i], written, sizeof (unsigned int));
-      mods[i] = ntohl (mods[i]);
-    }
-    /* Now try some primes starting with prime. */
-    for (step = 0; step < 20000; step += 2)
-    {
-      /* Check against all the small primes we have in mods. */
+      /* Calculate all remainders. */
       for (i = 0; i < no_of_small_prime_numbers; i++)
-      {
-        uint16_t x = small_prime_numbers[i];
+       {
+         size_t written;
 
-        while (mods[i] + step >= x)
-          mods[i] -= x;
-        if (!(mods[i] + step))
-          break;
-      }
-      if (i < no_of_small_prime_numbers)
-        continue;               /* Found a multiple of an already known prime. 
*/
+         gcry_mpi_set_ui (sp, small_prime_numbers[i]);
+         gcry_mpi_div (NULL, tmp, prime, sp, -1);
+         mods[i] = 0;
+         written = sizeof (unsigned int);
+         GNUNET_assert (0 ==
+                        gcry_mpi_print (GCRYMPI_FMT_USG,
+                                        (unsigned char *) &mods[i], written,
+                                        &written, tmp));
+         adjust ((unsigned char *) &mods[i], written, sizeof (unsigned int));
+         mods[i] = ntohl (mods[i]);
+       }
+      /* Now try some primes starting with prime. */
+      for (step = 0; step < 20000; step += 2)
+       {
+         /* Check against all the small primes we have in mods. */
+         for (i = 0; i < no_of_small_prime_numbers; i++)
+           {
+             uint16_t x = small_prime_numbers[i];
 
-      gcry_mpi_add_ui (*ptest, prime, step);
-      if (!gcry_mpi_test_bit (*ptest, nbits - 2))
-        break;
+             while (mods[i] + step >= x)
+               mods[i] -= x;
+             if (!(mods[i] + step))
+               break;
+           }
+         if (i < no_of_small_prime_numbers)
+           continue;           /* Found a multiple of an already known prime. 
*/
 
-      /* Do a fast Fermat test now. */
-      gcry_mpi_sub_ui (pminus1, *ptest, 1);
-      gcry_mpi_powm (result, val_2, pminus1, *ptest);
-      if ((!gcry_mpi_cmp_ui (result, 1)) && (is_prime (*ptest, 5, hc)))
-      {
-        /* Got it. */
-        gcry_mpi_release (sp);
-        gcry_mpi_release (tmp);
-        gcry_mpi_release (val_2);
-        gcry_mpi_release (val_3);
-        gcry_mpi_release (result);
-        gcry_mpi_release (pminus1);
-        gcry_mpi_release (prime);
-        return;
-      }
+         gcry_mpi_add_ui (*ptest, prime, step);
+         if (!gcry_mpi_test_bit (*ptest, nbits - 2))
+           break;
+
+         /* Do a fast Fermat test now. */
+         gcry_mpi_sub_ui (pminus1, *ptest, 1);
+         gcry_mpi_powm (result, val_2, pminus1, *ptest);
+         if ((!gcry_mpi_cmp_ui (result, 1)) && (is_prime (*ptest, 5, hc)))
+           {
+             /* Got it. */
+             gcry_mpi_release (sp);
+             gcry_mpi_release (tmp);
+             gcry_mpi_release (val_2);
+             gcry_mpi_release (val_3);
+             gcry_mpi_release (result);
+             gcry_mpi_release (pminus1);
+             gcry_mpi_release (prime);
+             return;
+           }
+       }
     }
-  }
 }
 
 /**
@@ -397,11 +399,11 @@
  * @param hc the HC to use for PRNG (modified!)
  */
 static void
-generate_kblock_key (KBlock_secret_key *sk, unsigned int nbits,
-                     GNUNET_HashCode * hc)
+generate_kblock_key (KBlock_secret_key * sk, unsigned int nbits,
+                    GNUNET_HashCode * hc)
 {
   gcry_mpi_t t1, t2;
-  gcry_mpi_t phi;               /* helper: (p-1)(q-1) */
+  gcry_mpi_t phi;              /* helper: (p-1)(q-1) */
   gcry_mpi_t g;
   gcry_mpi_t f;
 
@@ -423,36 +425,36 @@
   f = gcry_mpi_new (0);
 
   do
-  {
-    do
     {
-      gcry_mpi_release (sk->p);
-      gcry_mpi_release (sk->q);
-      gen_prime (&sk->p, nbits / 2, hc);
-      gen_prime (&sk->q, nbits / 2, hc);
+      do
+       {
+         gcry_mpi_release (sk->p);
+         gcry_mpi_release (sk->q);
+         gen_prime (&sk->p, nbits / 2, hc);
+         gen_prime (&sk->q, nbits / 2, hc);
 
-      if (gcry_mpi_cmp (sk->p, sk->q) > 0)      /* p shall be smaller than q 
(for calc of u) */
-        gcry_mpi_swap (sk->p, sk->q);
-      /* calculate the modulus */
-      gcry_mpi_mul (sk->n, sk->p, sk->q);
-    }
-    while (gcry_mpi_get_nbits (sk->n) != nbits);
+         if (gcry_mpi_cmp (sk->p, sk->q) > 0)  /* p shall be smaller than q 
(for calc of u) */
+           gcry_mpi_swap (sk->p, sk->q);
+         /* calculate the modulus */
+         gcry_mpi_mul (sk->n, sk->p, sk->q);
+       }
+      while (gcry_mpi_get_nbits (sk->n) != nbits);
 
-    /* calculate Euler totient: phi = (p-1)(q-1) */
-    gcry_mpi_sub_ui (t1, sk->p, 1);
-    gcry_mpi_sub_ui (t2, sk->q, 1);
-    gcry_mpi_mul (phi, t1, t2);
-    gcry_mpi_gcd (g, t1, t2);
-    gcry_mpi_div (f, NULL, phi, g, 0);
-    while (0 == gcry_mpi_gcd (t1, sk->e, phi))
-    {                           /* (while gcd is not 1) */
-      gcry_mpi_add_ui (sk->e, sk->e, 2);
+      /* calculate Euler totient: phi = (p-1)(q-1) */
+      gcry_mpi_sub_ui (t1, sk->p, 1);
+      gcry_mpi_sub_ui (t2, sk->q, 1);
+      gcry_mpi_mul (phi, t1, t2);
+      gcry_mpi_gcd (g, t1, t2);
+      gcry_mpi_div (f, NULL, phi, g, 0);
+      while (0 == gcry_mpi_gcd (t1, sk->e, phi))
+       {                       /* (while gcd is not 1) */
+         gcry_mpi_add_ui (sk->e, sk->e, 2);
+       }
+
+      /* calculate the secret key d = e^1 mod phi */
     }
-
-    /* calculate the secret key d = e^1 mod phi */
-  }
   while ((0 == gcry_mpi_invm (sk->d, sk->e, f)) ||
-         (0 == gcry_mpi_invm (sk->u, sk->p, sk->q)));
+        (0 == gcry_mpi_invm (sk->u, sk->p, sk->q)));
 
   gcry_mpi_release (t1);
   gcry_mpi_release (t2);
@@ -471,13 +473,13 @@
    * Total size of the structure, in bytes, in big-endian!
    */
   uint16_t len GNUNET_PACKED;
-  uint16_t sizen GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizee GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sized GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizep GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizeq GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizedmp1 GNUNET_PACKED;      /*  in big-endian! */
-  uint16_t sizedmq1 GNUNET_PACKED;      /*  in big-endian! */
+  uint16_t sizen GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizee GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sized GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizep GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizeq GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizedmp1 GNUNET_PACKED;     /*  in big-endian! */
+  uint16_t sizedmq1 GNUNET_PACKED;     /*  in big-endian! */
   /* followed by the actual values */
 };
 
@@ -499,16 +501,16 @@
   size_t size;
 
   hx = *hc;
-  generate_kblock_key (&sk, 1024,       /* at least 10x as fast than 2048 bits
-                                         * -- we simply cannot afford 2048 bits
-                                         * even on modern hardware, and 
especially
-                                         * not since clearly a dictionary 
attack
-                                         * will still be much cheaper
-                                         * than breaking a 1024 bit RSA key.
-                                         * If an adversary can spend the time 
to
-                                         * break a 1024 bit RSA key just to 
forge
-                                         * a signature -- SO BE IT. [ CG, 
6/2005 ] */
-                       &hx);
+  generate_kblock_key (&sk, 1024,      /* at least 10x as fast than 2048 bits
+                                        * -- we simply cannot afford 2048 bits
+                                        * even on modern hardware, and 
especially
+                                        * not since clearly a dictionary attack
+                                        * will still be much cheaper
+                                        * than breaking a 1024 bit RSA key.
+                                        * If an adversary can spend the time to
+                                        * break a 1024 bit RSA key just to 
forge
+                                        * a signature -- SO BE IT. [ CG, 
6/2005 ] */
+                      &hx);
   pkv[0] = &sk.n;
   pkv[1] = &sk.e;
   pkv[2] = &sk.d;
@@ -517,10 +519,10 @@
   pkv[5] = &sk.u;
   size = sizeof (struct KskRsaPrivateKeyBinaryEncoded);
   for (i = 0; i < 6; i++)
-  {
-    gcry_mpi_aprint (GCRYMPI_FMT_STD, &pbu[i], &sizes[i], *pkv[i]);
-    size += sizes[i];
-  }
+    {
+      gcry_mpi_aprint (GCRYMPI_FMT_STD, &pbu[i], &sizes[i], *pkv[i]);
+      size += sizes[i];
+    }
   GNUNET_assert (size < 65536);
   retval = GNUNET_malloc (size);
   retval->len = htons (size);
@@ -545,10 +547,10 @@
   retval->sizedmq1 = htons (0);
   memcpy (&((char *) &retval[1])[i], pbu[5], sizes[5]);
   for (i = 0; i < 6; i++)
-  {
-    gcry_mpi_release (*pkv[i]);
-    free (pbu[i]);
-  }
+    {
+      gcry_mpi_release (*pkv[i]);
+      free (pbu[i]);
+    }
   return retval;
 }
 
@@ -570,122 +572,123 @@
   pos = 0;
   size = ntohs (encoding->sizen);
   rc = gcry_mpi_scan (&n, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sizen);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      return NULL;
+    }
   size = ntohs (encoding->sizee);
   rc = gcry_mpi_scan (&e, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sizee);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    gcry_mpi_release (n);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      gcry_mpi_release (n);
+      return NULL;
+    }
   size = ntohs (encoding->sized);
   rc = gcry_mpi_scan (&d, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sized);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    gcry_mpi_release (n);
-    gcry_mpi_release (e);
-    return NULL;
-  }
-  /* swap p and q! */
-  size = ntohs (encoding->sizep);
-  if (size > 0)
-  {
-    rc = gcry_mpi_scan (&q, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    pos += ntohs (encoding->sizep);
-    if (rc)
     {
       LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
       gcry_mpi_release (n);
       gcry_mpi_release (e);
-      gcry_mpi_release (d);
       return NULL;
     }
-  }
+  /* swap p and q! */
+  size = ntohs (encoding->sizep);
+  if (size > 0)
+    {
+      rc = gcry_mpi_scan (&q, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      pos += ntohs (encoding->sizep);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         return NULL;
+       }
+    }
   else
     q = NULL;
   size = ntohs (encoding->sizeq);
   if (size > 0)
-  {
-    rc = gcry_mpi_scan (&p, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    pos += ntohs (encoding->sizeq);
-    if (rc)
     {
-      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-      gcry_mpi_release (n);
-      gcry_mpi_release (e);
-      gcry_mpi_release (d);
-      if (q != NULL)
-        gcry_mpi_release (q);
-      return NULL;
+      rc = gcry_mpi_scan (&p, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      pos += ntohs (encoding->sizeq);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         if (q != NULL)
+           gcry_mpi_release (q);
+         return NULL;
+       }
     }
-  }
   else
     p = NULL;
   pos += ntohs (encoding->sizedmp1);
   pos += ntohs (encoding->sizedmq1);
   size =
-      ntohs (encoding->len) - sizeof (struct KskRsaPrivateKeyBinaryEncoded) -
-      pos;
+    ntohs (encoding->len) - sizeof (struct KskRsaPrivateKeyBinaryEncoded) -
+    pos;
   if (size > 0)
-  {
-    rc = gcry_mpi_scan (&u, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    if (rc)
     {
-      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-      gcry_mpi_release (n);
-      gcry_mpi_release (e);
-      gcry_mpi_release (d);
-      if (p != NULL)
-        gcry_mpi_release (p);
-      if (q != NULL)
-        gcry_mpi_release (q);
-      return NULL;
+      rc = gcry_mpi_scan (&u, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         if (p != NULL)
+           gcry_mpi_release (p);
+         if (q != NULL)
+           gcry_mpi_release (q);
+         return NULL;
+       }
     }
-  }
   else
     u = NULL;
 
   if ((p != NULL) && (q != NULL) && (u != NULL))
-  {
-    rc = gcry_sexp_build (&res, &size,  /* erroff */
-                          "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)(u 
%m)))",
-                          n, e, d, p, q, u);
-  }
-  else
-  {
-    if ((p != NULL) && (q != NULL))
     {
-      rc = gcry_sexp_build (&res, &size,        /* erroff */
-                            "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)))",
-                            n, e, d, p, q);
+      rc = gcry_sexp_build (&res, &size,       /* erroff */
+                           "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)(u 
%m)))",
+                           n, e, d, p, q, u);
     }
-    else
+  else
     {
-      rc = gcry_sexp_build (&res, &size,        /* erroff */
-                            "(private-key(rsa(n %m)(e %m)(d %m)))", n, e, d);
+      if ((p != NULL) && (q != NULL))
+       {
+         rc = gcry_sexp_build (&res, &size,    /* erroff */
+                               "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q 
%m)))",
+                               n, e, d, p, q);
+       }
+      else
+       {
+         rc = gcry_sexp_build (&res, &size,    /* erroff */
+                               "(private-key(rsa(n %m)(e %m)(d %m)))", n, e,
+                               d);
+       }
     }
-  }
   gcry_mpi_release (n);
   gcry_mpi_release (e);
   gcry_mpi_release (d);
@@ -700,10 +703,10 @@
     LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
 #if EXTRA_CHECKS
   if (gcry_pk_testkey (res))
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+      return NULL;
+    }
 #endif
   ret = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_RsaPrivateKey));
   ret->sexp = res;
@@ -733,13 +736,13 @@
   unsigned int i;
 
   for (i = 0; i < cacheSize; i++)
-  {
-    if (0 == memcmp (hc, &cache[i]->hc, sizeof (GNUNET_HashCode)))
     {
-      ret = ksk_decode_key (cache[i]->pke);
-      return ret;
+      if (0 == memcmp (hc, &cache[i]->hc, sizeof (GNUNET_HashCode)))
+       {
+         ret = ksk_decode_key (cache[i]->pke);
+         return ret;
+       }
     }
-  }
 
   line = GNUNET_malloc (sizeof (struct KBlockKeyCacheLine));
   line->hc = *hc;
@@ -755,10 +758,10 @@
   unsigned int i;
 
   for (i = 0; i < cacheSize; i++)
-  {
-    GNUNET_free (cache[i]->pke);
-    GNUNET_free (cache[i]);
-  }
+    {
+      GNUNET_free (cache[i]->pke);
+      GNUNET_free (cache[i]);
+    }
   GNUNET_array_grow (cache, cacheSize, 0);
 }
 

Modified: gnunet/src/util/crypto_random.c
===================================================================
--- gnunet/src/util/crypto_random.c     2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_random.c     2011-10-11 09:43:04 UTC (rev 17362)
@@ -30,6 +30,10 @@
 #include "gnunet_os_lib.h"
 #include <gcrypt.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 /**
  * Create a cryptographically weak pseudo-random number in the interval of 0 
to 1.
  *
@@ -61,37 +65,37 @@
   GNUNET_assert (i > 0);
 
   switch (mode)
-  {
-  case GNUNET_CRYPTO_QUALITY_STRONG:
-    /* see http://lists.gnupg.org/pipermail/gcrypt-devel/2004-May/000613.html 
*/
+    {
+    case GNUNET_CRYPTO_QUALITY_STRONG:
+      /* see 
http://lists.gnupg.org/pipermail/gcrypt-devel/2004-May/000613.html */
 #ifdef gcry_fast_random_poll
-    if ((invokeCount++ % 256) == 0)
-      gcry_fast_random_poll ();
+      if ((invokeCount++ % 256) == 0)
+       gcry_fast_random_poll ();
 #endif
-    ul = UINT32_MAX - (UINT32_MAX % i);
-    do
-    {
-      gcry_randomize ((unsigned char *) &ret, sizeof (uint32_t),
-                      GCRY_STRONG_RANDOM);
+      ul = UINT32_MAX - (UINT32_MAX % i);
+      do
+       {
+         gcry_randomize ((unsigned char *) &ret, sizeof (uint32_t),
+                         GCRY_STRONG_RANDOM);
+       }
+      while (ret >= ul);
+      return ret % i;
+    case GNUNET_CRYPTO_QUALITY_NONCE:
+      ul = UINT32_MAX - (UINT32_MAX % i);
+      do
+       {
+         gcry_create_nonce (&ret, sizeof (ret));
+       }
+      while (ret >= ul);
+      return ret % i;
+    case GNUNET_CRYPTO_QUALITY_WEAK:
+      ret = i * weak_random ();
+      if (ret >= i)
+       ret = i - 1;
+      return ret;
+    default:
+      GNUNET_assert (0);
     }
-    while (ret >= ul);
-    return ret % i;
-  case GNUNET_CRYPTO_QUALITY_NONCE:
-    ul = UINT32_MAX - (UINT32_MAX % i);
-    do
-    {
-      gcry_create_nonce (&ret, sizeof (ret));
-    }
-    while (ret >= ul);
-    return ret % i;
-  case GNUNET_CRYPTO_QUALITY_WEAK:
-    ret = i * weak_random ();
-    if (ret >= i)
-      ret = i - 1;
-    return ret;
-  default:
-    GNUNET_assert (0);
-  }
   return 0;
 }
 
@@ -117,12 +121,12 @@
   for (i = 0; i < n; i++)
     ret[i] = i;
   for (i = n - 1; i > 0; i--)
-  {
-    x = GNUNET_CRYPTO_random_u32 (mode, i + 1);
-    tmp = ret[x];
-    ret[x] = ret[i];
-    ret[i] = tmp;
-  }
+    {
+      x = GNUNET_CRYPTO_random_u32 (mode, i + 1);
+      tmp = ret[x];
+      ret[x] = ret[i];
+      ret[i] = tmp;
+    }
   return ret;
 }
 
@@ -142,33 +146,33 @@
 
   GNUNET_assert (max > 0);
   switch (mode)
-  {
-  case GNUNET_CRYPTO_QUALITY_STRONG:
-    ul = UINT64_MAX - (UINT64_MAX % max);
-    do
     {
-      gcry_randomize ((unsigned char *) &ret, sizeof (uint64_t),
-                      GCRY_STRONG_RANDOM);
+    case GNUNET_CRYPTO_QUALITY_STRONG:
+      ul = UINT64_MAX - (UINT64_MAX % max);
+      do
+       {
+         gcry_randomize ((unsigned char *) &ret, sizeof (uint64_t),
+                         GCRY_STRONG_RANDOM);
+       }
+      while (ret >= ul);
+      return ret % max;
+    case GNUNET_CRYPTO_QUALITY_NONCE:
+      ul = UINT64_MAX - (UINT64_MAX % max);
+      do
+       {
+         gcry_create_nonce (&ret, sizeof (ret));
+       }
+      while (ret >= ul);
+
+      return ret % max;
+    case GNUNET_CRYPTO_QUALITY_WEAK:
+      ret = max * weak_random ();
+      if (ret >= max)
+       ret = max - 1;
+      return ret;
+    default:
+      GNUNET_assert (0);
     }
-    while (ret >= ul);
-    return ret % max;
-  case GNUNET_CRYPTO_QUALITY_NONCE:
-    ul = UINT64_MAX - (UINT64_MAX % max);
-    do
-    {
-      gcry_create_nonce (&ret, sizeof (ret));
-    }
-    while (ret >= ul);
-
-    return ret % max;
-  case GNUNET_CRYPTO_QUALITY_WEAK:
-    ret = max * weak_random ();
-    if (ret >= max)
-      ret = max - 1;
-    return ret;
-  default:
-    GNUNET_assert (0);
-  }
   return 0;
 }
 
@@ -196,7 +200,7 @@
  */
 static void
 entropy_generator (void *cls, const char *what, int printchar, int current,
-                   int total)
+                  int total)
 {
   unsigned long code;
   enum GNUNET_OS_ProcessStatusType type;
@@ -205,39 +209,39 @@
   if (0 != strcmp (what, "need_entropy"))
     return;
   if (current == total)
-  {
-    if (genproc != NULL)
     {
+      if (genproc != NULL)
+       {
+         if (0 != GNUNET_OS_process_kill (genproc, SIGTERM))
+           LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "kill");
+         GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (genproc));
+         GNUNET_OS_process_close (genproc);
+         genproc = NULL;
+       }
+      return;
+    }
+  if (genproc != NULL)
+    {
+      ret = GNUNET_OS_process_status (genproc, &type, &code);
+      if (ret == GNUNET_NO)
+       return;                 /* still running */
+      if (ret == GNUNET_SYSERR)
+       {
+         GNUNET_break (0);
+         return;
+       }
       if (0 != GNUNET_OS_process_kill (genproc, SIGTERM))
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "kill");
+       LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "kill");
       GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (genproc));
       GNUNET_OS_process_close (genproc);
       genproc = NULL;
     }
-    return;
-  }
-  if (genproc != NULL)
-  {
-    ret = GNUNET_OS_process_status (genproc, &type, &code);
-    if (ret == GNUNET_NO)
-      return;                   /* still running */
-    if (ret == GNUNET_SYSERR)
-    {
-      GNUNET_break (0);
-      return;
-    }
-    if (0 != GNUNET_OS_process_kill (genproc, SIGTERM))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "kill");
-    GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (genproc));
-    GNUNET_OS_process_close (genproc);
-    genproc = NULL;
-  }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              _("Starting `%s' process to generate entropy\n"), "find");
+  LOG (GNUNET_ERROR_TYPE_INFO,
+       _("Starting `%s' process to generate entropy\n"), "find");
   genproc =
-      GNUNET_OS_start_process (NULL, NULL, "sh", "sh", "-c",
-                               "exec find / -mount -type f -exec cp {} 
/dev/null \\; 2>/dev/null",
-                               NULL);
+    GNUNET_OS_start_process (NULL, NULL, "sh", "sh", "-c",
+                            "exec find / -mount -type f -exec cp {} /dev/null 
\\; 2>/dev/null",
+                            NULL);
 }
 
 
@@ -245,11 +249,11 @@
 killfind ()
 {
   if (genproc != NULL)
-  {
-    GNUNET_OS_process_kill (genproc, SIGKILL);
-    GNUNET_OS_process_close (genproc);
-    genproc = NULL;
-  }
+    {
+      GNUNET_OS_process_kill (genproc, SIGKILL);
+      GNUNET_OS_process_close (genproc);
+      genproc = NULL;
+    }
 }
 
 
@@ -257,20 +261,21 @@
 {
   gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
   if (!gcry_check_version (GCRYPT_VERSION))
-  {
-    fprintf (stderr,
-             _
-             ("libgcrypt has not the expected version (version %s is 
required).\n"),
-             GCRYPT_VERSION);
-    abort ();
-  }
+    {
+      fprintf (stderr,
+              _
+              ("libgcrypt has not the expected version (version %s is 
required).\n"),
+              GCRYPT_VERSION);
+      abort ();
+    }
 #ifdef gcry_fast_random_poll
   gcry_fast_random_poll ();
 #endif
   gcry_set_progress_handler (&entropy_generator, NULL);
   atexit (&killfind);
   SRANDOM (time (NULL) ^
-           GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX));
+          GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
+                                    UINT32_MAX));
 }
 
 

Modified: gnunet/src/util/crypto_rsa.c
===================================================================
--- gnunet/src/util/crypto_rsa.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/crypto_rsa.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -37,6 +37,12 @@
 #include "gnunet_crypto_lib.h"
 #include "gnunet_disk_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 /**
  * The private information of an RSA key pair.
  * NOTE: this must match the definition in crypto_ksk.c
@@ -60,13 +66,13 @@
    * Total size of the structure, in bytes, in big-endian!
    */
   uint16_t len GNUNET_PACKED;
-  uint16_t sizen GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizee GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sized GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizep GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizeq GNUNET_PACKED; /*  in big-endian! */
-  uint16_t sizedmp1 GNUNET_PACKED;      /*  in big-endian! */
-  uint16_t sizedmq1 GNUNET_PACKED;      /*  in big-endian! */
+  uint16_t sizen GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizee GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sized GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizep GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizeq GNUNET_PACKED;        /*  in big-endian! */
+  uint16_t sizedmp1 GNUNET_PACKED;     /*  in big-endian! */
+  uint16_t sizedmq1 GNUNET_PACKED;     /*  in big-endian! */
   /* followed by the actual values */
 };
 
@@ -81,7 +87,7 @@
  * a failure of the command 'cmd' with the message given
  * by gcry_strerror(rc).
  */
-#define LOG_GCRY(level, cmd, rc) do { GNUNET_log(level, _("`%s' failed at 
%s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } 
while(0);
+#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with 
error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0);
 
 /**
  * If target != size, move target bytes to the
@@ -92,10 +98,10 @@
 adjust (unsigned char *buf, size_t size, size_t target)
 {
   if (size < target)
-  {
-    memmove (&buf[target - size], buf, size);
-    memset (buf, 0, target - size);
-  }
+    {
+      memmove (&buf[target - size], buf, size);
+      memset (buf, 0, target - size);
+    }
 }
 
 /**
@@ -109,9 +115,9 @@
   gcry_sexp_t s_keyparam;
 
   GNUNET_assert (0 ==
-                 gcry_sexp_build (&s_keyparam, NULL,
-                                  "(genkey(rsa(nbits %d)(rsa-use-e 3:257)))",
-                                  HOSTKEY_LEN));
+                gcry_sexp_build (&s_keyparam, NULL,
+                                 "(genkey(rsa(nbits %d)(rsa-use-e 3:257)))",
+                                 HOSTKEY_LEN));
   GNUNET_assert (0 == gcry_pk_genkey (&s_key, s_keyparam));
   gcry_sexp_release (s_keyparam);
 #if EXTRA_CHECKS
@@ -134,7 +140,7 @@
 
 static int
 key_from_sexp (gcry_mpi_t * array, gcry_sexp_t sexp, const char *topname,
-               const char *elems)
+              const char *elems)
 {
   gcry_sexp_t list, l2;
   const char *s;
@@ -142,44 +148,44 @@
 
   list = gcry_sexp_find_token (sexp, topname, 0);
   if (!list)
-  {
-    return 1;
-  }
+    {
+      return 1;
+    }
   l2 = gcry_sexp_cadr (list);
   gcry_sexp_release (list);
   list = l2;
   if (!list)
-  {
-    return 2;
-  }
+    {
+      return 2;
+    }
 
   idx = 0;
   for (s = elems; *s; s++, idx++)
-  {
-    l2 = gcry_sexp_find_token (list, s, 1);
-    if (!l2)
     {
-      for (i = 0; i < idx; i++)
-      {
-        gcry_free (array[i]);
-        array[i] = NULL;
-      }
-      gcry_sexp_release (list);
-      return 3;                 /* required parameter not found */
+      l2 = gcry_sexp_find_token (list, s, 1);
+      if (!l2)
+       {
+         for (i = 0; i < idx; i++)
+           {
+             gcry_free (array[i]);
+             array[i] = NULL;
+           }
+         gcry_sexp_release (list);
+         return 3;             /* required parameter not found */
+       }
+      array[idx] = gcry_sexp_nth_mpi (l2, 1, GCRYMPI_FMT_USG);
+      gcry_sexp_release (l2);
+      if (!array[idx])
+       {
+         for (i = 0; i < idx; i++)
+           {
+             gcry_free (array[i]);
+             array[i] = NULL;
+           }
+         gcry_sexp_release (list);
+         return 4;             /* required parameter is invalid */
+       }
     }
-    array[idx] = gcry_sexp_nth_mpi (l2, 1, GCRYMPI_FMT_USG);
-    gcry_sexp_release (l2);
-    if (!array[idx])
-    {
-      for (i = 0; i < idx; i++)
-      {
-        gcry_free (array[i]);
-        array[i] = NULL;
-      }
-      gcry_sexp_release (list);
-      return 4;                 /* required parameter is invalid */
-    }
-  }
   gcry_sexp_release (list);
   return 0;
 }
@@ -191,9 +197,10 @@
  */
 void
 GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
-                                  *priv,
-                                  struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                                  *pub)
+                                 *priv,
+                                 struct
+                                 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+                                 *pub)
 {
   gcry_mpi_t skey[2];
   size_t size;
@@ -206,24 +213,25 @@
     rc = key_from_sexp (skey, priv->sexp, "rsa", "ne");
   GNUNET_assert (0 == rc);
   pub->len =
-      htons (sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) -
-             sizeof (pub->padding));
+    htons (sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) -
+          sizeof (pub->padding));
   pub->sizen = htons (GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH);
   pub->padding = 0;
   size = GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
   GNUNET_assert (0 ==
-                 gcry_mpi_print (GCRYMPI_FMT_USG, &pub->key[0], size, &size,
-                                 skey[0]));
+                gcry_mpi_print (GCRYMPI_FMT_USG, &pub->key[0], size, &size,
+                                skey[0]));
   adjust (&pub->key[0], size, GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH);
-  size = GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
+  size =
+    GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
   GNUNET_assert (0 ==
-                 gcry_mpi_print (GCRYMPI_FMT_USG,
-                                 &pub->key
-                                 [GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], 
size,
-                                 &size, skey[1]));
+                gcry_mpi_print (GCRYMPI_FMT_USG,
+                                &pub->key
+                                [GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
+                                size, &size, skey[1]));
   adjust (&pub->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size,
-          GNUNET_CRYPTO_RSA_KEY_LENGTH -
-          GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH);
+         GNUNET_CRYPTO_RSA_KEY_LENGTH -
+         GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH);
   gcry_mpi_release (skey[0]);
   gcry_mpi_release (skey[1]);
 }
@@ -237,7 +245,7 @@
  */
 static struct GNUNET_CRYPTO_RsaPrivateKey *
 public2PrivateKey (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                   *publicKey)
+                  *publicKey)
 {
   struct GNUNET_CRYPTO_RsaPrivateKey *ret;
   gcry_sexp_t result;
@@ -251,36 +259,38 @@
       (ntohs (publicKey->len) !=
        sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) -
        sizeof (publicKey->padding)))
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
   size = GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
   rc = gcry_mpi_scan (&n, GCRYMPI_FMT_USG, &publicKey->key[0], size, &size);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    return NULL;
-  }
-  size = GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
-  rc = gcry_mpi_scan (&e, GCRYMPI_FMT_USG,
-                      &publicKey->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
-                      size, &size);
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      return NULL;
+    }
+  size =
+    GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
+  rc =
+    gcry_mpi_scan (&e, GCRYMPI_FMT_USG,
+                  &publicKey->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
+                  size, &size);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    gcry_mpi_release (n);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      gcry_mpi_release (n);
+      return NULL;
+    }
   rc = gcry_sexp_build (&result, &erroff, "(public-key(rsa(n %m)(e %m)))", n,
-                        e);
+                       e);
   gcry_mpi_release (n);
   gcry_mpi_release (e);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);  /* erroff 
gives more info */
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);       /* 
erroff gives more info */
+      return NULL;
+    }
   ret = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_RsaPrivateKey));
   ret->sexp = result;
   return ret;
@@ -306,10 +316,10 @@
 
 #if EXTRA_CHECKS
   if (gcry_pk_testkey (hostkey->sexp))
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
 #endif
 
   memset (pkv, 0, sizeof (gcry_mpi_t) * 6);
@@ -327,21 +337,21 @@
   GNUNET_assert (0 == rc);
   size = sizeof (struct RsaPrivateKeyBinaryEncoded);
   for (i = 0; i < 6; i++)
-  {
-    if (pkv[i] != NULL)
     {
-      GNUNET_assert (0 ==
-                     gcry_mpi_aprint (GCRYMPI_FMT_USG,
-                                      (unsigned char **) &pbu[i], &sizes[i],
-                                      pkv[i]));
-      size += sizes[i];
+      if (pkv[i] != NULL)
+       {
+         GNUNET_assert (0 ==
+                        gcry_mpi_aprint (GCRYMPI_FMT_USG,
+                                         (unsigned char **) &pbu[i],
+                                         &sizes[i], pkv[i]));
+         size += sizes[i];
+       }
+      else
+       {
+         pbu[i] = NULL;
+         sizes[i] = 0;
+       }
     }
-    else
-    {
-      pbu[i] = NULL;
-      sizes[i] = 0;
-    }
-  }
   GNUNET_assert (size < 65536);
   retval = GNUNET_malloc (size);
   retval->len = htons (size);
@@ -366,12 +376,12 @@
   retval->sizedmq1 = htons (0);
   memcpy (&((char *) (&retval[1]))[i], pbu[5], sizes[5]);
   for (i = 0; i < 6; i++)
-  {
-    if (pkv[i] != NULL)
-      gcry_mpi_release (pkv[i]);
-    if (pbu[i] != NULL)
-      free (pbu[i]);
-  }
+    {
+      if (pkv[i] != NULL)
+       gcry_mpi_release (pkv[i]);
+      if (pbu[i] != NULL)
+       free (pbu[i]);
+    }
   return retval;
 }
 
@@ -387,7 +397,7 @@
 {
   struct GNUNET_CRYPTO_RsaPrivateKey *ret;
   const struct RsaPrivateKeyBinaryEncoded *encoding =
-      (const struct RsaPrivateKeyBinaryEncoded *) buf;
+    (const struct RsaPrivateKeyBinaryEncoded *) buf;
   gcry_sexp_t res;
   gcry_mpi_t n, e, d, p, q, u;
   int rc;
@@ -402,121 +412,122 @@
   pos = 0;
   size = ntohs (encoding->sizen);
   rc = gcry_mpi_scan (&n, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sizen);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      return NULL;
+    }
   size = ntohs (encoding->sizee);
   rc = gcry_mpi_scan (&e, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sizee);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    gcry_mpi_release (n);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+      gcry_mpi_release (n);
+      return NULL;
+    }
   size = ntohs (encoding->sized);
   rc = gcry_mpi_scan (&d, GCRYMPI_FMT_USG,
-                      &((const unsigned char *) (&encoding[1]))[pos], size,
-                      &size);
+                     &((const unsigned char *) (&encoding[1]))[pos], size,
+                     &size);
   pos += ntohs (encoding->sized);
   if (rc)
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-    gcry_mpi_release (n);
-    gcry_mpi_release (e);
-    return NULL;
-  }
-  /* swap p and q! */
-  size = ntohs (encoding->sizep);
-  if (size > 0)
-  {
-    rc = gcry_mpi_scan (&q, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    pos += ntohs (encoding->sizep);
-    if (rc)
     {
       LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
       gcry_mpi_release (n);
       gcry_mpi_release (e);
-      gcry_mpi_release (d);
       return NULL;
     }
-  }
+  /* swap p and q! */
+  size = ntohs (encoding->sizep);
+  if (size > 0)
+    {
+      rc = gcry_mpi_scan (&q, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      pos += ntohs (encoding->sizep);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         return NULL;
+       }
+    }
   else
     q = NULL;
   size = ntohs (encoding->sizeq);
   if (size > 0)
-  {
-    rc = gcry_mpi_scan (&p, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    pos += ntohs (encoding->sizeq);
-    if (rc)
     {
-      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-      gcry_mpi_release (n);
-      gcry_mpi_release (e);
-      gcry_mpi_release (d);
-      if (q != NULL)
-        gcry_mpi_release (q);
-      return NULL;
+      rc = gcry_mpi_scan (&p, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      pos += ntohs (encoding->sizeq);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         if (q != NULL)
+           gcry_mpi_release (q);
+         return NULL;
+       }
     }
-  }
   else
     p = NULL;
   pos += ntohs (encoding->sizedmp1);
   pos += ntohs (encoding->sizedmq1);
   size =
-      ntohs (encoding->len) - sizeof (struct RsaPrivateKeyBinaryEncoded) - pos;
+    ntohs (encoding->len) - sizeof (struct RsaPrivateKeyBinaryEncoded) - pos;
   if (size > 0)
-  {
-    rc = gcry_mpi_scan (&u, GCRYMPI_FMT_USG,
-                        &((const unsigned char *) (&encoding[1]))[pos], size,
-                        &size);
-    if (rc)
     {
-      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
-      gcry_mpi_release (n);
-      gcry_mpi_release (e);
-      gcry_mpi_release (d);
-      if (p != NULL)
-        gcry_mpi_release (p);
-      if (q != NULL)
-        gcry_mpi_release (q);
-      return NULL;
+      rc = gcry_mpi_scan (&u, GCRYMPI_FMT_USG,
+                         &((const unsigned char *) (&encoding[1]))[pos],
+                         size, &size);
+      if (rc)
+       {
+         LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_mpi_scan", rc);
+         gcry_mpi_release (n);
+         gcry_mpi_release (e);
+         gcry_mpi_release (d);
+         if (p != NULL)
+           gcry_mpi_release (p);
+         if (q != NULL)
+           gcry_mpi_release (q);
+         return NULL;
+       }
     }
-  }
   else
     u = NULL;
 
   if ((p != NULL) && (q != NULL) && (u != NULL))
-  {
-    rc = gcry_sexp_build (&res, &size,  /* erroff */
-                          "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)(u 
%m)))",
-                          n, e, d, p, q, u);
-  }
-  else
-  {
-    if ((p != NULL) && (q != NULL))
     {
-      rc = gcry_sexp_build (&res, &size,        /* erroff */
-                            "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)))",
-                            n, e, d, p, q);
+      rc = gcry_sexp_build (&res, &size,       /* erroff */
+                           "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q %m)(u 
%m)))",
+                           n, e, d, p, q, u);
     }
-    else
+  else
     {
-      rc = gcry_sexp_build (&res, &size,        /* erroff */
-                            "(private-key(rsa(n %m)(e %m)(d %m)))", n, e, d);
+      if ((p != NULL) && (q != NULL))
+       {
+         rc = gcry_sexp_build (&res, &size,    /* erroff */
+                               "(private-key(rsa(n %m)(e %m)(d %m)(p %m)(q 
%m)))",
+                               n, e, d, p, q);
+       }
+      else
+       {
+         rc = gcry_sexp_build (&res, &size,    /* erroff */
+                               "(private-key(rsa(n %m)(e %m)(d %m)))", n, e,
+                               d);
+       }
     }
-  }
   gcry_mpi_release (n);
   gcry_mpi_release (e);
   gcry_mpi_release (d);
@@ -531,10 +542,10 @@
     LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_sexp_build", rc);
 #if EXTRA_CHECKS
   if (gcry_pk_testkey (res))
-  {
-    LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
-    return NULL;
-  }
+    {
+      LOG_GCRY (GNUNET_ERROR_TYPE_ERROR, "gcry_pk_testkey", rc);
+      return NULL;
+    }
 #endif
   ret = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_RsaPrivateKey));
   ret->sexp = res;
@@ -571,167 +582,172 @@
   if (GNUNET_SYSERR == GNUNET_DISK_directory_create_for_file (filename))
     return NULL;
   while (GNUNET_YES != GNUNET_DISK_file_test (filename))
-  {
-    fd = GNUNET_DISK_file_open (filename,
-                                GNUNET_DISK_OPEN_WRITE | 
GNUNET_DISK_OPEN_CREATE
-                                | GNUNET_DISK_OPEN_FAILIFEXISTS,
-                                GNUNET_DISK_PERM_USER_READ |
-                                GNUNET_DISK_PERM_USER_WRITE);
-    if (NULL == fd)
     {
-      if (errno == EEXIST)
-      {
-        if (GNUNET_YES != GNUNET_DISK_file_test (filename))
-        {
-          /* must exist but not be accessible, fail for good! */
-          if (0 != ACCESS (filename, R_OK))
-            GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "access",
-                                      filename);
-          else
-            GNUNET_break (0);   /* what is going on!? */
-          return NULL;
-        }
-        continue;
-      }
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", filename);
-      return NULL;
-    }
-    cnt = 0;
+      fd = GNUNET_DISK_file_open (filename,
+                                 GNUNET_DISK_OPEN_WRITE |
+                                 GNUNET_DISK_OPEN_CREATE |
+                                 GNUNET_DISK_OPEN_FAILIFEXISTS,
+                                 GNUNET_DISK_PERM_USER_READ |
+                                 GNUNET_DISK_PERM_USER_WRITE);
+      if (NULL == fd)
+       {
+         if (errno == EEXIST)
+           {
+             if (GNUNET_YES != GNUNET_DISK_file_test (filename))
+               {
+                 /* must exist but not be accessible, fail for good! */
+                 if (0 != ACCESS (filename, R_OK))
+                   LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "access",
+                                      filename);
+                 else
+                   GNUNET_break (0);   /* what is going on!? */
+                 return NULL;
+               }
+             continue;
+           }
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename);
+         return NULL;
+       }
+      cnt = 0;
 
-    while (GNUNET_YES !=
-           GNUNET_DISK_file_lock (fd, 0,
-                                  sizeof (struct RsaPrivateKeyBinaryEncoded),
-                                  GNUNET_YES))
-    {
-      sleep (1);
-      if (0 == ++cnt % 10)
-      {
-        ec = errno;
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _("Could not aquire lock on file `%s': %s...\n"), filename,
-                    STRERROR (ec));
-      }
+      while (GNUNET_YES !=
+            GNUNET_DISK_file_lock (fd, 0,
+                                   sizeof (struct
+                                           RsaPrivateKeyBinaryEncoded),
+                                   GNUNET_YES))
+       {
+         sleep (1);
+         if (0 == ++cnt % 10)
+           {
+             ec = errno;
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _("Could not aquire lock on file `%s': %s...\n"), filename,
+                  STRERROR (ec));
+           }
+       }
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Creating a new private key.  This may take a while.\n"));
+      ret = GNUNET_CRYPTO_rsa_key_create ();
+      GNUNET_assert (ret != NULL);
+      enc = rsa_encode_key (ret);
+      GNUNET_assert (enc != NULL);
+      GNUNET_assert (ntohs (enc->len) ==
+                    GNUNET_DISK_file_write (fd, enc, ntohs (enc->len)));
+      GNUNET_free (enc);
+
+      GNUNET_DISK_file_sync (fd);
+      if (GNUNET_YES !=
+         GNUNET_DISK_file_unlock (fd, 0,
+                                  sizeof (struct
+                                          RsaPrivateKeyBinaryEncoded)))
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+      GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
+      GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
+      GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("I am host `%s'.  Stored new private key in `%s'.\n"),
+          GNUNET_i2s (&pid), filename);
+      return ret;
     }
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Creating a new private key.  This may take a while.\n"));
-    ret = GNUNET_CRYPTO_rsa_key_create ();
-    GNUNET_assert (ret != NULL);
-    enc = rsa_encode_key (ret);
-    GNUNET_assert (enc != NULL);
-    GNUNET_assert (ntohs (enc->len) ==
-                   GNUNET_DISK_file_write (fd, enc, ntohs (enc->len)));
-    GNUNET_free (enc);
-
-    GNUNET_DISK_file_sync (fd);
-    if (GNUNET_YES !=
-        GNUNET_DISK_file_unlock (fd, 0,
-                                 sizeof (struct RsaPrivateKeyBinaryEncoded)))
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
-    GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
-    GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
-    GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("I am host `%s'.  Stored new private key in `%s'.\n"),
-                GNUNET_i2s (&pid), filename);
-    return ret;
-  }
   /* hostkey file exists already, read it! */
   fd = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ,
-                              GNUNET_DISK_PERM_NONE);
+                             GNUNET_DISK_PERM_NONE);
   if (NULL == fd)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", filename);
-    return NULL;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "open", filename);
+      return NULL;
+    }
   cnt = 0;
   while (1)
-  {
-    if (GNUNET_YES !=
-        GNUNET_DISK_file_lock (fd, 0,
-                               sizeof (struct RsaPrivateKeyBinaryEncoded),
-                               GNUNET_NO))
     {
-      if (0 == ++cnt % 60)
-      {
-        ec = errno;
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _("Could not aquire lock on file `%s': %s...\n"), filename,
-                    STRERROR (ec));
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _
-                    ("This may be ok if someone is currently generating a 
hostkey.\n"));
-      }
-      sleep (1);
-      continue;
-    }
-    if (GNUNET_YES != GNUNET_DISK_file_test (filename))
-    {
-      /* eh, what!? File we opened is now gone!? */
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", filename);
       if (GNUNET_YES !=
-          GNUNET_DISK_file_unlock (fd, 0,
-                                   sizeof (struct RsaPrivateKeyBinaryEncoded)))
-        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl", 
filename);
-      GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
+         GNUNET_DISK_file_lock (fd, 0,
+                                sizeof (struct RsaPrivateKeyBinaryEncoded),
+                                GNUNET_NO))
+       {
+         if (0 == ++cnt % 60)
+           {
+             ec = errno;
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _("Could not aquire lock on file `%s': %s...\n"), filename,
+                  STRERROR (ec));
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _
+                  ("This may be ok if someone is currently generating a 
hostkey.\n"));
+           }
+         sleep (1);
+         continue;
+       }
+      if (GNUNET_YES != GNUNET_DISK_file_test (filename))
+       {
+         /* eh, what!? File we opened is now gone!? */
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", filename);
+         if (GNUNET_YES !=
+             GNUNET_DISK_file_unlock (fd, 0,
+                                      sizeof (struct
+                                              RsaPrivateKeyBinaryEncoded)))
+           LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+         GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
 
-      return NULL;
+         return NULL;
+       }
+      if (GNUNET_YES != GNUNET_DISK_file_size (filename, &fs, GNUNET_YES))
+       fs = 0;
+      if (fs < sizeof (struct RsaPrivateKeyBinaryEncoded))
+       {
+         /* maybe we got the read lock before the hostkey generating
+          * process had a chance to get the write lock; give it up! */
+         if (GNUNET_YES !=
+             GNUNET_DISK_file_unlock (fd, 0,
+                                      sizeof (struct
+                                              RsaPrivateKeyBinaryEncoded)))
+           LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+         if (0 == ++cnt % 10)
+           {
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _
+                  ("When trying to read hostkey file `%s' I found %u bytes but 
I need at least %u.\n"),
+                  filename, (unsigned int) fs,
+                  (unsigned int) sizeof (struct RsaPrivateKeyBinaryEncoded));
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _
+                  ("This may be ok if someone is currently generating a 
hostkey.\n"));
+           }
+         sleep (2);            /* wait a bit longer! */
+         continue;
+       }
+      break;
     }
-    if (GNUNET_YES != GNUNET_DISK_file_size (filename, &fs, GNUNET_YES))
-      fs = 0;
-    if (fs < sizeof (struct RsaPrivateKeyBinaryEncoded))
-    {
-      /* maybe we got the read lock before the hostkey generating
-       * process had a chance to get the write lock; give it up! */
-      if (GNUNET_YES !=
-          GNUNET_DISK_file_unlock (fd, 0,
-                                   sizeof (struct RsaPrivateKeyBinaryEncoded)))
-        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl", 
filename);
-      if (0 == ++cnt % 10)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _
-                    ("When trying to read hostkey file `%s' I found %u bytes 
but I need at least %u.\n"),
-                    filename, (unsigned int) fs,
-                    (unsigned int) sizeof (struct RsaPrivateKeyBinaryEncoded));
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _
-                    ("This may be ok if someone is currently generating a 
hostkey.\n"));
-      }
-      sleep (2);                /* wait a bit longer! */
-      continue;
-    }
-    break;
-  }
   enc = GNUNET_malloc (fs);
   GNUNET_assert (fs == GNUNET_DISK_file_read (fd, enc, fs));
   len = ntohs (enc->len);
   ret = NULL;
   if ((len != fs) ||
       (NULL == (ret = GNUNET_CRYPTO_rsa_decode_key ((char *) enc, len))))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _
-                ("File `%s' does not contain a valid private key.  Deleting 
it.\n"),
-                filename);
-    if (0 != UNLINK (filename))
     {
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", filename);
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _
+          ("File `%s' does not contain a valid private key.  Deleting it.\n"),
+          filename);
+      if (0 != UNLINK (filename))
+       {
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "unlink", filename);
+       }
     }
-  }
   GNUNET_free (enc);
   if (GNUNET_YES !=
       GNUNET_DISK_file_unlock (fd, 0,
-                               sizeof (struct RsaPrivateKeyBinaryEncoded)))
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
+                              sizeof (struct RsaPrivateKeyBinaryEncoded)))
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fcntl", filename);
   GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
   if (ret != NULL)
-  {
-    GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
-    GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("I am host `%s'.  Read private key from `%s'.\n"),
-                GNUNET_i2s (&pid), filename);
-  }
+    {
+      GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
+      GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("I am host `%s'.  Read private key from `%s'.\n"),
+          GNUNET_i2s (&pid), filename);
+    }
   return ret;
 }
 
@@ -748,9 +764,9 @@
  */
 int
 GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size,
-                           const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                           *publicKey,
-                           struct GNUNET_CRYPTO_RsaEncryptedData *target)
+                          const struct
+                          GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey,
+                          struct GNUNET_CRYPTO_RsaEncryptedData *target)
 {
   gcry_sexp_t result;
   gcry_sexp_t data;
@@ -766,10 +782,10 @@
     return GNUNET_SYSERR;
   isize = size;
   GNUNET_assert (0 ==
-                 gcry_mpi_scan (&val, GCRYMPI_FMT_USG, block, isize, &isize));
+                gcry_mpi_scan (&val, GCRYMPI_FMT_USG, block, isize, &isize));
   GNUNET_assert (0 ==
-                 gcry_sexp_build (&data, &erroff,
-                                  "(data (flags pkcs1)(value %m))", val));
+                gcry_sexp_build (&data, &erroff,
+                                 "(data (flags pkcs1)(value %m))", val));
   gcry_mpi_release (val);
   GNUNET_assert (0 == gcry_pk_encrypt (&result, data, pubkey->sexp));
   gcry_sexp_release (data);
@@ -779,11 +795,11 @@
   gcry_sexp_release (result);
   isize = sizeof (struct GNUNET_CRYPTO_RsaEncryptedData);
   GNUNET_assert (0 ==
-                 gcry_mpi_print (GCRYMPI_FMT_USG, (unsigned char *) target,
-                                 isize, &isize, rval));
+                gcry_mpi_print (GCRYMPI_FMT_USG, (unsigned char *) target,
+                                isize, &isize, rval));
   gcry_mpi_release (rval);
   adjust (&target->encoding[0], isize,
-          sizeof (struct GNUNET_CRYPTO_RsaEncryptedData));
+         sizeof (struct GNUNET_CRYPTO_RsaEncryptedData));
   return GNUNET_OK;
 }
 
@@ -799,8 +815,8 @@
  */
 ssize_t
 GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey * key,
-                           const struct GNUNET_CRYPTO_RsaEncryptedData * block,
-                           void *result, size_t max)
+                          const struct GNUNET_CRYPTO_RsaEncryptedData *
+                          block, void *result, size_t max)
 {
   gcry_sexp_t resultsexp;
   gcry_sexp_t data;
@@ -815,21 +831,22 @@
 #endif
   size = sizeof (struct GNUNET_CRYPTO_RsaEncryptedData);
   GNUNET_assert (0 ==
-                 gcry_mpi_scan (&val, GCRYMPI_FMT_USG, &block->encoding[0],
-                                size, &size));
+                gcry_mpi_scan (&val, GCRYMPI_FMT_USG, &block->encoding[0],
+                               size, &size));
   GNUNET_assert (0 ==
-                 gcry_sexp_build (&data, &erroff, "(enc-val(flags)(rsa(a 
%m)))",
-                                  val));
+                gcry_sexp_build (&data, &erroff,
+                                 "(enc-val(flags)(rsa(a %m)))", val));
   gcry_mpi_release (val);
   GNUNET_assert (0 == gcry_pk_decrypt (&resultsexp, data, key->sexp));
   gcry_sexp_release (data);
   /* resultsexp has format "(value %m)" */
   GNUNET_assert (NULL !=
-                 (val = gcry_sexp_nth_mpi (resultsexp, 1, GCRYMPI_FMT_USG)));
+                (val = gcry_sexp_nth_mpi (resultsexp, 1, GCRYMPI_FMT_USG)));
   gcry_sexp_release (resultsexp);
   tmp = GNUNET_malloc (max + HOSTKEY_LEN / 8);
   size = max + HOSTKEY_LEN / 8;
-  GNUNET_assert (0 == gcry_mpi_print (GCRYMPI_FMT_USG, tmp, size, &size, val));
+  GNUNET_assert (0 ==
+                gcry_mpi_print (GCRYMPI_FMT_USG, tmp, size, &size, val));
   gcry_mpi_release (val);
   endp = tmp;
   endp += (size - max);
@@ -850,8 +867,8 @@
  */
 int
 GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
-                        const struct GNUNET_CRYPTO_RsaSignaturePurpose 
*purpose,
-                        struct GNUNET_CRYPTO_RsaSignature *sig)
+                       const struct GNUNET_CRYPTO_RsaSignaturePurpose
+                       *purpose, struct GNUNET_CRYPTO_RsaSignature *sig)
 {
   gcry_sexp_t result;
   gcry_sexp_t data;
@@ -867,10 +884,10 @@
   buff = GNUNET_malloc (bufSize);
   memcpy (buff, FORMATSTRING, bufSize);
   memcpy (&buff
-          [bufSize -
-           strlen
-           
("0123456789012345678901234567890123456789012345678901234567890123))")
-           - 1], &hc, sizeof (GNUNET_HashCode));
+         [bufSize -
+          strlen
+          
("0123456789012345678901234567890123456789012345678901234567890123))")
+          - 1], &hc, sizeof (GNUNET_HashCode));
   GNUNET_assert (0 == gcry_sexp_new (&data, buff, bufSize, 0));
   GNUNET_free (buff);
   GNUNET_assert (0 == gcry_pk_sign (&result, data, key->sexp));
@@ -879,8 +896,8 @@
   gcry_sexp_release (result);
   ssize = sizeof (struct GNUNET_CRYPTO_RsaSignature);
   GNUNET_assert (0 ==
-                 gcry_mpi_print (GCRYMPI_FMT_USG, (unsigned char *) sig, ssize,
-                                 &ssize, rval));
+                gcry_mpi_print (GCRYMPI_FMT_USG, (unsigned char *) sig,
+                                ssize, &ssize, rval));
   gcry_mpi_release (rval);
   adjust (sig->sig, ssize, sizeof (struct GNUNET_CRYPTO_RsaSignature));
   return GNUNET_OK;
@@ -898,11 +915,11 @@
  */
 int
 GNUNET_CRYPTO_rsa_verify (uint32_t purpose,
-                          const struct GNUNET_CRYPTO_RsaSignaturePurpose
-                          *validate,
-                          const struct GNUNET_CRYPTO_RsaSignature *sig,
-                          const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                          *publicKey)
+                         const struct GNUNET_CRYPTO_RsaSignaturePurpose
+                         *validate,
+                         const struct GNUNET_CRYPTO_RsaSignature *sig,
+                         const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+                         *publicKey)
 {
   gcry_sexp_t data;
   gcry_sexp_t sigdata;
@@ -916,44 +933,44 @@
   int rc;
 
   if (purpose != ntohl (validate->purpose))
-    return GNUNET_SYSERR;       /* purpose mismatch */
+    return GNUNET_SYSERR;      /* purpose mismatch */
   GNUNET_CRYPTO_hash (validate, ntohl (validate->size), &hc);
   size = sizeof (struct GNUNET_CRYPTO_RsaSignature);
   GNUNET_assert (0 ==
-                 gcry_mpi_scan (&val, GCRYMPI_FMT_USG,
-                                (const unsigned char *) sig, size, &size));
+                gcry_mpi_scan (&val, GCRYMPI_FMT_USG,
+                               (const unsigned char *) sig, size, &size));
   GNUNET_assert (0 ==
-                 gcry_sexp_build (&sigdata, &erroff, "(sig-val(rsa(s %m)))",
-                                  val));
+                gcry_sexp_build (&sigdata, &erroff, "(sig-val(rsa(s %m)))",
+                                 val));
   gcry_mpi_release (val);
   bufSize = strlen (FORMATSTRING) + 1;
   buff = GNUNET_malloc (bufSize);
   memcpy (buff, FORMATSTRING, bufSize);
   memcpy (&buff
-          [strlen (FORMATSTRING) -
-           strlen
-           
("0123456789012345678901234567890123456789012345678901234567890123))")],
-          &hc, sizeof (GNUNET_HashCode));
+         [strlen (FORMATSTRING) -
+          strlen
+          
("0123456789012345678901234567890123456789012345678901234567890123))")],
+         &hc, sizeof (GNUNET_HashCode));
   GNUNET_assert (0 == gcry_sexp_new (&data, buff, bufSize, 0));
   GNUNET_free (buff);
   hostkey = public2PrivateKey (publicKey);
   if (hostkey == NULL)
-  {
-    gcry_sexp_release (data);
-    gcry_sexp_release (sigdata);
-    return GNUNET_SYSERR;
-  }
+    {
+      gcry_sexp_release (data);
+      gcry_sexp_release (sigdata);
+      return GNUNET_SYSERR;
+    }
   rc = gcry_pk_verify (sigdata, data, hostkey->sexp);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   gcry_sexp_release (data);
   gcry_sexp_release (sigdata);
   if (rc)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("RSA signature verification failed at %s:%d: %s\n"), 
__FILE__,
-                __LINE__, gcry_strerror (rc));
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("RSA signature verification failed at %s:%d: %s\n"), __FILE__,
+          __LINE__, gcry_strerror (rc));
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/disk.c      2011-10-11 09:43:04 UTC (rev 17362)
@@ -34,6 +34,12 @@
 #include "gnunet_crypto_lib.h"
 #include "disk.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 #define DEBUG_NPIPE GNUNET_EXTRA_LOGGING
 
 #define DEBUG_PIPE GNUNET_EXTRA_LOGGING
@@ -61,8 +67,8 @@
 #define PIPE_BUF        512
 ULONG PipeSerialNumber;
 #endif
-#define        _IFMT           0170000 /* type of file */
-#define        _IFLNK          0120000 /* symbolic link */
+#define        _IFMT           0170000 /* type of file */
+#define        _IFLNK          0120000 /* symbolic link */
 #define  S_ISLNK(m)    (((m)&_IFMT) == _IFLNK)
 #else
 #error PORT-ME: need to port statfs (how much space is left on the drive?)
@@ -159,25 +165,25 @@
 
 #ifdef HAVE_STAT64
   if (0 != STAT64 (fn, &buf))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat64", fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat64", fn);
+      return GNUNET_SYSERR;
+    }
 #else
   if (0 != STAT (fn, &buf))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", fn);
+      return GNUNET_SYSERR;
+    }
 #endif
   if ((!S_ISLNK (buf.st_mode)) || (gfsd->include_sym_links == GNUNET_YES))
     gfsd->total += buf.st_size;
   if ((S_ISDIR (buf.st_mode)) && (0 == ACCESS (fn, X_OK)) &&
       ((!S_ISLNK (buf.st_mode)) || (gfsd->include_sym_links == GNUNET_YES)))
-  {
-    if (GNUNET_SYSERR == GNUNET_DISK_directory_scan (fn, &getSizeRec, gfsd))
-      return GNUNET_SYSERR;
-  }
+    {
+      if (GNUNET_SYSERR == GNUNET_DISK_directory_scan (fn, &getSizeRec, gfsd))
+       return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 
@@ -209,13 +215,13 @@
  */
 off_t
 GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, off_t offset,
-                       enum GNUNET_DISK_Seek whence)
+                      enum GNUNET_DISK_Seek whence)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifdef MINGW
   DWORD ret;
@@ -226,10 +232,10 @@
 
   ret = SetFilePointer (h->h, offset, NULL, t[whence]);
   if (ret == INVALID_SET_FILE_POINTER)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      return GNUNET_SYSERR;
+    }
   return ret;
 #else
   static int t[] = {[GNUNET_DISK_SEEK_SET] = SEEK_SET,
@@ -255,7 +261,7 @@
  */
 int
 GNUNET_DISK_file_size (const char *filename, uint64_t * size,
-                       int includeSymLinks)
+                      int includeSymLinks)
 {
   struct GetFileSizeData gfsd;
   int ret;
@@ -286,29 +292,29 @@
  */
 int
 GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev,
-                                  uint64_t * ino)
+                                 uint64_t * ino)
 {
 #if LINUX
   struct stat sbuf;
   struct statvfs fbuf;
 
   if ((0 == stat (filename, &sbuf)) && (0 == statvfs (filename, &fbuf)))
-  {
-    *dev = (uint64_t) fbuf.f_fsid;
-    *ino = (uint64_t) sbuf.st_ino;
-    return GNUNET_OK;
-  }
+    {
+      *dev = (uint64_t) fbuf.f_fsid;
+      *ino = (uint64_t) sbuf.st_ino;
+      return GNUNET_OK;
+    }
 #elif SOMEBSD
   struct stat sbuf;
   struct statfs fbuf;
 
   if ((0 == stat (filename, &sbuf)) && (0 == statfs (filename, &fbuf)))
-  {
-    *dev = ((uint64_t) fbuf.f_fsid.val[0]) << 32 ||
-        ((uint64_t) fbuf.f_fsid.val[1]);
-    *ino = (uint64_t) sbuf.st_ino;
-    return GNUNET_OK;
-  }
+    {
+      *dev = ((uint64_t) fbuf.f_fsid.val[0]) << 32 ||
+       ((uint64_t) fbuf.f_fsid.val[1]);
+      *ino = (uint64_t) sbuf.st_ino;
+      return GNUNET_OK;
+    }
 #elif WINDOWS
   // FIXME NILS: test this
   struct GNUNET_DISK_FileHandle *fh;
@@ -321,11 +327,11 @@
   succ = GetFileInformationByHandle (fh->h, &info);
   GNUNET_DISK_file_close (fh);
   if (succ)
-  {
-    *dev = info.dwVolumeSerialNumber;
-    *ino = ((info.nFileIndexHigh << sizeof (DWORD)) | info.nFileIndexLow);
-    return GNUNET_OK;
-  }
+    {
+      *dev = info.dwVolumeSerialNumber;
+      *ino = ((info.nFileIndexHigh << sizeof (DWORD)) | info.nFileIndexLow);
+      return GNUNET_OK;
+    }
   else
     return GNUNET_SYSERR;
 
@@ -357,37 +363,37 @@
 #if WINDOWS
       && !(isalpha ((int) t[0]) && (t[0] != '\0') && (t[1] == ':'))
 #endif
-      )
-  {
-    tmpdir = getenv ("TMPDIR");
-    tmpdir = tmpdir ? tmpdir : "/tmp";
-    GNUNET_asprintf (&tmpl, "%s/%s%s", tmpdir, t, "XXXXXX");
-  }
+    )
+    {
+      tmpdir = getenv ("TMPDIR");
+      tmpdir = tmpdir ? tmpdir : "/tmp";
+      GNUNET_asprintf (&tmpl, "%s/%s%s", tmpdir, t, "XXXXXX");
+    }
   else
-  {
-    GNUNET_asprintf (&tmpl, "%s%s", t, "XXXXXX");
-  }
+    {
+      GNUNET_asprintf (&tmpl, "%s%s", t, "XXXXXX");
+    }
 #ifdef MINGW
   fn = (char *) GNUNET_malloc (MAX_PATH + 1);
   if (ERROR_SUCCESS != plibc_conv_to_win_path (tmpl, fn))
-  {
-    GNUNET_free (fn);
-    GNUNET_free (tmpl);
-    return NULL;
-  }
+    {
+      GNUNET_free (fn);
+      GNUNET_free (tmpl);
+      return NULL;
+    }
   GNUNET_free (tmpl);
 #else
   fn = tmpl;
 #endif
   fd = mkstemp (fn);
   if (fd == -1)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "mkstemp", fn);
-    GNUNET_free (fn);
-    return NULL;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "mkstemp", fn);
+      GNUNET_free (fn);
+      return NULL;
+    }
   if (0 != CLOSE (fd))
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "close", fn);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "close", fn);
   return fn;
 }
 
@@ -406,10 +412,10 @@
   struct statvfs buf;
 
   if (0 != statvfs (part, &buf))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "statfs", part);
-    return -1;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "statfs", part);
+      return -1;
+    }
   return buf.f_bavail;
 #elif MINGW
   DWORD dwDummy;
@@ -424,22 +430,22 @@
   GNUNET_free (path);
   szDrive[3] = 0;
   if (!GetDiskFreeSpace (szDrive, &dwDummy, &dwDummy, &dwBlocks, &dwDummy))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("`%s' failed for drive `%s': %u\n"), "GetDiskFreeSpace",
-                szDrive, GetLastError ());
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("`%s' failed for drive `%s': %u\n"), "GetDiskFreeSpace",
+          szDrive, GetLastError ());
 
-    return -1;
-  }
+      return -1;
+    }
   return dwBlocks;
 #else
   struct statfs s;
 
   if (0 != statfs (part, &s))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "statfs", part);
-    return -1;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "statfs", part);
+      return -1;
+    }
   return s.f_bavail;
 #endif
 }
@@ -463,21 +469,21 @@
 
   ret = STAT (fil, &filestat);
   if (ret != 0)
-  {
-    if (errno != ENOENT)
     {
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", fil);
-      return GNUNET_SYSERR;
+      if (errno != ENOENT)
+       {
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", fil);
+         return GNUNET_SYSERR;
+       }
+      return GNUNET_NO;
     }
-    return GNUNET_NO;
-  }
   if (!S_ISDIR (filestat.st_mode))
     return GNUNET_NO;
   if (ACCESS (fil, R_OK | X_OK) < 0)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "access", fil);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "access", fil);
+      return GNUNET_SYSERR;
+    }
   return GNUNET_YES;
 }
 
@@ -502,27 +508,27 @@
 
   ret = STAT (rdir, &filestat);
   if (ret != 0)
-  {
-    if (errno != ENOENT)
     {
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", rdir);
+      if (errno != ENOENT)
+       {
+         LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", rdir);
+         GNUNET_free (rdir);
+         return GNUNET_SYSERR;
+       }
       GNUNET_free (rdir);
-      return GNUNET_SYSERR;
+      return GNUNET_NO;
     }
-    GNUNET_free (rdir);
-    return GNUNET_NO;
-  }
   if (!S_ISREG (filestat.st_mode))
-  {
-    GNUNET_free (rdir);
-    return GNUNET_NO;
-  }
+    {
+      GNUNET_free (rdir);
+      return GNUNET_NO;
+    }
   if (ACCESS (rdir, R_OK) < 0)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "access", rdir);
-    GNUNET_free (rdir);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "access", rdir);
+      GNUNET_free (rdir);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (rdir);
   return GNUNET_YES;
 }
@@ -547,56 +553,56 @@
 
   len = strlen (rdir);
 #ifndef MINGW
-  pos = 1;                      /* skip heading '/' */
+  pos = 1;                     /* skip heading '/' */
 #else
   /* Local or Network path? */
   if (strncmp (rdir, "\\\\", 2) == 0)
-  {
-    pos = 2;
-    while (rdir[pos])
     {
-      if (rdir[pos] == '\\')
-      {
-        pos++;
-        break;
-      }
-      pos++;
+      pos = 2;
+      while (rdir[pos])
+       {
+         if (rdir[pos] == '\\')
+           {
+             pos++;
+             break;
+           }
+         pos++;
+       }
     }
-  }
   else
-  {
-    pos = 3;                    /* strlen("C:\\") */
-  }
+    {
+      pos = 3;                 /* strlen("C:\\") */
+    }
 #endif
   while (pos <= len)
-  {
-    if ((rdir[pos] == DIR_SEPARATOR) || (pos == len))
     {
-      rdir[pos] = '\0';
-      ret = GNUNET_DISK_directory_test (rdir);
-      if (ret == GNUNET_SYSERR)
-      {
-        GNUNET_free (rdir);
-        return GNUNET_SYSERR;
-      }
-      if (ret == GNUNET_NO)
-      {
+      if ((rdir[pos] == DIR_SEPARATOR) || (pos == len))
+       {
+         rdir[pos] = '\0';
+         ret = GNUNET_DISK_directory_test (rdir);
+         if (ret == GNUNET_SYSERR)
+           {
+             GNUNET_free (rdir);
+             return GNUNET_SYSERR;
+           }
+         if (ret == GNUNET_NO)
+           {
 #ifndef MINGW
-        ret = mkdir (rdir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | 
S_IROTH | S_IXOTH);        /* 755 */
+             ret = mkdir (rdir, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | 
S_IXGRP | S_IROTH | S_IXOTH);  /* 755 */
 #else
-        ret = mkdir (rdir);
+             ret = mkdir (rdir);
 #endif
-        if ((ret != 0) && (errno != EEXIST))
-        {
-          GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "mkdir", rdir);
-          GNUNET_free (rdir);
-          return GNUNET_SYSERR;
-        }
-      }
-      rdir[pos] = DIR_SEPARATOR;
+             if ((ret != 0) && (errno != EEXIST))
+               {
+                 LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "mkdir", rdir);
+                 GNUNET_free (rdir);
+                 return GNUNET_SYSERR;
+               }
+           }
+         rdir[pos] = DIR_SEPARATOR;
+       }
+      pos++;
     }
-    pos++;
-  }
   GNUNET_free (rdir);
   return GNUNET_OK;
 }
@@ -643,37 +649,37 @@
  */
 ssize_t
 GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle * h, void *result,
-                       size_t len)
+                      size_t len)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifdef MINGW
   DWORD bytesRead;
 
   if (h->type != GNUNET_PIPE)
-  {
-    if (!ReadFile (h->h, result, len, &bytesRead, NULL))
     {
-      SetErrnoFromWinError (GetLastError ());
-      return GNUNET_SYSERR;
+      if (!ReadFile (h->h, result, len, &bytesRead, NULL))
+       {
+         SetErrnoFromWinError (GetLastError ());
+         return GNUNET_SYSERR;
+       }
     }
-  }
   else
-  {
-    if (!ReadFile (h->h, result, len, NULL, h->oOverlapRead))
     {
-      if (GetLastError () != ERROR_IO_PENDING)
-      {
-        SetErrnoFromWinError (GetLastError ());
-        return GNUNET_SYSERR;
-      }
+      if (!ReadFile (h->h, result, len, NULL, h->oOverlapRead))
+       {
+         if (GetLastError () != ERROR_IO_PENDING)
+           {
+             SetErrnoFromWinError (GetLastError ());
+             return GNUNET_SYSERR;
+           }
+       }
+      GetOverlappedResult (h->h, h->oOverlapRead, &bytesRead, TRUE);
     }
-    GetOverlappedResult (h->h, h->oOverlapRead, &bytesRead, TRUE);
-  }
   return bytesRead;
 #else
   return read (h->fd, result, len);
@@ -695,7 +701,8 @@
   struct GNUNET_DISK_FileHandle *fh;
   ssize_t ret;
 
-  fh = GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ, 
GNUNET_DISK_PERM_NONE);
+  fh =
+    GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE);
   if (!fh)
     return GNUNET_SYSERR;
   ret = GNUNET_DISK_file_read (fh, result, len);
@@ -714,46 +721,46 @@
  */
 ssize_t
 GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle * h,
-                        const void *buffer, size_t n)
+                       const void *buffer, size_t n)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifdef MINGW
   DWORD bytesWritten;
 
   if (h->type != GNUNET_PIPE)
-  {
-    if (!WriteFile (h->h, buffer, n, &bytesWritten, NULL))
     {
-      SetErrnoFromWinError (GetLastError ());
-      return GNUNET_SYSERR;
+      if (!WriteFile (h->h, buffer, n, &bytesWritten, NULL))
+       {
+         SetErrnoFromWinError (GetLastError ());
+         return GNUNET_SYSERR;
+       }
     }
-  }
   else
-  {
+    {
 #if DEBUG_PIPE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "It is a pipe trying to write\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "It is a pipe trying to write\n");
 #endif
-    if (!WriteFile (h->h, buffer, n, NULL, h->oOverlapWrite))
-    {
-      if (GetLastError () != ERROR_IO_PENDING)
-      {
-        SetErrnoFromWinError (GetLastError ());
+      if (!WriteFile (h->h, buffer, n, NULL, h->oOverlapWrite))
+       {
+         if (GetLastError () != ERROR_IO_PENDING)
+           {
+             SetErrnoFromWinError (GetLastError ());
 #if DEBUG_PIPE
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error writing to pipe\n");
+             LOG (GNUNET_ERROR_TYPE_DEBUG, "Error writing to pipe\n");
 #endif
-        return GNUNET_SYSERR;
-      }
-    }
+             return GNUNET_SYSERR;
+           }
+       }
 #if DEBUG_PIPE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will get overlapped result\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Will get overlapped result\n");
 #endif
-    GetOverlappedResult (h->h, h->oOverlapWrite, &bytesWritten, TRUE);
-  }
+      GetOverlappedResult (h->h, h->oOverlapWrite, &bytesWritten, TRUE);
+    }
   return bytesWritten;
 #else
   return write (h->fd, buffer, n);
@@ -772,14 +779,15 @@
  */
 ssize_t
 GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n,
-                      enum GNUNET_DISK_AccessPermissions mode)
+                     enum GNUNET_DISK_AccessPermissions mode)
 {
   struct GNUNET_DISK_FileHandle *fh;
   ssize_t ret;
 
   fh = GNUNET_DISK_file_open (fn,
-                              GNUNET_DISK_OPEN_WRITE | 
GNUNET_DISK_OPEN_TRUNCATE
-                              | GNUNET_DISK_OPEN_CREATE, mode);
+                             GNUNET_DISK_OPEN_WRITE |
+                             GNUNET_DISK_OPEN_TRUNCATE |
+                             GNUNET_DISK_OPEN_CREATE, mode);
   if (!fh)
     return GNUNET_SYSERR;
   ret = GNUNET_DISK_file_write (fh, buffer, n);
@@ -799,8 +807,8 @@
  */
 int
 GNUNET_DISK_directory_scan (const char *dirName,
-                            GNUNET_FileNameCallback callback,
-                            void *callback_cls)
+                           GNUNET_FileNameCallback callback,
+                           void *callback_cls)
 {
   DIR *dinfo;
   struct dirent *finfo;
@@ -818,61 +826,61 @@
   while ((strlen (dname) > 0) && (dname[strlen (dname) - 1] == DIR_SEPARATOR))
     dname[strlen (dname) - 1] = '\0';
   if (0 != STAT (dname, &istat))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", dname);
-    GNUNET_free (dname);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", dname);
+      GNUNET_free (dname);
+      return GNUNET_SYSERR;
+    }
   if (!S_ISDIR (istat.st_mode))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("Expected `%s' to be a directory!\n"), dirName);
-    GNUNET_free (dname);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("Expected `%s' to be a directory!\n"), dirName);
+      GNUNET_free (dname);
+      return GNUNET_SYSERR;
+    }
   errno = 0;
   dinfo = OPENDIR (dname);
   if ((errno == EACCES) || (dinfo == NULL))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "opendir", dname);
-    if (dinfo != NULL)
-      closedir (dinfo);
-    GNUNET_free (dname);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "opendir", dname);
+      if (dinfo != NULL)
+       closedir (dinfo);
+      GNUNET_free (dname);
+      return GNUNET_SYSERR;
+    }
   name_len = 256;
   n_size = strlen (dname) + name_len + 2;
   name = GNUNET_malloc (n_size);
   while ((finfo = readdir (dinfo)) != NULL)
-  {
-    if ((0 == strcmp (finfo->d_name, ".")) ||
-        (0 == strcmp (finfo->d_name, "..")))
-      continue;
-    if (callback != NULL)
     {
-      if (name_len < strlen (finfo->d_name))
-      {
-        GNUNET_free (name);
-        name_len = strlen (finfo->d_name);
-        n_size = strlen (dname) + name_len + 2;
-        name = GNUNET_malloc (n_size);
-      }
-      /* dname can end in "/" only if dname == "/";
-       * if dname does not end in "/", we need to add
-       * a "/" (otherwise, we must not!) */
-      GNUNET_snprintf (name, n_size, "%s%s%s", dname,
-                       (strcmp (dname, DIR_SEPARATOR_STR) ==
-                        0) ? "" : DIR_SEPARATOR_STR, finfo->d_name);
-      if (GNUNET_OK != callback (callback_cls, name))
-      {
-        closedir (dinfo);
-        GNUNET_free (name);
-        GNUNET_free (dname);
-        return GNUNET_SYSERR;
-      }
+      if ((0 == strcmp (finfo->d_name, ".")) ||
+         (0 == strcmp (finfo->d_name, "..")))
+       continue;
+      if (callback != NULL)
+       {
+         if (name_len < strlen (finfo->d_name))
+           {
+             GNUNET_free (name);
+             name_len = strlen (finfo->d_name);
+             n_size = strlen (dname) + name_len + 2;
+             name = GNUNET_malloc (n_size);
+           }
+         /* dname can end in "/" only if dname == "/";
+          * if dname does not end in "/", we need to add
+          * a "/" (otherwise, we must not!) */
+         GNUNET_snprintf (name, n_size, "%s%s%s", dname,
+                          (strcmp (dname, DIR_SEPARATOR_STR) ==
+                           0) ? "" : DIR_SEPARATOR_STR, finfo->d_name);
+         if (GNUNET_OK != callback (callback_cls, name))
+           {
+             closedir (dinfo);
+             GNUNET_free (name);
+             GNUNET_free (dname);
+             return GNUNET_SYSERR;
+           }
+       }
+      count++;
     }
-    count++;
-  }
   closedir (dinfo);
   GNUNET_free (name);
   GNUNET_free (dname);
@@ -924,7 +932,7 @@
  */
 static void
 directory_iterator_task (void *cls,
-                         const struct GNUNET_SCHEDULER_TaskContext *tc)
+                        const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_DISK_DirectoryIterator *iter = cls;
   char *name;
@@ -949,35 +957,35 @@
  *         GNUNET_SYSERR if abort was YES
  */
 int
-GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator 
*iter,
-                                     int can)
+GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator
+                                    *iter, int can)
 {
   struct dirent *finfo;
 
   GNUNET_assert (iter->next_name == NULL);
   if (can == GNUNET_YES)
-  {
-    closedir (iter->directory);
-    GNUNET_free (iter->dirname);
-    GNUNET_free (iter);
-    return GNUNET_SYSERR;
-  }
+    {
+      closedir (iter->directory);
+      GNUNET_free (iter->dirname);
+      GNUNET_free (iter);
+      return GNUNET_SYSERR;
+    }
   while (NULL != (finfo = readdir (iter->directory)))
-  {
-    if ((0 == strcmp (finfo->d_name, ".")) ||
-        (0 == strcmp (finfo->d_name, "..")))
-      continue;
-    GNUNET_asprintf (&iter->next_name, "%s%s%s", iter->dirname,
-                     DIR_SEPARATOR_STR, finfo->d_name);
-    break;
-  }
+    {
+      if ((0 == strcmp (finfo->d_name, ".")) ||
+         (0 == strcmp (finfo->d_name, "..")))
+       continue;
+      GNUNET_asprintf (&iter->next_name, "%s%s%s", iter->dirname,
+                      DIR_SEPARATOR_STR, finfo->d_name);
+      break;
+    }
   if (finfo == NULL)
-  {
-    GNUNET_DISK_directory_iterator_next (iter, GNUNET_YES);
-    return GNUNET_NO;
-  }
-  GNUNET_SCHEDULER_add_with_priority (iter->priority, &directory_iterator_task,
-                                      iter);
+    {
+      GNUNET_DISK_directory_iterator_next (iter, GNUNET_YES);
+      return GNUNET_NO;
+    }
+  GNUNET_SCHEDULER_add_with_priority (iter->priority,
+                                     &directory_iterator_task, iter);
   return GNUNET_YES;
 }
 
@@ -995,9 +1003,9 @@
  */
 void
 GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio,
-                                      const char *dirName,
-                                      GNUNET_DISK_DirectoryIteratorCallback
-                                      callback, void *callback_cls)
+                                     const char *dirName,
+                                     GNUNET_DISK_DirectoryIteratorCallback
+                                     callback, void *callback_cls)
 {
   struct GNUNET_DISK_DirectoryIterator *di;
 
@@ -1006,11 +1014,11 @@
   di->callback_cls = callback_cls;
   di->directory = OPENDIR (dirName);
   if (di->directory == NULL)
-  {
-    GNUNET_free (di);
-    callback (callback_cls, NULL, NULL, NULL);
-    return;
-  }
+    {
+      GNUNET_free (di);
+      callback (callback_cls, NULL, NULL, NULL);
+      return;
+    }
   di->dirname = GNUNET_strdup (dirName);
   di->priority = prio;
   GNUNET_DISK_directory_iterator_next (di, GNUNET_NO);
@@ -1047,7 +1055,7 @@
   struct stat istat;
 
   if (0 != LSTAT (fileName, &istat))
-    return GNUNET_NO;           /* file may not exist... */
+    return GNUNET_NO;          /* file may not exist... */
   CHMOD (fileName, S_IWUSR | S_IRUSR | S_IXUSR);
   if (UNLINK (fileName) == 0)
     return GNUNET_OK;
@@ -1056,18 +1064,18 @@
        * sticky /tmp directory may result in EPERM on BSD.
        * So we also explicitly check "isDirectory" */
       (GNUNET_YES != GNUNET_DISK_directory_test (fileName)))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName);
+      return GNUNET_SYSERR;
+    }
   if (GNUNET_SYSERR ==
       GNUNET_DISK_directory_scan (fileName, &remove_helper, NULL))
     return GNUNET_SYSERR;
   if (0 != RMDIR (fileName))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "rmdir", fileName);
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 
@@ -1093,34 +1101,34 @@
     return GNUNET_SYSERR;
   pos = 0;
   in = GNUNET_DISK_file_open (src, GNUNET_DISK_OPEN_READ,
-                              GNUNET_DISK_PERM_NONE);
+                             GNUNET_DISK_PERM_NONE);
   if (!in)
     return GNUNET_SYSERR;
   out =
-      GNUNET_DISK_file_open (dst,
-                             GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE |
-                             GNUNET_DISK_OPEN_FAILIFEXISTS,
-                             GNUNET_DISK_PERM_USER_READ |
-                             GNUNET_DISK_PERM_USER_WRITE |
-                             GNUNET_DISK_PERM_GROUP_READ |
-                             GNUNET_DISK_PERM_GROUP_WRITE);
+    GNUNET_DISK_file_open (dst,
+                          GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE |
+                          GNUNET_DISK_OPEN_FAILIFEXISTS,
+                          GNUNET_DISK_PERM_USER_READ |
+                          GNUNET_DISK_PERM_USER_WRITE |
+                          GNUNET_DISK_PERM_GROUP_READ |
+                          GNUNET_DISK_PERM_GROUP_WRITE);
   if (!out)
-  {
-    GNUNET_DISK_file_close (in);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_DISK_file_close (in);
+      return GNUNET_SYSERR;
+    }
   buf = GNUNET_malloc (COPY_BLK_SIZE);
   while (pos < size)
-  {
-    len = COPY_BLK_SIZE;
-    if (len > size - pos)
-      len = size - pos;
-    if (len != GNUNET_DISK_file_read (in, buf, len))
-      goto FAIL;
-    if (len != GNUNET_DISK_file_write (out, buf, len))
-      goto FAIL;
-    pos += len;
-  }
+    {
+      len = COPY_BLK_SIZE;
+      if (len > size - pos)
+       len = size - pos;
+      if (len != GNUNET_DISK_file_read (in, buf, len))
+       goto FAIL;
+      if (len != GNUNET_DISK_file_write (out, buf, len))
+       goto FAIL;
+      pos += len;
+    }
   GNUNET_free (buf);
   GNUNET_DISK_file_close (in);
   GNUNET_DISK_file_close (out);
@@ -1145,17 +1153,17 @@
 
   idx = fn;
   while (*idx)
-  {
-    c = *idx;
+    {
+      c = *idx;
 
-    if (c == '/' || c == '\\' || c == ':' || c == '*' || c == '?' || c == '"' 
||
-        c == '<' || c == '>' || c == '|')
-    {
-      *idx = '_';
+      if (c == '/' || c == '\\' || c == ':' || c == '*' || c == '?'
+         || c == '"' || c == '<' || c == '>' || c == '|')
+       {
+         *idx = '_';
+       }
+
+      idx++;
     }
-
-    idx++;
-  }
 }
 
 
@@ -1175,14 +1183,14 @@
 
   pws = getpwnam (user);
   if (pws == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("Cannot obtain information about user `%s': %s\n"), user,
-                STRERROR (errno));
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("Cannot obtain information about user `%s': %s\n"), user,
+          STRERROR (errno));
+      return GNUNET_SYSERR;
+    }
   if (0 != chown (filename, pws->pw_uid, pws->pw_gid))
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "chown", filename);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "chown", filename);
 #endif
   return GNUNET_OK;
 }
@@ -1198,13 +1206,13 @@
  */
 int
 GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart,
-                       off_t lockEnd, int excl)
+                      off_t lockEnd, int excl)
 {
   if (fh == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifndef MINGW
   struct flock fl;
@@ -1223,12 +1231,13 @@
   o.Offset = lockStart;
 
   if (!LockFileEx
-      (fh->h, (excl ? LOCKFILE_EXCLUSIVE_LOCK : 0) | LOCKFILE_FAIL_IMMEDIATELY,
-       0, lockEnd - lockStart, 0, &o))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    return GNUNET_SYSERR;
-  }
+      (fh->h,
+       (excl ? LOCKFILE_EXCLUSIVE_LOCK : 0) | LOCKFILE_FAIL_IMMEDIATELY, 0,
+       lockEnd - lockStart, 0, &o))
+    {
+      SetErrnoFromWinError (GetLastError ());
+      return GNUNET_SYSERR;
+    }
 
   return GNUNET_OK;
 #endif
@@ -1244,13 +1253,13 @@
  */
 int
 GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlockStart,
-                         off_t unlockEnd)
+                        off_t unlockEnd)
 {
   if (fh == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifndef MINGW
   struct flock fl;
@@ -1269,10 +1278,10 @@
   o.Offset = unlockStart;
 
   if (!UnlockFileEx (fh->h, 0, unlockEnd - unlockStart, 0, &o))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      return GNUNET_SYSERR;
+    }
 
   return GNUNET_OK;
 #endif
@@ -1293,7 +1302,7 @@
  */
 struct GNUNET_DISK_FileHandle *
 GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags,
-                       enum GNUNET_DISK_AccessPermissions perm)
+                      enum GNUNET_DISK_AccessPermissions perm)
 {
   char *expfn;
   struct GNUNET_DISK_FileHandle *ret;
@@ -1314,17 +1323,17 @@
 #ifndef MINGW
   mode = 0;
   if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE))
-    oflags = O_RDWR;            /* note: O_RDWR is NOT always O_RDONLY | 
O_WRONLY */
+    oflags = O_RDWR;           /* note: O_RDWR is NOT always O_RDONLY | 
O_WRONLY */
   else if (flags & GNUNET_DISK_OPEN_READ)
     oflags = O_RDONLY;
   else if (flags & GNUNET_DISK_OPEN_WRITE)
     oflags = O_WRONLY;
   else
-  {
-    GNUNET_break (0);
-    GNUNET_free (expfn);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (expfn);
+      return NULL;
+    }
   if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
     oflags |= (O_CREAT | O_EXCL);
   if (flags & GNUNET_DISK_OPEN_TRUNCATE)
@@ -1332,22 +1341,22 @@
   if (flags & GNUNET_DISK_OPEN_APPEND)
     oflags |= O_APPEND;
   if (flags & GNUNET_DISK_OPEN_CREATE)
-  {
-    (void) GNUNET_DISK_directory_create_for_file (expfn);
-    oflags |= O_CREAT;
-    mode = translate_unix_perms (perm);
-  }
+    {
+      (void) GNUNET_DISK_directory_create_for_file (expfn);
+      oflags |= O_CREAT;
+      mode = translate_unix_perms (perm);
+    }
 
   fd = open (expfn, oflags | O_LARGEFILE, mode);
   if (fd == -1)
-  {
-    if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS))
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
-    else
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_DEBUG, "open", expfn);
-    GNUNET_free (expfn);
-    return NULL;
-  }
+    {
+      if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS))
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
+      else
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_DEBUG, "open", expfn);
+      GNUNET_free (expfn);
+      return NULL;
+    }
 #else
   access = 0;
   disp = OPEN_ALWAYS;
@@ -1360,48 +1369,48 @@
     access = FILE_WRITE_DATA;
 
   if (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)
-  {
-    disp = CREATE_NEW;
-  }
+    {
+      disp = CREATE_NEW;
+    }
   else if (flags & GNUNET_DISK_OPEN_CREATE)
-  {
-    (void) GNUNET_DISK_directory_create_for_file (expfn);
-    if (flags & GNUNET_DISK_OPEN_TRUNCATE)
-      disp = CREATE_ALWAYS;
-    else
-      disp = OPEN_ALWAYS;
-  }
+    {
+      (void) GNUNET_DISK_directory_create_for_file (expfn);
+      if (flags & GNUNET_DISK_OPEN_TRUNCATE)
+       disp = CREATE_ALWAYS;
+      else
+       disp = OPEN_ALWAYS;
+    }
   else if (flags & GNUNET_DISK_OPEN_TRUNCATE)
-  {
-    disp = TRUNCATE_EXISTING;
-  }
+    {
+      disp = TRUNCATE_EXISTING;
+    }
   else
-  {
-    disp = OPEN_EXISTING;
-  }
+    {
+      disp = OPEN_EXISTING;
+    }
 
   /* TODO: access priviledges? */
   h = CreateFile (expfn, access,
-                  FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
-                  disp, FILE_ATTRIBUTE_NORMAL, NULL);
+                 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+                 NULL, disp, FILE_ATTRIBUTE_NORMAL, NULL);
   if (h == INVALID_HANDLE_VALUE)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
-    GNUNET_free (expfn);
-    return NULL;
-  }
-
-  if (flags & GNUNET_DISK_OPEN_APPEND)
-    if (SetFilePointer (h, 0, 0, FILE_END) == INVALID_SET_FILE_POINTER)
     {
       SetErrnoFromWinError (GetLastError ());
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "SetFilePointer",
-                                expfn);
-      CloseHandle (h);
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "open", expfn);
       GNUNET_free (expfn);
       return NULL;
     }
+
+  if (flags & GNUNET_DISK_OPEN_APPEND)
+    if (SetFilePointer (h, 0, 0, FILE_END) == INVALID_SET_FILE_POINTER)
+      {
+       SetErrnoFromWinError (GetLastError ());
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "SetFilePointer",
+                          expfn);
+       CloseHandle (h);
+       GNUNET_free (expfn);
+       return NULL;
+      }
 #endif
 
   ret = GNUNET_malloc (sizeof (struct GNUNET_DISK_FileHandle));
@@ -1425,28 +1434,28 @@
 GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #if MINGW
   if (!CloseHandle (h->h))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "close");
-    GNUNET_free (h->oOverlapRead);
-    GNUNET_free (h->oOverlapWrite);
-    GNUNET_free (h);
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "close");
+      GNUNET_free (h->oOverlapRead);
+      GNUNET_free (h->oOverlapWrite);
+      GNUNET_free (h);
+      return GNUNET_SYSERR;
+    }
 #else
   if (close (h->fd) != 0)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "close");
-    GNUNET_free (h);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "close");
+      GNUNET_free (h);
+      return GNUNET_SYSERR;
+    }
 #endif
   GNUNET_free (h);
   return GNUNET_OK;
@@ -1469,7 +1478,7 @@
  */
 char *
 GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                               const char *serviceName, ...)
+                              const char *serviceName, ...)
 {
   const char *c;
   char *pfx;
@@ -1478,44 +1487,45 @@
   unsigned int needed;
 
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg, serviceName, "HOME", &pfx))
+      GNUNET_CONFIGURATION_get_value_filename (cfg, serviceName, "HOME",
+                                              &pfx))
     return NULL;
   if (pfx == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("No `%s' specified for service `%s' in configuration.\n"),
-                "HOME", serviceName);
-    return NULL;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("No `%s' specified for service `%s' in configuration.\n"),
+          "HOME", serviceName);
+      return NULL;
+    }
   needed = strlen (pfx) + 2;
   if ((pfx[strlen (pfx) - 1] != '/') && (pfx[strlen (pfx) - 1] != '\\'))
     needed++;
   va_start (ap, serviceName);
   while (1)
-  {
-    c = va_arg (ap, const char *);
+    {
+      c = va_arg (ap, const char *);
 
-    if (c == NULL)
-      break;
-    needed += strlen (c);
-    if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\'))
-      needed++;
-  }
+      if (c == NULL)
+       break;
+      needed += strlen (c);
+      if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\'))
+       needed++;
+    }
   va_end (ap);
   ret = GNUNET_malloc (needed);
   strcpy (ret, pfx);
   GNUNET_free (pfx);
   va_start (ap, serviceName);
   while (1)
-  {
-    c = va_arg (ap, const char *);
+    {
+      c = va_arg (ap, const char *);
 
-    if (c == NULL)
-      break;
-    if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\'))
-      strcat (ret, DIR_SEPARATOR_STR);
-    strcat (ret, c);
-  }
+      if (c == NULL)
+       break;
+      if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\'))
+       strcat (ret, DIR_SEPARATOR_STR);
+      strcat (ret, c);
+    }
   va_end (ap);
   if ((ret[strlen (ret) - 1] != '/') && (ret[strlen (ret) - 1] != '\\'))
     (void) GNUNET_DISK_directory_create_for_file (ret);
@@ -1564,56 +1574,56 @@
  */
 void *
 GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h,
-                      struct GNUNET_DISK_MapHandle **m,
-                      enum GNUNET_DISK_MapType access, size_t len)
+                     struct GNUNET_DISK_MapHandle **m,
+                     enum GNUNET_DISK_MapType access, size_t len)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return NULL;
-  }
+    {
+      errno = EINVAL;
+      return NULL;
+    }
 
 #ifdef MINGW
   DWORD mapAccess, protect;
 
   if ((access & GNUNET_DISK_MAP_TYPE_READ) &&
       (access & GNUNET_DISK_MAP_TYPE_WRITE))
-  {
-    protect = PAGE_READWRITE;
-    mapAccess = FILE_MAP_ALL_ACCESS;
-  }
+    {
+      protect = PAGE_READWRITE;
+      mapAccess = FILE_MAP_ALL_ACCESS;
+    }
   else if (access & GNUNET_DISK_MAP_TYPE_READ)
-  {
-    protect = PAGE_READONLY;
-    mapAccess = FILE_MAP_READ;
-  }
+    {
+      protect = PAGE_READONLY;
+      mapAccess = FILE_MAP_READ;
+    }
   else if (access & GNUNET_DISK_MAP_TYPE_WRITE)
-  {
-    protect = PAGE_READWRITE;
-    mapAccess = FILE_MAP_WRITE;
-  }
+    {
+      protect = PAGE_READWRITE;
+      mapAccess = FILE_MAP_WRITE;
+    }
   else
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
 
   *m = GNUNET_malloc (sizeof (struct GNUNET_DISK_MapHandle));
   (*m)->h = CreateFileMapping (h->h, NULL, protect, 0, 0, NULL);
   if ((*m)->h == INVALID_HANDLE_VALUE)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_free (*m);
-    return NULL;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      GNUNET_free (*m);
+      return NULL;
+    }
 
   (*m)->addr = MapViewOfFile ((*m)->h, mapAccess, 0, 0, len);
   if (!(*m)->addr)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    CloseHandle ((*m)->h);
-    GNUNET_free (*m);
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      CloseHandle ((*m)->h);
+      GNUNET_free (*m);
+    }
 
   return (*m)->addr;
 #else
@@ -1628,10 +1638,10 @@
   (*m)->addr = mmap (NULL, len, prot, MAP_SHARED, h->fd, 0);
   GNUNET_assert (NULL != (*m)->addr);
   if (MAP_FAILED == (*m)->addr)
-  {
-    GNUNET_free (*m);
-    return NULL;
-  }
+    {
+      GNUNET_free (*m);
+      return NULL;
+    }
   (*m)->len = len;
   return (*m)->addr;
 #endif
@@ -1648,20 +1658,20 @@
   int ret;
 
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifdef MINGW
   ret = UnmapViewOfFile (h->addr) ? GNUNET_OK : GNUNET_SYSERR;
   if (ret != GNUNET_OK)
     SetErrnoFromWinError (GetLastError ());
   if (!CloseHandle (h->h) && (ret == GNUNET_OK))
-  {
-    ret = GNUNET_SYSERR;
-    SetErrnoFromWinError (GetLastError ());
-  }
+    {
+      ret = GNUNET_SYSERR;
+      SetErrnoFromWinError (GetLastError ());
+    }
 #else
   ret = munmap (h->addr, h->len) != -1 ? GNUNET_OK : GNUNET_SYSERR;
 #endif
@@ -1679,10 +1689,10 @@
 GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
 {
   if (h == NULL)
-  {
-    errno = EINVAL;
-    return GNUNET_SYSERR;
-  }
+    {
+      errno = EINVAL;
+      return GNUNET_SYSERR;
+    }
 
 #ifdef MINGW
   int ret;
@@ -1711,8 +1721,8 @@
    unlike CreatePipe, which returns a bool for success or failure.  */
 static int
 create_selectable_pipe (PHANDLE read_pipe_ptr, PHANDLE write_pipe_ptr,
-                        LPSECURITY_ATTRIBUTES sa_ptr, DWORD psize,
-                        DWORD dwReadMode, DWORD dwWriteMode)
+                       LPSECURITY_ATTRIBUTES sa_ptr, DWORD psize,
+                       DWORD dwReadMode, DWORD dwWriteMode)
 {
   /* Default to error. */
   *read_pipe_ptr = *write_pipe_ptr = INVALID_HANDLE_VALUE;
@@ -1729,106 +1739,105 @@
    * Retrying will probably never be necessary, but we want
    * to be as robust as possible.  */
   while (1)
-  {
-    static volatile LONG pipe_unique_id;
+    {
+      static volatile LONG pipe_unique_id;
 
-    snprintf (pipename, sizeof pipename, "\\\\.\\pipe\\gnunet-%d-%ld",
-              getpid (), InterlockedIncrement ((LONG *) & pipe_unique_id));
+      snprintf (pipename, sizeof pipename, "\\\\.\\pipe\\gnunet-%d-%ld",
+               getpid (), InterlockedIncrement ((LONG *) & pipe_unique_id));
 #if DEBUG_PIPE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "CreateNamedPipe: name = %s, size = %lu\n", pipename, psize);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "CreateNamedPipe: name = %s, size = %lu\n", pipename, psize);
 #endif
-    /* Use CreateNamedPipe instead of CreatePipe, because the latter
-     * returns a write handle that does not permit FILE_READ_ATTRIBUTES
-     * access, on versions of win32 earlier than WinXP SP2.
-     * CreatePipe also stupidly creates a full duplex pipe, which is
-     * a waste, since only a single direction is actually used.
-     * It's important to only allow a single instance, to ensure that
-     * the pipe was not created earlier by some other process, even if
-     * the pid has been reused.  We avoid FILE_FLAG_FIRST_PIPE_INSTANCE
-     * because that is only available for Win2k SP2 and WinXP.  */
-    read_pipe = CreateNamedPipeA (pipename, PIPE_ACCESS_INBOUND | dwReadMode, 
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1,   /* max instances */
-                                  psize,        /* output buffer size */
-                                  psize,        /* input buffer size */
-                                  NMPWAIT_USE_DEFAULT_WAIT, sa_ptr);
+      /* Use CreateNamedPipe instead of CreatePipe, because the latter
+       * returns a write handle that does not permit FILE_READ_ATTRIBUTES
+       * access, on versions of win32 earlier than WinXP SP2.
+       * CreatePipe also stupidly creates a full duplex pipe, which is
+       * a waste, since only a single direction is actually used.
+       * It's important to only allow a single instance, to ensure that
+       * the pipe was not created earlier by some other process, even if
+       * the pid has been reused.  We avoid FILE_FLAG_FIRST_PIPE_INSTANCE
+       * because that is only available for Win2k SP2 and WinXP.  */
+      read_pipe = CreateNamedPipeA (pipename, PIPE_ACCESS_INBOUND | 
dwReadMode, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1,        /* max instances */
+                                   psize,      /* output buffer size */
+                                   psize,      /* input buffer size */
+                                   NMPWAIT_USE_DEFAULT_WAIT, sa_ptr);
 
-    if (read_pipe != INVALID_HANDLE_VALUE)
-    {
+      if (read_pipe != INVALID_HANDLE_VALUE)
+       {
 #if DEBUG_PIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe read handle = %p\n",
-                  read_pipe);
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe read handle = %p\n", read_pipe);
 #endif
-      break;
-    }
+         break;
+       }
 
-    DWORD err = GetLastError ();
+      DWORD err = GetLastError ();
 
-    switch (err)
-    {
-    case ERROR_PIPE_BUSY:
-      /* The pipe is already open with compatible parameters.
-       * Pick a new name and retry.  */
+      switch (err)
+       {
+       case ERROR_PIPE_BUSY:
+         /* The pipe is already open with compatible parameters.
+          * Pick a new name and retry.  */
 #if DEBUG_PIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe busy, retrying\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe busy, retrying\n");
 #endif
-      continue;
-    case ERROR_ACCESS_DENIED:
-      /* The pipe is already open with incompatible parameters.
-       * Pick a new name and retry.  */
+         continue;
+       case ERROR_ACCESS_DENIED:
+         /* The pipe is already open with incompatible parameters.
+          * Pick a new name and retry.  */
 #if DEBUG_PIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe access denied, retrying\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe access denied, retrying\n");
 #endif
-      continue;
-    case ERROR_CALL_NOT_IMPLEMENTED:
-      /* We are on an older Win9x platform without named pipes.
-       * Return an anonymous pipe as the best approximation.  */
+         continue;
+       case ERROR_CALL_NOT_IMPLEMENTED:
+         /* We are on an older Win9x platform without named pipes.
+          * Return an anonymous pipe as the best approximation.  */
 #if DEBUG_PIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "CreateNamedPipe not implemented, resorting to "
-                  "CreatePipe: size = %lu\n", psize);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "CreateNamedPipe not implemented, resorting to "
+              "CreatePipe: size = %lu\n", psize);
 #endif
-      if (CreatePipe (read_pipe_ptr, write_pipe_ptr, sa_ptr, psize))
-      {
+         if (CreatePipe (read_pipe_ptr, write_pipe_ptr, sa_ptr, psize))
+           {
 #if DEBUG_PIPE
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe read handle = %p\n",
-                    *read_pipe_ptr);
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe write handle = %p\n",
-                    *write_pipe_ptr);
+             LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe read handle = %p\n",
+                  *read_pipe_ptr);
+             LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe write handle = %p\n",
+                  *write_pipe_ptr);
 #endif
-        return GNUNET_OK;
-      }
-      err = GetLastError ();
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "CreatePipe failed: %d\n", err);
-      return err;
-    default:
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "CreateNamedPipe failed: %d\n", 
err);
-      return err;
+             return GNUNET_OK;
+           }
+         err = GetLastError ();
+         LOG (GNUNET_ERROR_TYPE_ERROR, "CreatePipe failed: %d\n", err);
+         return err;
+       default:
+         LOG (GNUNET_ERROR_TYPE_ERROR, "CreateNamedPipe failed: %d\n", err);
+         return err;
+       }
+      /* NOTREACHED */
     }
-    /* NOTREACHED */
-  }
 #if DEBUG_PIPE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CreateFile: name = %s\n", pipename);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "CreateFile: name = %s\n", pipename);
 #endif
 
   /* Open the named pipe for writing.
    * Be sure to permit FILE_READ_ATTRIBUTES access.  */
-  write_pipe = CreateFileA (pipename, GENERIC_WRITE | FILE_READ_ATTRIBUTES, 0, 
 /* share mode */
-                            sa_ptr, OPEN_EXISTING, dwWriteMode, /* flags and 
attributes */
-                            0); /* handle to template file */
+  write_pipe = CreateFileA (pipename, GENERIC_WRITE | FILE_READ_ATTRIBUTES, 0, 
/* share mode */
+                           sa_ptr, OPEN_EXISTING, dwWriteMode, /* flags and 
attributes */
+                           0); /* handle to template file */
 
   if (write_pipe == INVALID_HANDLE_VALUE)
-  {
-    /* Failure. */
-    DWORD err = GetLastError ();
+    {
+      /* Failure. */
+      DWORD err = GetLastError ();
 
 #if DEBUG_PIPE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "CreateFile failed: %d\n", err);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "CreateFile failed: %d\n", err);
 #endif
-    CloseHandle (read_pipe);
-    return err;
-  }
+      CloseHandle (read_pipe);
+      return err;
+    }
 #if DEBUG_PIPE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pipe write handle = %p\n", write_pipe);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "pipe write handle = %p\n", write_pipe);
 #endif
   /* Success. */
   *read_pipe_ptr = read_pipe;
@@ -1853,7 +1862,7 @@
   struct GNUNET_DISK_FileHandle *fds;
 
   p = GNUNET_malloc (sizeof (struct GNUNET_DISK_PipeHandle) +
-                     2 * sizeof (struct GNUNET_DISK_FileHandle));
+                    2 * sizeof (struct GNUNET_DISK_FileHandle));
   fds = (struct GNUNET_DISK_FileHandle *) &p[1];
   p->fd[0] = &fds[0];
   p->fd[1] = &fds[1];
@@ -1865,13 +1874,13 @@
 
   ret = pipe (fd);
   if (ret == -1)
-  {
-    eno = errno;
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pipe");
-    GNUNET_free (p);
-    errno = eno;
-    return NULL;
-  }
+    {
+      eno = errno;
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe");
+      GNUNET_free (p);
+      errno = eno;
+      return NULL;
+    }
   p->fd[0]->fd = fd[0];
   p->fd[1]->fd = fd[1];
   ret = 0;
@@ -1895,62 +1904,62 @@
   if (0 > fcntl (fd[1], F_SETFD, flags))
     ret = -1;
   if (ret == -1)
-  {
-    eno = errno;
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "fcntl");
-    GNUNET_break (0 == close (p->fd[0]->fd));
-    GNUNET_break (0 == close (p->fd[1]->fd));
-    GNUNET_free (p);
-    errno = eno;
-    return NULL;
-  }
+    {
+      eno = errno;
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fcntl");
+      GNUNET_break (0 == close (p->fd[0]->fd));
+      GNUNET_break (0 == close (p->fd[1]->fd));
+      GNUNET_free (p);
+      errno = eno;
+      return NULL;
+    }
 #else
   BOOL ret;
   HANDLE tmp_handle;
 
   ret =
-      create_selectable_pipe (&p->fd[0]->h, &p->fd[1]->h, NULL, 0,
-                              FILE_FLAG_OVERLAPPED, FILE_FLAG_OVERLAPPED);
+    create_selectable_pipe (&p->fd[0]->h, &p->fd[1]->h, NULL, 0,
+                           FILE_FLAG_OVERLAPPED, FILE_FLAG_OVERLAPPED);
   if (!ret)
-  {
-    GNUNET_free (p);
-    SetErrnoFromWinError (GetLastError ());
-    return NULL;
-  }
+    {
+      GNUNET_free (p);
+      SetErrnoFromWinError (GetLastError ());
+      return NULL;
+    }
   if (!DuplicateHandle
-      (GetCurrentProcess (), p->fd[0]->h, GetCurrentProcess (), &tmp_handle, 0,
-       inherit_read == GNUNET_YES ? TRUE : FALSE, DUPLICATE_SAME_ACCESS))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    CloseHandle (p->fd[0]->h);
-    CloseHandle (p->fd[1]->h);
-    GNUNET_free (p);
-    return NULL;
-  }
+      (GetCurrentProcess (), p->fd[0]->h, GetCurrentProcess (), &tmp_handle,
+       0, inherit_read == GNUNET_YES ? TRUE : FALSE, DUPLICATE_SAME_ACCESS))
+    {
+      SetErrnoFromWinError (GetLastError ());
+      CloseHandle (p->fd[0]->h);
+      CloseHandle (p->fd[1]->h);
+      GNUNET_free (p);
+      return NULL;
+    }
   CloseHandle (p->fd[0]->h);
   p->fd[0]->h = tmp_handle;
 
   if (!DuplicateHandle
-      (GetCurrentProcess (), p->fd[1]->h, GetCurrentProcess (), &tmp_handle, 0,
-       inherit_write == GNUNET_YES ? TRUE : FALSE, DUPLICATE_SAME_ACCESS))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    CloseHandle (p->fd[0]->h);
-    CloseHandle (p->fd[1]->h);
-    GNUNET_free (p);
-    return NULL;
-  }
+      (GetCurrentProcess (), p->fd[1]->h, GetCurrentProcess (), &tmp_handle,
+       0, inherit_write == GNUNET_YES ? TRUE : FALSE, DUPLICATE_SAME_ACCESS))
+    {
+      SetErrnoFromWinError (GetLastError ());
+      CloseHandle (p->fd[0]->h);
+      CloseHandle (p->fd[1]->h);
+      GNUNET_free (p);
+      return NULL;
+    }
   CloseHandle (p->fd[1]->h);
   p->fd[1]->h = tmp_handle;
   if (!blocking)
-  {
-    DWORD mode;
+    {
+      DWORD mode;
 
-    mode = PIPE_NOWAIT;
-    SetNamedPipeHandleState (p->fd[0]->h, &mode, NULL, NULL);
-    SetNamedPipeHandleState (p->fd[1]->h, &mode, NULL, NULL);
-    /* this always fails on Windows 95, so we don't care about error handling 
*/
-  }
+      mode = PIPE_NOWAIT;
+      SetNamedPipeHandleState (p->fd[0]->h, &mode, NULL, NULL);
+      SetNamedPipeHandleState (p->fd[1]->h, &mode, NULL, NULL);
+      /* this always fails on Windows 95, so we don't care about error 
handling */
+    }
   p->fd[0]->type = GNUNET_PIPE;
   p->fd[1]->type = GNUNET_PIPE;
 
@@ -1979,51 +1988,51 @@
  */
 int
 GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
-                            enum GNUNET_DISK_PipeEnd end)
+                           enum GNUNET_DISK_PipeEnd end)
 {
   int ret = GNUNET_OK;
   int save;
 
 #ifdef MINGW
   if (end == GNUNET_DISK_PIPE_END_READ)
-  {
-    if (!CloseHandle (p->fd[0]->h))
     {
-      SetErrnoFromWinError (GetLastError ());
-      ret = GNUNET_SYSERR;
+      if (!CloseHandle (p->fd[0]->h))
+       {
+         SetErrnoFromWinError (GetLastError ());
+         ret = GNUNET_SYSERR;
+       }
+      p->fd[0]->h = INVALID_HANDLE_VALUE;
     }
-    p->fd[0]->h = INVALID_HANDLE_VALUE;
-  }
   else if (end == GNUNET_DISK_PIPE_END_WRITE)
-  {
-    if (!CloseHandle (p->fd[1]->h))
     {
-      SetErrnoFromWinError (GetLastError ());
-      ret = GNUNET_SYSERR;
+      if (!CloseHandle (p->fd[1]->h))
+       {
+         SetErrnoFromWinError (GetLastError ());
+         ret = GNUNET_SYSERR;
+       }
+      p->fd[1]->h = INVALID_HANDLE_VALUE;
     }
-    p->fd[1]->h = INVALID_HANDLE_VALUE;
-  }
   save = errno;
 #else
   save = 0;
   if (end == GNUNET_DISK_PIPE_END_READ)
-  {
-    if (0 != close (p->fd[0]->fd))
     {
-      ret = GNUNET_SYSERR;
-      save = errno;
+      if (0 != close (p->fd[0]->fd))
+       {
+         ret = GNUNET_SYSERR;
+         save = errno;
+       }
+      p->fd[0]->fd = -1;
     }
-    p->fd[0]->fd = -1;
-  }
   else if (end == GNUNET_DISK_PIPE_END_WRITE)
-  {
-    if (0 != close (p->fd[1]->fd))
     {
-      ret = GNUNET_SYSERR;
-      save = errno;
+      if (0 != close (p->fd[1]->fd))
+       {
+         ret = GNUNET_SYSERR;
+         save = errno;
+       }
+      p->fd[1]->fd = -1;
     }
-    p->fd[1]->fd = -1;
-  }
 #endif
   errno = save;
   return ret;
@@ -2043,35 +2052,35 @@
 
 #ifdef MINGW
   if (!CloseHandle (p->fd[0]->h))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    ret = GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      ret = GNUNET_SYSERR;
+    }
   if (!CloseHandle (p->fd[1]->h))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    ret = GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      ret = GNUNET_SYSERR;
+    }
   save = errno;
 #else
   save = 0;
   if (p->fd[0]->fd != -1)
-  {
-    if (0 != close (p->fd[0]->fd))
     {
-      ret = GNUNET_SYSERR;
-      save = errno;
+      if (0 != close (p->fd[0]->fd))
+       {
+         ret = GNUNET_SYSERR;
+         save = errno;
+       }
     }
-  }
 
   if (p->fd[1]->fd != -1)
-  {
-    if (0 != close (p->fd[1]->fd))
     {
-      ret = GNUNET_SYSERR;
-      save = errno;
+      if (0 != close (p->fd[1]->fd))
+       {
+         ret = GNUNET_SYSERR;
+         save = errno;
+       }
     }
-  }
 #endif
   GNUNET_free (p);
   errno = save;
@@ -2088,7 +2097,7 @@
  */
 struct GNUNET_DISK_FileHandle *
 GNUNET_DISK_npipe_create (char **fn, enum GNUNET_DISK_OpenFlags flags,
-                          enum GNUNET_DISK_AccessPermissions perm)
+                         enum GNUNET_DISK_AccessPermissions perm)
 {
 #ifdef MINGW
   struct GNUNET_DISK_FileHandle *ret;
@@ -2108,70 +2117,71 @@
     openMode |= FILE_FLAG_FIRST_PIPE_INSTANCE;
 
   while (h == NULL)
-  {
-    DWORD error_code;
+    {
+      DWORD error_code;
 
-    name = NULL;
-    if (*fn != NULL)
-    {
-      GNUNET_asprintf (&name, "\\\\.\\pipe\\%.246s", fn);
+      name = NULL;
+      if (*fn != NULL)
+       {
+         GNUNET_asprintf (&name, "\\\\.\\pipe\\%.246s", fn);
 #if DEBUG_NPIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Trying to create an instance of named pipe `%s'\n", name);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Trying to create an instance of named pipe `%s'\n", name);
 #endif
-      h = CreateNamedPipe (name, openMode | FILE_FLAG_OVERLAPPED,
-                           PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 2, 1, 1, 0,
-                           NULL);
-    }
-    else
-    {
-      GNUNET_asprintf (fn, "\\\\.\\pipe\\gnunet-%llu",
-                       GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
-                                                 UINT64_MAX));
+         h = CreateNamedPipe (name, openMode | FILE_FLAG_OVERLAPPED,
+                              PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 2, 1, 1,
+                              0, NULL);
+       }
+      else
+       {
+         GNUNET_asprintf (fn, "\\\\.\\pipe\\gnunet-%llu",
+                          GNUNET_CRYPTO_random_u64
+                          (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX));
 #if DEBUG_NPIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Trying to create unique named pipe `%s'\n", *fn);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Trying to create unique named pipe `%s'\n", *fn);
 #endif
-      h = CreateNamedPipe (*fn,
-                           openMode | FILE_FLAG_OVERLAPPED |
-                           FILE_FLAG_FIRST_PIPE_INSTANCE,
-                           PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 2, 1, 1, 0,
-                           NULL);
-    }
-    error_code = GetLastError ();
-    if (name)
-      GNUNET_free (name);
-    /* don't re-set name to NULL yet */
-    if (h == INVALID_HANDLE_VALUE)
-    {
-      SetErrnoFromWinError (error_code);
+         h = CreateNamedPipe (*fn,
+                              openMode | FILE_FLAG_OVERLAPPED |
+                              FILE_FLAG_FIRST_PIPE_INSTANCE,
+                              PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 2, 1, 1,
+                              0, NULL);
+       }
+      error_code = GetLastError ();
+      if (name)
+       GNUNET_free (name);
+      /* don't re-set name to NULL yet */
+      if (h == INVALID_HANDLE_VALUE)
+       {
+         SetErrnoFromWinError (error_code);
 #if DEBUG_NPIPE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Pipe creation have failed because of %d, errno is %d\n",
-                  error_code, errno);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Pipe creation have failed because of %d, errno is %d\n",
+              error_code, errno);
 #endif
-      if (name == NULL)
-      {
+         if (name == NULL)
+           {
 #if DEBUG_NPIPE
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Pipe was to be unique, considering re-creation\n");
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "Pipe was to be unique, considering re-creation\n");
 #endif
-        GNUNET_free (*fn);
-        *fn = NULL;
-        if (error_code != ERROR_ACCESS_DENIED && error_code != ERROR_PIPE_BUSY)
-        {
-          return NULL;
-        }
+             GNUNET_free (*fn);
+             *fn = NULL;
+             if (error_code != ERROR_ACCESS_DENIED
+                 && error_code != ERROR_PIPE_BUSY)
+               {
+                 return NULL;
+               }
 #if DEBUG_NPIPE
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Pipe name was not unique, trying again\n");
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "Pipe name was not unique, trying again\n");
 #endif
-        h = NULL;
-      }
-      else
-        return NULL;
+             h = NULL;
+           }
+         else
+           return NULL;
+       }
     }
-  }
   errno = 0;
 
   ret = GNUNET_malloc (sizeof (*ret));
@@ -2187,22 +2197,22 @@
   return ret;
 #else
   if (*fn == NULL)
-  {
-    char dir[] = "/tmp/gnunet-pipe-XXXXXX";
+    {
+      char dir[] = "/tmp/gnunet-pipe-XXXXXX";
 
-    if (mkdtemp (dir) == NULL)
-    {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "mkdtemp");
-      return NULL;
+      if (mkdtemp (dir) == NULL)
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "mkdtemp");
+         return NULL;
+       }
+      GNUNET_asprintf (fn, "%s/child-control", dir);
     }
-    GNUNET_asprintf (fn, "%s/child-control", dir);
-  }
 
   if (mkfifo (*fn, translate_unix_perms (perm)) == -1)
-  {
-    if ((errno != EEXIST) || (0 != (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)))
-      return NULL;
-  }
+    {
+      if ((errno != EEXIST) || (0 != (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)))
+       return NULL;
+    }
 
   flags = flags & (~GNUNET_DISK_OPEN_FAILIFEXISTS);
   return GNUNET_DISK_file_open (*fn, flags, perm);
@@ -2220,7 +2230,7 @@
  */
 struct GNUNET_DISK_FileHandle *
 GNUNET_DISK_npipe_open (const char *fn, enum GNUNET_DISK_OpenFlags flags,
-                        enum GNUNET_DISK_AccessPermissions perm)
+                       enum GNUNET_DISK_AccessPermissions perm)
 {
 #ifdef MINGW
   struct GNUNET_DISK_FileHandle *ret;
@@ -2236,12 +2246,12 @@
     openMode = GENERIC_WRITE;
 
   h = CreateFile (fn, openMode, 0, NULL, OPEN_EXISTING,
-                  FILE_FLAG_OVERLAPPED | FILE_READ_ATTRIBUTES, NULL);
+                 FILE_FLAG_OVERLAPPED | FILE_READ_ATTRIBUTES, NULL);
   if (h == INVALID_HANDLE_VALUE)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    return NULL;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      return NULL;
+    }
 
   ret = GNUNET_malloc (sizeof (*ret));
   ret->h = h;
@@ -2273,10 +2283,10 @@
 
   ret = CloseHandle (pipe->h);
   if (!ret)
-  {
-    SetErrnoFromWinError (GetLastError ());
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      return GNUNET_SYSERR;
+    }
   else
     return GNUNET_OK;
 #endif
@@ -2292,17 +2302,17 @@
  */
 const struct GNUNET_DISK_FileHandle *
 GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p,
-                         enum GNUNET_DISK_PipeEnd n)
+                        enum GNUNET_DISK_PipeEnd n)
 {
   switch (n)
-  {
-  case GNUNET_DISK_PIPE_END_READ:
-  case GNUNET_DISK_PIPE_END_WRITE:
-    return p->fd[n];
-  default:
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+    case GNUNET_DISK_PIPE_END_READ:
+    case GNUNET_DISK_PIPE_END_WRITE:
+      return p->fd[n];
+    default:
+      GNUNET_break (0);
+      return NULL;
+    }
 }
 
 
@@ -2316,7 +2326,7 @@
  */
 int
 GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh,
-                                   void *dst, size_t dst_len)
+                                  void *dst, size_t dst_len)
 {
 #ifdef MINGW
   if (dst_len < sizeof (HANDLE))

Modified: gnunet/src/util/getopt.c
===================================================================
--- gnunet/src/util/getopt.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/getopt.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -49,6 +49,10 @@
 #endif
 #endif
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 #if defined (WIN32) && !defined (__CYGWIN32__)
 /* It's not Unix, really.  See?  Capital letters.  */
 #include <windows.h>
@@ -194,20 +198,19 @@
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
 
-char *
-getenv ();
+char *getenv ();
 
 static char *
 my_index (str, chr)
-  const char *str;
-  int chr;
+     const char *str;
+     int chr;
 {
   while (*str)
-  {
-    if (*str == chr)
-      return (char *) str;
-    str++;
-  }
+    {
+      if (*str == chr)
+       return (char *) str;
+      str++;
+    }
   return 0;
 }
 
@@ -219,8 +222,7 @@
 #if !defined (__STDC__) || !__STDC__
 /* gcc with -traditional declares the built-in strlen to return int,
    and has done so at least since version 2.4.5. -- rms.  */
-extern int
-strlen (const char *);
+extern int strlen (const char *);
 #endif /* not __STDC__ */
 #endif /* __GNUC__ */
 
@@ -254,7 +256,7 @@
    is valid for the getopt call we must make sure that the ARGV passed
    to getopt is that one passed to the process.  */
 static void
-    __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv)
+  __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv)
 {
   /* XXX This is no good solution.  We should rather copy the args so
    * that we can compare them later.  But we must not use malloc(3).  */
@@ -285,13 +287,12 @@
    the new indices of the non-options in ARGV after they are moved.  */
 
 #if defined (__STDC__) && __STDC__
-static void
-exchange (char **);
+static void exchange (char **);
 #endif
 
 static void
 exchange (argv)
-  char **argv;
+     char **argv;
 {
   int bottom = first_nonopt;
   int middle = last_nonopt;
@@ -308,61 +309,61 @@
    * string can work normally.  Our top argument must be in the range
    * of the string.  */
   if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
-  {
-    /* We must extend the array.  The user plays games with us and
-     * presents new arguments.  */
-    char *new_str = malloc (top + 1);
+    {
+      /* We must extend the array.  The user plays games with us and
+       * presents new arguments.  */
+      char *new_str = malloc (top + 1);
 
-    if (new_str == NULL)
-      nonoption_flags_len = nonoption_flags_max_len = 0;
-    else
-    {
-      memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
-      memset (&new_str[nonoption_flags_max_len], '\0',
-              top + 1 - nonoption_flags_max_len);
-      nonoption_flags_max_len = top + 1;
-      __getopt_nonoption_flags = new_str;
+      if (new_str == NULL)
+       nonoption_flags_len = nonoption_flags_max_len = 0;
+      else
+       {
+         memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
+         memset (&new_str[nonoption_flags_max_len], '\0',
+                 top + 1 - nonoption_flags_max_len);
+         nonoption_flags_max_len = top + 1;
+         __getopt_nonoption_flags = new_str;
+       }
     }
-  }
 #endif
 
   while (top > middle && middle > bottom)
-  {
-    if (top - middle > middle - bottom)
     {
-      /* Bottom segment is the short one.  */
-      int len = middle - bottom;
-      register int i;
+      if (top - middle > middle - bottom)
+       {
+         /* Bottom segment is the short one.  */
+         int len = middle - bottom;
+         register int i;
 
-      /* Swap it with the top part of the top segment.  */
-      for (i = 0; i < len; i++)
-      {
-        tem = argv[bottom + i];
-        argv[bottom + i] = argv[top - (middle - bottom) + i];
-        argv[top - (middle - bottom) + i] = tem;
-        SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-      }
-      /* Exclude the moved bottom segment from further swapping.  */
-      top -= len;
-    }
-    else
-    {
-      /* Top segment is the short one.  */
-      int len = top - middle;
-      register int i;
+         /* Swap it with the top part of the top segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[top - (middle - bottom) + i];
+             argv[top - (middle - bottom) + i] = tem;
+             SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+           }
+         /* Exclude the moved bottom segment from further swapping.  */
+         top -= len;
+       }
+      else
+       {
+         /* Top segment is the short one.  */
+         int len = top - middle;
+         register int i;
 
-      /* Swap it with the bottom part of the bottom segment.  */
-      for (i = 0; i < len; i++)
-      {
-        tem = argv[bottom + i];
-        argv[bottom + i] = argv[middle + i];
-        argv[middle + i] = tem;
-        SWAP_FLAGS (bottom + i, middle + i);
-      }
-      /* Exclude the moved top segment from further swapping.  */
-      bottom += len;
+         /* Swap it with the bottom part of the bottom segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[middle + i];
+             argv[middle + i] = tem;
+             SWAP_FLAGS (bottom + i, middle + i);
+           }
+         /* Exclude the moved top segment from further swapping.  */
+         bottom += len;
+       }
     }
-  }
 
   /* Update records for the slots the non-options now occupy.  */
 
@@ -373,14 +374,13 @@
 /* Initialize the internal data when the first call is made.  */
 
 #if defined (__STDC__) && __STDC__
-static const char *
-_getopt_initialize (int, char *const *, const char *);
+static const char *_getopt_initialize (int, char *const *, const char *);
 #endif
 static const char *
 _getopt_initialize (argc, argv, optstring)
-  int argc;
-  char *const *argv;
-  const char *optstring;
+     int argc;
+     char *const *argv;
+     const char *optstring;
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
    * is the program name); the sequence of previously skipped
@@ -395,48 +395,50 @@
   /* Determine how to handle the ordering of options and nonoptions.  */
 
   if (optstring[0] == '-')
-  {
-    ordering = RETURN_IN_ORDER;
-    ++optstring;
-  }
+    {
+      ordering = RETURN_IN_ORDER;
+      ++optstring;
+    }
   else if (optstring[0] == '+')
-  {
-    ordering = REQUIRE_ORDER;
-    ++optstring;
-  }
+    {
+      ordering = REQUIRE_ORDER;
+      ++optstring;
+    }
   else if (posixly_correct != NULL)
     ordering = REQUIRE_ORDER;
   else
     ordering = PERMUTE;
 
 #ifdef _LIBC
-  if (posixly_correct == NULL && argc == original_argc && argv == 
original_argv)
-  {
-    if (nonoption_flags_max_len == 0)
+  if (posixly_correct == NULL && argc == original_argc
+      && argv == original_argv)
     {
-      if (__getopt_nonoption_flags == NULL ||
-          __getopt_nonoption_flags[0] == '\0')
-        nonoption_flags_max_len = -1;
-      else
-      {
-        const char *orig_str = __getopt_nonoption_flags;
-        int len = nonoption_flags_max_len = strlen (orig_str);
+      if (nonoption_flags_max_len == 0)
+       {
+         if (__getopt_nonoption_flags == NULL ||
+             __getopt_nonoption_flags[0] == '\0')
+           nonoption_flags_max_len = -1;
+         else
+           {
+             const char *orig_str = __getopt_nonoption_flags;
+             int len = nonoption_flags_max_len = strlen (orig_str);
 
-        if (nonoption_flags_max_len < argc)
-          nonoption_flags_max_len = argc;
-        __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len);
-        if (__getopt_nonoption_flags == NULL)
-          nonoption_flags_max_len = -1;
-        else
-        {
-          memcpy (__getopt_nonoption_flags, orig_str, len);
-          memset (&__getopt_nonoption_flags[len], '\0',
-                  nonoption_flags_max_len - len);
-        }
-      }
+             if (nonoption_flags_max_len < argc)
+               nonoption_flags_max_len = argc;
+             __getopt_nonoption_flags =
+               (char *) malloc (nonoption_flags_max_len);
+             if (__getopt_nonoption_flags == NULL)
+               nonoption_flags_max_len = -1;
+             else
+               {
+                 memcpy (__getopt_nonoption_flags, orig_str, len);
+                 memset (&__getopt_nonoption_flags[len], '\0',
+                         nonoption_flags_max_len - len);
+               }
+           }
+       }
+      nonoption_flags_len = nonoption_flags_max_len;
     }
-    nonoption_flags_len = nonoption_flags_max_len;
-  }
   else
     nonoption_flags_len = 0;
 #endif
@@ -502,8 +504,8 @@
 
 static int
 GN_getopt_internal (int argc, char *const *argv, const char *optstring,
-                    const struct GNoption *longopts, int *longind,
-                    int long_only)
+                   const struct GNoption *longopts, int *longind,
+                   int long_only)
 {
   static int __getopt_initialized = 0;
   static int GNopterr = 1;
@@ -511,12 +513,12 @@
   GNoptarg = NULL;
 
   if (GNoptind == 0 || !__getopt_initialized)
-  {
-    if (GNoptind == 0)
-      GNoptind = 1;             /* Don't scan ARGV[0], the program name.  */
-    optstring = _getopt_initialize (argc, argv, optstring);
-    __getopt_initialized = 1;
-  }
+    {
+      if (GNoptind == 0)
+       GNoptind = 1;           /* Don't scan ARGV[0], the program name.  */
+      optstring = _getopt_initialize (argc, argv, optstring);
+      __getopt_initialized = 1;
+    }
 
   /* Test whether ARGV[GNoptind] points to a non-option argument.
    * Either it does not have option syntax, or there is an environment flag
@@ -531,80 +533,80 @@
 #endif
 
   if (nextchar == NULL || *nextchar == '\0')
-  {
-    /* Advance to the next ARGV-element.  */
+    {
+      /* Advance to the next ARGV-element.  */
 
-    /* Give FIRST_NONOPT & LAST_NONOPT rational values if GNoptind has been
-     * moved back by the user (who may also have changed the arguments).  */
-    if (last_nonopt > GNoptind)
-      last_nonopt = GNoptind;
-    if (first_nonopt > GNoptind)
-      first_nonopt = GNoptind;
+      /* Give FIRST_NONOPT & LAST_NONOPT rational values if GNoptind has been
+       * moved back by the user (who may also have changed the arguments).  */
+      if (last_nonopt > GNoptind)
+       last_nonopt = GNoptind;
+      if (first_nonopt > GNoptind)
+       first_nonopt = GNoptind;
 
-    if (ordering == PERMUTE)
-    {
-      /* If we have just processed some options following some non-options,
-       * exchange them so that the options come first.  */
+      if (ordering == PERMUTE)
+       {
+         /* If we have just processed some options following some non-options,
+          * exchange them so that the options come first.  */
 
-      if (first_nonopt != last_nonopt && last_nonopt != GNoptind)
-        exchange ((char **) argv);
-      else if (last_nonopt != GNoptind)
-        first_nonopt = GNoptind;
+         if (first_nonopt != last_nonopt && last_nonopt != GNoptind)
+           exchange ((char **) argv);
+         else if (last_nonopt != GNoptind)
+           first_nonopt = GNoptind;
 
-      /* Skip any additional non-options
-       * and extend the range of non-options previously skipped.  */
+         /* Skip any additional non-options
+          * and extend the range of non-options previously skipped.  */
 
-      while (GNoptind < argc && NONOPTION_P)
-        GNoptind++;
-      last_nonopt = GNoptind;
-    }
+         while (GNoptind < argc && NONOPTION_P)
+           GNoptind++;
+         last_nonopt = GNoptind;
+       }
 
-    /* The special ARGV-element `--' means premature end of options.
-     * Skip it like a null option,
-     * then exchange with previous non-options as if it were an option,
-     * then skip everything else like a non-option.  */
-    if (GNoptind != argc && !strcmp (argv[GNoptind], "--"))
-    {
-      GNoptind++;
+      /* The special ARGV-element `--' means premature end of options.
+       * Skip it like a null option,
+       * then exchange with previous non-options as if it were an option,
+       * then skip everything else like a non-option.  */
+      if (GNoptind != argc && !strcmp (argv[GNoptind], "--"))
+       {
+         GNoptind++;
 
-      if (first_nonopt != last_nonopt && last_nonopt != GNoptind)
-        exchange ((char **) argv);
-      else if (first_nonopt == last_nonopt)
-        first_nonopt = GNoptind;
-      last_nonopt = argc;
+         if (first_nonopt != last_nonopt && last_nonopt != GNoptind)
+           exchange ((char **) argv);
+         else if (first_nonopt == last_nonopt)
+           first_nonopt = GNoptind;
+         last_nonopt = argc;
 
-      GNoptind = argc;
-    }
+         GNoptind = argc;
+       }
 
-    /* If we have done all the ARGV-elements, stop the scan
-     * and back over any non-options that we skipped and permuted.  */
+      /* If we have done all the ARGV-elements, stop the scan
+       * and back over any non-options that we skipped and permuted.  */
 
-    if (GNoptind == argc)
-    {
-      /* Set the next-arg-index to point at the non-options
-       * that we previously skipped, so the caller will digest them.  */
-      if (first_nonopt != last_nonopt)
-        GNoptind = first_nonopt;
-      return -1;
-    }
+      if (GNoptind == argc)
+       {
+         /* Set the next-arg-index to point at the non-options
+          * that we previously skipped, so the caller will digest them.  */
+         if (first_nonopt != last_nonopt)
+           GNoptind = first_nonopt;
+         return -1;
+       }
 
-    /* If we have come to a non-option and did not permute it,
-     * either stop the scan or describe it to the caller and pass it by.  */
+      /* If we have come to a non-option and did not permute it,
+       * either stop the scan or describe it to the caller and pass it by.  */
 
-    if (NONOPTION_P)
-    {
-      if (ordering == REQUIRE_ORDER)
-        return -1;
-      GNoptarg = argv[GNoptind++];
-      return 1;
-    }
+      if (NONOPTION_P)
+       {
+         if (ordering == REQUIRE_ORDER)
+           return -1;
+         GNoptarg = argv[GNoptind++];
+         return 1;
+       }
 
-    /* We have found another option-ARGV-element.
-     * Skip the initial punctuation.  */
+      /* We have found another option-ARGV-element.
+       * Skip the initial punctuation.  */
 
-    nextchar =
-        (argv[GNoptind] + 1 + (longopts != NULL && argv[GNoptind][1] == '-'));
-  }
+      nextchar =
+       (argv[GNoptind] + 1 + (longopts != NULL && argv[GNoptind][1] == '-'));
+    }
 
   /* Decode the current option-ARGV-element.  */
 
@@ -624,134 +626,138 @@
   if (longopts != NULL &&
       (argv[GNoptind][1] == '-' ||
        (long_only &&
-        (argv[GNoptind][2] || !my_index (optstring, argv[GNoptind][1])))))
-  {
-    char *nameend;
-    const struct GNoption *p;
-    const struct GNoption *pfound = NULL;
-    int exact = 0;
-    int ambig = 0;
-    int indfound = -1;
-    int option_index;
+       (argv[GNoptind][2] || !my_index (optstring, argv[GNoptind][1])))))
+    {
+      char *nameend;
+      const struct GNoption *p;
+      const struct GNoption *pfound = NULL;
+      int exact = 0;
+      int ambig = 0;
+      int indfound = -1;
+      int option_index;
 
-    for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
-      /* Do nothing.  */ ;
+      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+       /* Do nothing.  */ ;
 
-    /* Test all long options for either exact match
-     * or abbreviated matches.  */
-    for (p = longopts, option_index = 0; p->name; p++, option_index++)
-      if (!strncmp (p->name, nextchar, nameend - nextchar))
-      {
-        if ((unsigned int) (nameend - nextchar) ==
-            (unsigned int) strlen (p->name))
-        {
-          /* Exact match found.  */
-          pfound = p;
-          indfound = option_index;
-          exact = 1;
-          break;
-        }
-        else if (pfound == NULL)
-        {
-          /* First nonexact match found.  */
-          pfound = p;
-          indfound = option_index;
-        }
-        else
-          /* Second or later nonexact match found.  */
-          ambig = 1;
-      }
+      /* Test all long options for either exact match
+       * or abbreviated matches.  */
+      for (p = longopts, option_index = 0; p->name; p++, option_index++)
+       if (!strncmp (p->name, nextchar, nameend - nextchar))
+         {
+           if ((unsigned int) (nameend - nextchar) ==
+               (unsigned int) strlen (p->name))
+             {
+               /* Exact match found.  */
+               pfound = p;
+               indfound = option_index;
+               exact = 1;
+               break;
+             }
+           else if (pfound == NULL)
+             {
+               /* First nonexact match found.  */
+               pfound = p;
+               indfound = option_index;
+             }
+           else
+             /* Second or later nonexact match found.  */
+             ambig = 1;
+         }
 
-    if (ambig && !exact)
-    {
-      if (GNopterr)
-        fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
-                 argv[GNoptind]);
-      nextchar += strlen (nextchar);
-      GNoptind++;
-      return '?';
-    }
+      if (ambig && !exact)
+       {
+         if (GNopterr)
+           fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
+                    argv[GNoptind]);
+         nextchar += strlen (nextchar);
+         GNoptind++;
+         return '?';
+       }
 
-    if (pfound != NULL)
-    {
-      option_index = indfound;
-      GNoptind++;
-      if (*nameend)
-      {
-        /* Don't test has_arg with >, because some C compilers don't
-         * allow it to be used on enums.  */
-        if (pfound->has_arg)
-          GNoptarg = nameend + 1;
-        else
-        {
-          if (GNopterr)
-          {
-            if (argv[GNoptind - 1][1] == '-')
-              /* --option */
-              fprintf (stderr,
-                       _("%s: option `--%s' does not allow an argument\n"),
-                       argv[0], pfound->name);
-            else
-              /* +option or -option */
-              fprintf (stderr,
-                       _("%s: option `%c%s' does not allow an argument\n"),
-                       argv[0], argv[GNoptind - 1][0], pfound->name);
-          }
-          nextchar += strlen (nextchar);
-          return '?';
-        }
-      }
-      else if (pfound->has_arg == 1)
-      {
-        if (GNoptind < argc)
-        {
-          GNoptarg = argv[GNoptind++];
-        }
-        else
-        {
-          if (GNopterr)
-          {
-            fprintf (stderr, _("%s: option `%s' requires an argument\n"),
-                     argv[0], argv[GNoptind - 1]);
-          }
-          nextchar += strlen (nextchar);
-          return (optstring[0] == ':') ? ':' : '?';
-        }
-      }
-      nextchar += strlen (nextchar);
-      if (longind != NULL)
-        *longind = option_index;
-      if (pfound->flag)
-      {
-        *(pfound->flag) = pfound->val;
-        return 0;
-      }
-      return pfound->val;
-    }
+      if (pfound != NULL)
+       {
+         option_index = indfound;
+         GNoptind++;
+         if (*nameend)
+           {
+             /* Don't test has_arg with >, because some C compilers don't
+              * allow it to be used on enums.  */
+             if (pfound->has_arg)
+               GNoptarg = nameend + 1;
+             else
+               {
+                 if (GNopterr)
+                   {
+                     if (argv[GNoptind - 1][1] == '-')
+                       /* --option */
+                       fprintf (stderr,
+                                _
+                                ("%s: option `--%s' does not allow an 
argument\n"),
+                                argv[0], pfound->name);
+                     else
+                       /* +option or -option */
+                       fprintf (stderr,
+                                _
+                                ("%s: option `%c%s' does not allow an 
argument\n"),
+                                argv[0], argv[GNoptind - 1][0],
+                                pfound->name);
+                   }
+                 nextchar += strlen (nextchar);
+                 return '?';
+               }
+           }
+         else if (pfound->has_arg == 1)
+           {
+             if (GNoptind < argc)
+               {
+                 GNoptarg = argv[GNoptind++];
+               }
+             else
+               {
+                 if (GNopterr)
+                   {
+                     fprintf (stderr,
+                              _("%s: option `%s' requires an argument\n"),
+                              argv[0], argv[GNoptind - 1]);
+                   }
+                 nextchar += strlen (nextchar);
+                 return (optstring[0] == ':') ? ':' : '?';
+               }
+           }
+         nextchar += strlen (nextchar);
+         if (longind != NULL)
+           *longind = option_index;
+         if (pfound->flag)
+           {
+             *(pfound->flag) = pfound->val;
+             return 0;
+           }
+         return pfound->val;
+       }
 
-    /* Can't find it as a long option.  If this is not getopt_long_only,
-     * or the option starts with '--' or is not a valid short
-     * option, then it's an error.
-     * Otherwise interpret it as a short option.  */
-    if (!long_only || argv[GNoptind][1] == '-' ||
-        my_index (optstring, *nextchar) == NULL)
-    {
-      if (GNopterr)
-      {
-        if (argv[GNoptind][1] == '-')
-          /* --option */
-          fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0],
-                   nextchar);
-        else
-          /* +option or -option */
-          fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0],
-                   argv[GNoptind][0], nextchar);
-      }
-      nextchar = (char *) "";
-      GNoptind++;
-      return '?';
+      /* Can't find it as a long option.  If this is not getopt_long_only,
+       * or the option starts with '--' or is not a valid short
+       * option, then it's an error.
+       * Otherwise interpret it as a short option.  */
+      if (!long_only || argv[GNoptind][1] == '-' ||
+         my_index (optstring, *nextchar) == NULL)
+       {
+         if (GNopterr)
+           {
+             if (argv[GNoptind][1] == '-')
+               /* --option */
+               fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+                        argv[0], nextchar);
+             else
+               /* +option or -option */
+               fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+                        argv[0], argv[GNoptind][0], nextchar);
+           }
+         nextchar = (char *) "";
+         GNoptind++;
+         return '?';
+       }
     }
-  }
 
   /* Look at and handle the next short option-character.  */
 
@@ -764,191 +770,193 @@
       ++GNoptind;
 
     if (temp == NULL || c == ':')
-    {
-      if (GNopterr)
       {
-        if (posixly_correct)
-          /* 1003.2 specifies the format of this message.  */
-          fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
-        else
-          fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
+       if (GNopterr)
+         {
+           if (posixly_correct)
+             /* 1003.2 specifies the format of this message.  */
+             fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
+           else
+             fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
+         }
+       return '?';
       }
-      return '?';
-    }
     /* Convenience. Treat POSIX -W foo same as long option --foo */
     if (temp[0] == 'W' && temp[1] == ';')
-    {
-      char *nameend;
-      const struct GNoption *p;
-      const struct GNoption *pfound = NULL;
-      int exact = 0;
-      int ambig = 0;
-      int indfound = 0;
-      int option_index;
-
-      /* This is an option that requires an argument.  */
-      if (*nextchar != '\0')
       {
-        GNoptarg = nextchar;
-        /* If we end this ARGV-element by taking the rest as an arg,
-         * we must advance to the next element now.  */
-        GNoptind++;
-      }
-      else if (GNoptind == argc)
-      {
-        if (GNopterr)
-        {
-          /* 1003.2 specifies the format of this message.  */
-          fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-                   argv[0], c);
-        }
-        if (optstring[0] == ':')
-          c = ':';
-        else
-          c = '?';
-        return c;
-      }
-      else
-        /* We already incremented `GNoptind' once;
-         * increment it again when taking next ARGV-elt as argument.  */
-        GNoptarg = argv[GNoptind++];
+       char *nameend;
+       const struct GNoption *p;
+       const struct GNoption *pfound = NULL;
+       int exact = 0;
+       int ambig = 0;
+       int indfound = 0;
+       int option_index;
 
-      /* GNoptarg is now the argument, see if it's in the
-       * table of longopts.  */
+       /* This is an option that requires an argument.  */
+       if (*nextchar != '\0')
+         {
+           GNoptarg = nextchar;
+           /* If we end this ARGV-element by taking the rest as an arg,
+            * we must advance to the next element now.  */
+           GNoptind++;
+         }
+       else if (GNoptind == argc)
+         {
+           if (GNopterr)
+             {
+               /* 1003.2 specifies the format of this message.  */
+               fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+                        argv[0], c);
+             }
+           if (optstring[0] == ':')
+             c = ':';
+           else
+             c = '?';
+           return c;
+         }
+       else
+         /* We already incremented `GNoptind' once;
+          * increment it again when taking next ARGV-elt as argument.  */
+         GNoptarg = argv[GNoptind++];
 
-      for (nextchar = nameend = GNoptarg; *nameend && *nameend != '=';
-           nameend++)
-        /* Do nothing.  */ ;
+       /* GNoptarg is now the argument, see if it's in the
+        * table of longopts.  */
 
-      /* Test all long options for either exact match
-       * or abbreviated matches.  */
-      if (longopts != NULL)
-        for (p = longopts, option_index = 0; p->name; p++, option_index++)
-          if (!strncmp (p->name, nextchar, nameend - nextchar))
-          {
-            if ((unsigned int) (nameend - nextchar) == strlen (p->name))
-            {
-              /* Exact match found.  */
-              pfound = p;
-              indfound = option_index;
-              exact = 1;
-              break;
-            }
-            else if (pfound == NULL)
-            {
-              /* First nonexact match found.  */
-              pfound = p;
-              indfound = option_index;
-            }
-            else
-              /* Second or later nonexact match found.  */
-              ambig = 1;
-          }
-      if (ambig && !exact)
-      {
-        if (GNopterr)
-          fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0],
-                   argv[GNoptind]);
-        nextchar += strlen (nextchar);
-        GNoptind++;
-        return '?';
-      }
-      if (pfound != NULL)
-      {
-        option_index = indfound;
-        if (*nameend)
-        {
-          /* Don't test has_arg with >, because some C compilers don't
-           * allow it to be used on enums.  */
-          if (pfound->has_arg)
-            GNoptarg = nameend + 1;
-          else
-          {
-            if (GNopterr)
-              fprintf (stderr, _("\
+       for (nextchar = nameend = GNoptarg; *nameend && *nameend != '=';
+            nameend++)
+         /* Do nothing.  */ ;
+
+       /* Test all long options for either exact match
+        * or abbreviated matches.  */
+       if (longopts != NULL)
+         for (p = longopts, option_index = 0; p->name; p++, option_index++)
+           if (!strncmp (p->name, nextchar, nameend - nextchar))
+             {
+               if ((unsigned int) (nameend - nextchar) == strlen (p->name))
+                 {
+                   /* Exact match found.  */
+                   pfound = p;
+                   indfound = option_index;
+                   exact = 1;
+                   break;
+                 }
+               else if (pfound == NULL)
+                 {
+                   /* First nonexact match found.  */
+                   pfound = p;
+                   indfound = option_index;
+                 }
+               else
+                 /* Second or later nonexact match found.  */
+                 ambig = 1;
+             }
+       if (ambig && !exact)
+         {
+           if (GNopterr)
+             fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+                      argv[0], argv[GNoptind]);
+           nextchar += strlen (nextchar);
+           GNoptind++;
+           return '?';
+         }
+       if (pfound != NULL)
+         {
+           option_index = indfound;
+           if (*nameend)
+             {
+               /* Don't test has_arg with >, because some C compilers don't
+                * allow it to be used on enums.  */
+               if (pfound->has_arg)
+                 GNoptarg = nameend + 1;
+               else
+                 {
+                   if (GNopterr)
+                     fprintf (stderr, _("\
 %s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name);
 
-            nextchar += strlen (nextchar);
-            return '?';
-          }
-        }
-        else if (pfound->has_arg == 1)
-        {
-          if (GNoptind < argc)
-            GNoptarg = argv[GNoptind++];
-          else
-          {
-            if (GNopterr)
-              fprintf (stderr, _("%s: option `%s' requires an argument\n"),
-                       argv[0], argv[GNoptind - 1]);
-            nextchar += strlen (nextchar);
-            return optstring[0] == ':' ? ':' : '?';
-          }
-        }
-        nextchar += strlen (nextchar);
-        if (longind != NULL)
-          *longind = option_index;
-        if (pfound->flag)
-        {
-          *(pfound->flag) = pfound->val;
-          return 0;
-        }
-        return pfound->val;
+                   nextchar += strlen (nextchar);
+                   return '?';
+                 }
+             }
+           else if (pfound->has_arg == 1)
+             {
+               if (GNoptind < argc)
+                 GNoptarg = argv[GNoptind++];
+               else
+                 {
+                   if (GNopterr)
+                     fprintf (stderr,
+                              _("%s: option `%s' requires an argument\n"),
+                              argv[0], argv[GNoptind - 1]);
+                   nextchar += strlen (nextchar);
+                   return optstring[0] == ':' ? ':' : '?';
+                 }
+             }
+           nextchar += strlen (nextchar);
+           if (longind != NULL)
+             *longind = option_index;
+           if (pfound->flag)
+             {
+               *(pfound->flag) = pfound->val;
+               return 0;
+             }
+           return pfound->val;
+         }
+       nextchar = NULL;
+       return 'W';             /* Let the application handle it.   */
       }
-      nextchar = NULL;
-      return 'W';               /* Let the application handle it.   */
-    }
     if (temp[1] == ':')
-    {
-      if (temp[2] == ':')
       {
-        /* This is an option that accepts an argument optionally.  */
-        if (*nextchar != '\0')
-        {
-          GNoptarg = nextchar;
-          GNoptind++;
-        }
-        else
-          GNoptarg = NULL;
-        nextchar = NULL;
+       if (temp[2] == ':')
+         {
+           /* This is an option that accepts an argument optionally.  */
+           if (*nextchar != '\0')
+             {
+               GNoptarg = nextchar;
+               GNoptind++;
+             }
+           else
+             GNoptarg = NULL;
+           nextchar = NULL;
+         }
+       else
+         {
+           /* This is an option that requires an argument.  */
+           if (*nextchar != '\0')
+             {
+               GNoptarg = nextchar;
+               /* If we end this ARGV-element by taking the rest as an arg,
+                * we must advance to the next element now.  */
+               GNoptind++;
+             }
+           else if (GNoptind == argc)
+             {
+               if (GNopterr)
+                 {
+                   /* 1003.2 specifies the format of this message.  */
+                   fprintf (stderr,
+                            _("%s: option requires an argument -- %c\n"),
+                            argv[0], c);
+                 }
+               if (optstring[0] == ':')
+                 c = ':';
+               else
+                 c = '?';
+             }
+           else
+             /* We already incremented `GNoptind' once;
+              * increment it again when taking next ARGV-elt as argument.  */
+             GNoptarg = argv[GNoptind++];
+           nextchar = NULL;
+         }
       }
-      else
-      {
-        /* This is an option that requires an argument.  */
-        if (*nextchar != '\0')
-        {
-          GNoptarg = nextchar;
-          /* If we end this ARGV-element by taking the rest as an arg,
-           * we must advance to the next element now.  */
-          GNoptind++;
-        }
-        else if (GNoptind == argc)
-        {
-          if (GNopterr)
-          {
-            /* 1003.2 specifies the format of this message.  */
-            fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-                     argv[0], c);
-          }
-          if (optstring[0] == ':')
-            c = ':';
-          else
-            c = '?';
-        }
-        else
-          /* We already incremented `GNoptind' once;
-           * increment it again when taking next ARGV-elt as argument.  */
-          GNoptarg = argv[GNoptind++];
-        nextchar = NULL;
-      }
-    }
     return c;
   }
 }
 
 static int
 GNgetopt_long (int argc, char *const *argv, const char *options,
-               const struct GNoption *long_options, int *opt_index)
+              const struct GNoption *long_options, int *opt_index)
 {
   return GN_getopt_internal (argc, argv, options, long_options, opt_index, 0);
 }
@@ -967,8 +975,8 @@
  */
 int
 GNUNET_GETOPT_run (const char *binaryOptions,
-                   const struct GNUNET_GETOPT_CommandLineOption *allOptions,
-                   unsigned int argc, char *const *argv)
+                  const struct GNUNET_GETOPT_CommandLineOption *allOptions,
+                  unsigned int argc, char *const *argv)
 {
   struct GNoption *long_options;
   struct GNUNET_GETOPT_CommandLineProcessorContext clpc;
@@ -993,15 +1001,15 @@
   shorts = GNUNET_malloc (count * 2 + 1);
   spos = 0;
   for (i = 0; i < count; i++)
-  {
-    long_options[i].name = allOptions[i].name;
-    long_options[i].has_arg = allOptions[i].require_argument;
-    long_options[i].flag = NULL;
-    long_options[i].val = allOptions[i].shortName;
-    shorts[spos++] = allOptions[i].shortName;
-    if (allOptions[i].require_argument != 0)
-      shorts[spos++] = ':';
-  }
+    {
+      long_options[i].name = allOptions[i].name;
+      long_options[i].has_arg = allOptions[i].require_argument;
+      long_options[i].flag = NULL;
+      long_options[i].val = allOptions[i].shortName;
+      shorts[spos++] = allOptions[i].shortName;
+      if (allOptions[i].require_argument != 0)
+       shorts[spos++] = ':';
+    }
   long_options[count].name = NULL;
   long_options[count].has_arg = 0;
   long_options[count].flag = NULL;
@@ -1010,31 +1018,31 @@
   cont = GNUNET_OK;
   /* main getopt loop */
   while (cont == GNUNET_OK)
-  {
-    int option_index = 0;
+    {
+      int option_index = 0;
 
-    c = GNgetopt_long (argc, argv, shorts, long_options, &option_index);
+      c = GNgetopt_long (argc, argv, shorts, long_options, &option_index);
 
-    if (c == GNUNET_SYSERR)
-      break;                    /* No more flags to process */
+      if (c == GNUNET_SYSERR)
+       break;                  /* No more flags to process */
 
-    for (i = 0; i < count; i++)
-    {
-      clpc.currentArgument = GNoptind - 1;
-      if ((char) c == allOptions[i].shortName)
-      {
-        cont =
-            allOptions[i].processor (&clpc, allOptions[i].scls,
-                                     allOptions[i].name, GNoptarg);
-        break;
-      }
+      for (i = 0; i < count; i++)
+       {
+         clpc.currentArgument = GNoptind - 1;
+         if ((char) c == allOptions[i].shortName)
+           {
+             cont =
+               allOptions[i].processor (&clpc, allOptions[i].scls,
+                                        allOptions[i].name, GNoptarg);
+             break;
+           }
+       }
+      if (i == count)
+       {
+         fprintf (stderr, _("Use --help to get a list of options.\n"));
+         cont = GNUNET_SYSERR;
+       }
     }
-    if (i == count)
-    {
-      fprintf (stderr, _("Use --help to get a list of options.\n"));
-      cont = GNUNET_SYSERR;
-    }
-  }
 
   GNUNET_free (shorts);
   GNUNET_free (long_options);

Modified: gnunet/src/util/getopt_helpers.c
===================================================================
--- gnunet/src/util/getopt_helpers.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/getopt_helpers.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -28,7 +28,9 @@
 #include "gnunet_common.h"
 #include "gnunet_getopt_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+
 /**
  * Print out program version (implements --version).
  *
@@ -40,8 +42,8 @@
  */
 int
 GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext
-                              *ctx, void *scls, const char *option,
-                              const char *value)
+                             *ctx, void *scls, const char *option,
+                             const char *value)
 {
   const char *version = scls;
 
@@ -64,8 +66,8 @@
  */
 int
 GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
-                            *ctx, void *scls, const char *option,
-                            const char *value)
+                           *ctx, void *scls, const char *option,
+                           const char *value)
 {
   const char *about = scls;
   size_t slen;
@@ -79,74 +81,74 @@
 
   printf ("%s\n%s\n", ctx->binaryOptions, gettext (about));
   printf (_
-          ("Arguments mandatory for long options are also mandatory for short 
options.\n"));
+         ("Arguments mandatory for long options are also mandatory for short 
options.\n"));
   i = 0;
   opt = ctx->allOptions;
   while (opt[i].description != NULL)
-  {
-    if (opt[i].shortName == '\0')
-      printf ("      ");
-    else
-      printf ("  -%c, ", opt[i].shortName);
-    printf ("--%s", opt[i].name);
-    slen = 8 + strlen (opt[i].name);
-    if (opt[i].argumentHelp != NULL)
     {
-      printf ("=%s", opt[i].argumentHelp);
-      slen += 1 + strlen (opt[i].argumentHelp);
+      if (opt[i].shortName == '\0')
+       printf ("      ");
+      else
+       printf ("  -%c, ", opt[i].shortName);
+      printf ("--%s", opt[i].name);
+      slen = 8 + strlen (opt[i].name);
+      if (opt[i].argumentHelp != NULL)
+       {
+         printf ("=%s", opt[i].argumentHelp);
+         slen += 1 + strlen (opt[i].argumentHelp);
+       }
+      if (slen > BORDER)
+       {
+         printf ("\n%*s", BORDER, "");
+         slen = BORDER;
+       }
+      if (slen < BORDER)
+       {
+         printf ("%*s", (int) (BORDER - slen), "");
+         slen = BORDER;
+       }
+      if (0 < strlen (opt[i].description))
+       trans = gettext (opt[i].description);
+      else
+       trans = "";
+      ml = strlen (trans);
+      p = 0;
+    OUTER:
+      while (ml - p > 78 - slen)
+       {
+         for (j = p + 78 - slen; j > p; j--)
+           {
+             if (isspace ((unsigned char) trans[j]))
+               {
+                 scp = GNUNET_malloc (j - p + 1);
+                 memcpy (scp, &trans[p], j - p);
+                 scp[j - p] = '\0';
+                 printf ("%s\n%*s", scp, BORDER + 2, "");
+                 GNUNET_free (scp);
+                 p = j + 1;
+                 slen = BORDER + 2;
+                 goto OUTER;
+               }
+           }
+         /* could not find space to break line */
+         scp = GNUNET_malloc (78 - slen + 1);
+         memcpy (scp, &trans[p], 78 - slen);
+         scp[78 - slen] = '\0';
+         printf ("%s\n%*s", scp, BORDER + 2, "");
+         GNUNET_free (scp);
+         slen = BORDER + 2;
+         p = p + 78 - slen;
+       }
+      /* print rest */
+      if (p < ml)
+       printf ("%s\n", &trans[p]);
+      if (strlen (trans) == 0)
+       printf ("\n");
+      i++;
     }
-    if (slen > BORDER)
-    {
-      printf ("\n%*s", BORDER, "");
-      slen = BORDER;
-    }
-    if (slen < BORDER)
-    {
-      printf ("%*s", (int) (BORDER - slen), "");
-      slen = BORDER;
-    }
-    if (0 < strlen (opt[i].description))
-      trans = gettext (opt[i].description);
-    else
-      trans = "";
-    ml = strlen (trans);
-    p = 0;
-OUTER:
-    while (ml - p > 78 - slen)
-    {
-      for (j = p + 78 - slen; j > p; j--)
-      {
-        if (isspace ((unsigned char) trans[j]))
-        {
-          scp = GNUNET_malloc (j - p + 1);
-          memcpy (scp, &trans[p], j - p);
-          scp[j - p] = '\0';
-          printf ("%s\n%*s", scp, BORDER + 2, "");
-          GNUNET_free (scp);
-          p = j + 1;
-          slen = BORDER + 2;
-          goto OUTER;
-        }
-      }
-      /* could not find space to break line */
-      scp = GNUNET_malloc (78 - slen + 1);
-      memcpy (scp, &trans[p], 78 - slen);
-      scp[78 - slen] = '\0';
-      printf ("%s\n%*s", scp, BORDER + 2, "");
-      GNUNET_free (scp);
-      slen = BORDER + 2;
-      p = p + 78 - slen;
-    }
-    /* print rest */
-    if (p < ml)
-      printf ("%s\n", &trans[p]);
-    if (strlen (trans) == 0)
-      printf ("\n");
-    i++;
-  }
   printf ("Report bugs to address@hidden"
-          "GNUnet home page: http://www.gnu.org/software/gnunet/\n";
-          "General help using GNU software: http://www.gnu.org/gethelp/\n";);
+         "GNUnet home page: http://www.gnu.org/software/gnunet/\n";
+         "General help using GNU software: http://www.gnu.org/gethelp/\n";);
   return GNUNET_SYSERR;
 }
 
@@ -166,9 +168,10 @@
  * @return GNUNET_OK
  */
 int
-GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext
-                               *ctx, void *scls, const char *option,
-                               const char *value)
+GNUNET_GETOPT_increment_value (struct
+                              GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+                              void *scls, const char *option,
+                              const char *value)
 {
   int *val = scls;
 
@@ -193,7 +196,7 @@
  */
 int
 GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
-                       void *scls, const char *option, const char *value)
+                      void *scls, const char *option, const char *value)
 {
   int *val = scls;
 
@@ -217,8 +220,9 @@
  * @return GNUNET_OK
  */
 int
-GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext 
*ctx,
-                          void *scls, const char *option, const char *value)
+GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext
+                         *ctx, void *scls, const char *option,
+                         const char *value)
 {
   char **val = scls;
 
@@ -243,16 +247,18 @@
  * @return GNUNET_OK if parsing the value worked
  */
 int
-GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
-                         void *scls, const char *option, const char *value)
+GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext
+                        *ctx, void *scls, const char *option,
+                        const char *value)
 {
   unsigned long long *val = scls;
 
   if (1 != SSCANF (value, "%llu", val))
-  {
-    fprintf (stderr, _("You must pass a number to the `%s' option.\n"), 
option);
-    return GNUNET_SYSERR;
-  }
+    {
+      fprintf (stderr, _("You must pass a number to the `%s' option.\n"),
+              option);
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 
@@ -272,15 +278,16 @@
  */
 int
 GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
-                        void *scls, const char *option, const char *value)
+                       void *scls, const char *option, const char *value)
 {
   unsigned int *val = scls;
 
   if (1 != SSCANF (value, "%u", val))
-  {
-    fprintf (stderr, _("You must pass a number to the `%s' option.\n"), 
option);
-    return GNUNET_SYSERR;
-  }
+    {
+      fprintf (stderr, _("You must pass a number to the `%s' option.\n"),
+              option);
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 

Modified: gnunet/src/util/gnunet-config-diff.c
===================================================================
--- gnunet/src/util/gnunet-config-diff.c        2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/gnunet-config-diff.c        2011-10-11 09:43:04 UTC (rev 
17362)
@@ -8,10 +8,10 @@
   struct GNUNET_CONFIGURATION_Handle *i2;
 
   if (argc != 3)
-  {
-    fprintf (stderr, "Invoke using `%s DEFAULTS-IN DIFFS'\n", argv[0]);
-    return 1;
-  }
+    {
+      fprintf (stderr, "Invoke using `%s DEFAULTS-IN DIFFS'\n", argv[0]);
+      return 1;
+    }
   i1 = GNUNET_CONFIGURATION_create ();
   i2 = GNUNET_CONFIGURATION_create ();
   if ((GNUNET_OK != GNUNET_CONFIGURATION_load (i1, argv[1])) ||

Modified: gnunet/src/util/gnunet-resolver.c
===================================================================
--- gnunet/src/util/gnunet-resolver.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/gnunet-resolver.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -72,9 +72,9 @@
     GNUNET_GETOPT_OPTION_END
   };
   return (GNUNET_OK ==
-          GNUNET_PROGRAM_run (argc, argv, "gnunet-resolver [hostname]",
-                              gettext_noop ("Test GNUnet DNS resolver code."),
-                              options, &run, NULL)) ? 0 : 1;
+         GNUNET_PROGRAM_run (argc, argv, "gnunet-resolver [hostname]",
+                             gettext_noop ("Test GNUnet DNS resolver code."),
+                             options, &run, NULL)) ? 0 : 1;
 }
 
 /* end of gnunet-resolver.c */

Modified: gnunet/src/util/gnunet-service-resolver.c
===================================================================
--- gnunet/src/util/gnunet-service-resolver.c   2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/gnunet-service-resolver.c   2011-10-11 09:43:04 UTC (rev 
17362)
@@ -89,7 +89,7 @@
 
   if (0 ==
       getnameinfo (cache->sa, cache->salen, hostname, sizeof (hostname), NULL,
-                   0, 0))
+                  0, 0))
     cache->addr = GNUNET_strdup (hostname);
 }
 #endif
@@ -107,20 +107,20 @@
   struct hostent *ent;
 
   switch (cache->sa->sa_family)
-  {
-  case AF_INET:
-    ent =
-        gethostbyaddr (&((struct sockaddr_in *) cache->sa)->sin_addr,
-                       sizeof (struct in_addr), AF_INET);
-    break;
-  case AF_INET6:
-    ent =
-        gethostbyaddr (&((struct sockaddr_in6 *) cache->sa)->sin6_addr,
-                       sizeof (struct in6_addr), AF_INET6);
-    break;
-  default:
-    ent = NULL;
-  }
+    {
+    case AF_INET:
+      ent =
+       gethostbyaddr (&((struct sockaddr_in *) cache->sa)->sin_addr,
+                      sizeof (struct in_addr), AF_INET);
+      break;
+    case AF_INET6:
+      ent =
+       gethostbyaddr (&((struct sockaddr_in6 *) cache->sa)->sin6_addr,
+                      sizeof (struct in6_addr), AF_INET6);
+      break;
+    default:
+      ent = NULL;
+    }
   if (ent != NULL)
     cache->addr = GNUNET_strdup (ent->h_name);
 }
@@ -158,7 +158,7 @@
  */
 static void
 get_ip_as_string (struct GNUNET_SERVER_Client *client,
-                  const struct sockaddr *sa, socklen_t salen)
+                 const struct sockaddr *sa, socklen_t salen)
 {
   struct IPCache *cache;
   struct IPCache *prev;
@@ -166,73 +166,73 @@
   struct GNUNET_SERVER_TransmitContext *tc;
 
   if (salen < sizeof (struct sockaddr))
-  {
-    GNUNET_break (0);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+      return;
+    }
   now = GNUNET_TIME_absolute_get ();
   cache = head;
   prev = NULL;
   while ((cache != NULL) &&
-         ((cache->salen != salen) || (0 != memcmp (cache->sa, sa, salen))))
-  {
-    if (GNUNET_TIME_absolute_get_duration (cache->last_request).rel_value <
-        60 * 60 * 1000)
+        ((cache->salen != salen) || (0 != memcmp (cache->sa, sa, salen))))
     {
-      if (prev != NULL)
-      {
-        prev->next = cache->next;
-        GNUNET_free_non_null (cache->addr);
-        GNUNET_free (cache->sa);
-        GNUNET_free (cache);
-        cache = prev->next;
-      }
-      else
-      {
-        head = cache->next;
-        GNUNET_free_non_null (cache->addr);
-        GNUNET_free (cache->sa);
-        GNUNET_free (cache);
-        cache = head;
-      }
-      continue;
+      if (GNUNET_TIME_absolute_get_duration (cache->last_request).rel_value <
+         60 * 60 * 1000)
+       {
+         if (prev != NULL)
+           {
+             prev->next = cache->next;
+             GNUNET_free_non_null (cache->addr);
+             GNUNET_free (cache->sa);
+             GNUNET_free (cache);
+             cache = prev->next;
+           }
+         else
+           {
+             head = cache->next;
+             GNUNET_free_non_null (cache->addr);
+             GNUNET_free (cache->sa);
+             GNUNET_free (cache);
+             cache = head;
+           }
+         continue;
+       }
+      prev = cache;
+      cache = cache->next;
     }
-    prev = cache;
-    cache = cache->next;
-  }
   if (cache != NULL)
-  {
-    cache->last_request = now;
-    if (GNUNET_TIME_absolute_get_duration (cache->last_request).rel_value <
-        60 * 60 * 1000)
     {
-      GNUNET_free_non_null (cache->addr);
+      cache->last_request = now;
+      if (GNUNET_TIME_absolute_get_duration (cache->last_request).rel_value <
+         60 * 60 * 1000)
+       {
+         GNUNET_free_non_null (cache->addr);
+         cache->addr = NULL;
+         cache->salen = 0;
+         cache_resolve (cache);
+       }
+    }
+  else
+    {
+      cache = GNUNET_malloc (sizeof (struct IPCache));
+      cache->next = head;
+      cache->salen = salen;
+      cache->sa = GNUNET_malloc (salen);
+      memcpy (cache->sa, sa, salen);
+      cache->last_request = GNUNET_TIME_absolute_get ();
+      cache->last_refresh = GNUNET_TIME_absolute_get ();
       cache->addr = NULL;
-      cache->salen = 0;
       cache_resolve (cache);
+      head = cache;
     }
-  }
-  else
-  {
-    cache = GNUNET_malloc (sizeof (struct IPCache));
-    cache->next = head;
-    cache->salen = salen;
-    cache->sa = GNUNET_malloc (salen);
-    memcpy (cache->sa, sa, salen);
-    cache->last_request = GNUNET_TIME_absolute_get ();
-    cache->last_refresh = GNUNET_TIME_absolute_get ();
-    cache->addr = NULL;
-    cache_resolve (cache);
-    head = cache;
-  }
   tc = GNUNET_SERVER_transmit_context_create (client);
   if (cache->addr != NULL)
     GNUNET_SERVER_transmit_context_append_data (tc, cache->addr,
-                                                strlen (cache->addr) + 1,
-                                                
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+                                               strlen (cache->addr) + 1,
+                                               
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
   GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0,
-                                              
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+                                             
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
   GNUNET_SERVER_transmit_context_run (tc, GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
@@ -240,7 +240,7 @@
 #if HAVE_GETADDRINFO
 static int
 getaddrinfo_resolve (struct GNUNET_SERVER_TransmitContext *tc,
-                     const char *hostname, int domain)
+                    const char *hostname, int domain)
 {
   int s;
   struct addrinfo hints;
@@ -254,36 +254,37 @@
 #else
   hints.ai_family = AF_INET;
 #endif
-  hints.ai_socktype = SOCK_STREAM;      /* go for TCP */
+  hints.ai_socktype = SOCK_STREAM;     /* go for TCP */
 
   if (0 != (s = getaddrinfo (hostname, NULL, &hints, &result)))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Could not resolve `%s' (%s): %s\n"),
-                hostname,
-                (domain ==
-                 AF_INET) ? "IPv4" : ((domain == AF_INET6) ? "IPv6" : "any"),
-                gai_strerror (s));
-    if ((s == EAI_BADFLAGS) || (s == EAI_MEMORY)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 _("Could not resolve `%s' (%s): %s\n"), hostname,
+                 (domain ==
+                  AF_INET) ? "IPv4" : ((domain ==
+                                        AF_INET6) ? "IPv6" : "any"),
+                 gai_strerror (s));
+      if ((s == EAI_BADFLAGS) || (s == EAI_MEMORY)
 #ifndef MINGW
-        || (s == EAI_SYSTEM)
+         || (s == EAI_SYSTEM)
 #else
-        // FIXME NILS
-        || 1
+         // FIXME NILS
+         || 1
 #endif
-        )
-      return GNUNET_NO;         /* other function may still succeed */
-    return GNUNET_SYSERR;
-  }
+       )
+       return GNUNET_NO;       /* other function may still succeed */
+      return GNUNET_SYSERR;
+    }
   if (result == NULL)
     return GNUNET_SYSERR;
   pos = result;
   while (pos != NULL)
-  {
-    GNUNET_SERVER_transmit_context_append_data (tc, pos->ai_addr,
-                                                pos->ai_addrlen,
-                                                
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
-    pos = pos->ai_next;
-  }
+    {
+      GNUNET_SERVER_transmit_context_append_data (tc, pos->ai_addr,
+                                                 pos->ai_addrlen,
+                                                 
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+      pos = pos->ai_next;
+    }
   freeaddrinfo (result);
   return GNUNET_OK;
 }
@@ -292,7 +293,7 @@
 #if HAVE_GETHOSTBYNAME2
 static int
 gethostbyname2_resolve (struct GNUNET_SERVER_TransmitContext *tc,
-                        const char *hostname, int domain)
+                       const char *hostname, int domain)
 {
   struct hostent *hp;
   struct sockaddr_in a4;
@@ -301,48 +302,48 @@
   int ret2;
 
   if (domain == AF_UNSPEC)
-  {
-    ret1 = gethostbyname2_resolve (tc, hostname, AF_INET);
-    ret2 = gethostbyname2_resolve (tc, hostname, AF_INET6);
-    if ((ret1 == GNUNET_OK) || (ret2 == GNUNET_OK))
-      return GNUNET_OK;
-    if ((ret1 == GNUNET_SYSERR) || (ret2 == GNUNET_SYSERR))
-      return GNUNET_SYSERR;
-    return GNUNET_NO;
-  }
+    {
+      ret1 = gethostbyname2_resolve (tc, hostname, AF_INET);
+      ret2 = gethostbyname2_resolve (tc, hostname, AF_INET6);
+      if ((ret1 == GNUNET_OK) || (ret2 == GNUNET_OK))
+       return GNUNET_OK;
+      if ((ret1 == GNUNET_SYSERR) || (ret2 == GNUNET_SYSERR))
+       return GNUNET_SYSERR;
+      return GNUNET_NO;
+    }
   hp = gethostbyname2 (hostname, domain);
   if (hp == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Could not find IP of host `%s': %s\n"), hostname,
-                hstrerror (h_errno));
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 _("Could not find IP of host `%s': %s\n"), hostname,
+                 hstrerror (h_errno));
+      return GNUNET_SYSERR;
+    }
   GNUNET_assert (hp->h_addrtype == domain);
   if (domain == AF_INET)
-  {
-    GNUNET_assert (hp->h_length == sizeof (struct in_addr));
-    memset (&a4, 0, sizeof (a4));
-    a4.sin_family = AF_INET;
+    {
+      GNUNET_assert (hp->h_length == sizeof (struct in_addr));
+      memset (&a4, 0, sizeof (a4));
+      a4.sin_family = AF_INET;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-    a4.sin_len = (u_char) sizeof (struct sockaddr_in);
+      a4.sin_len = (u_char) sizeof (struct sockaddr_in);
 #endif
-    memcpy (&a4.sin_addr, hp->h_addr_list[0], hp->h_length);
-    GNUNET_SERVER_transmit_context_append_data (tc, &a4, sizeof (a4),
-                                                
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
-  }
+      memcpy (&a4.sin_addr, hp->h_addr_list[0], hp->h_length);
+      GNUNET_SERVER_transmit_context_append_data (tc, &a4, sizeof (a4),
+                                                 
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+    }
   else
-  {
-    GNUNET_assert (hp->h_length == sizeof (struct in6_addr));
-    memset (&a6, 0, sizeof (a6));
-    a6.sin6_family = AF_INET6;
+    {
+      GNUNET_assert (hp->h_length == sizeof (struct in6_addr));
+      memset (&a6, 0, sizeof (a6));
+      a6.sin6_family = AF_INET6;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-    a6.sin6_len = (u_char) sizeof (struct sockaddr_in6);
+      a6.sin6_len = (u_char) sizeof (struct sockaddr_in6);
 #endif
-    memcpy (&a6.sin6_addr, hp->h_addr_list[0], hp->h_length);
-    GNUNET_SERVER_transmit_context_append_data (tc, &a6, sizeof (a6),
-                                                
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
-  }
+      memcpy (&a6.sin6_addr, hp->h_addr_list[0], hp->h_length);
+      GNUNET_SERVER_transmit_context_append_data (tc, &a6, sizeof (a6),
+                                                 
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+    }
   return GNUNET_OK;
 }
 #endif
@@ -350,24 +351,24 @@
 #if HAVE_GETHOSTBYNAME
 static int
 gethostbyname_resolve (struct GNUNET_SERVER_TransmitContext *tc,
-                       const char *hostname)
+                      const char *hostname)
 {
   struct hostent *hp;
   struct sockaddr_in addr;
 
   hp = GETHOSTBYNAME (hostname);
   if (hp == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Could not find IP of host `%s': %s\n"), hostname,
-                hstrerror (h_errno));
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 _("Could not find IP of host `%s': %s\n"), hostname,
+                 hstrerror (h_errno));
+      return GNUNET_SYSERR;
+    }
   if (hp->h_addrtype != AF_INET)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_break (0);
+      return GNUNET_SYSERR;
+    }
   GNUNET_assert (hp->h_length == sizeof (struct in_addr));
   memset (&addr, 0, sizeof (addr));
   addr.sin_family = AF_INET;
@@ -376,7 +377,7 @@
 #endif
   memcpy (&addr.sin_addr, hp->h_addr_list[0], hp->h_length);
   GNUNET_SERVER_transmit_context_append_data (tc, &addr, sizeof (addr),
-                                              
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+                                             
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
   return GNUNET_OK;
 }
 #endif
@@ -390,8 +391,8 @@
  * @param domain AF_INET or AF_INET6; use AF_UNSPEC for "any"
  */
 static void
-get_ip_from_hostname (struct GNUNET_SERVER_Client *client, const char 
*hostname,
-                      int domain)
+get_ip_from_hostname (struct GNUNET_SERVER_Client *client,
+                     const char *hostname, int domain)
 {
   int ret;
   struct GNUNET_SERVER_TransmitContext *tc;
@@ -411,7 +412,7 @@
     gethostbyname_resolve (tc, hostname);
 #endif
   GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0,
-                                              
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
+                                             
GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE);
   GNUNET_SERVER_transmit_context_run (tc, GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
@@ -425,7 +426,7 @@
  */
 static void
 handle_get (void *cls, struct GNUNET_SERVER_Client *client,
-            const struct GNUNET_MessageHeader *message)
+           const struct GNUNET_MessageHeader *message)
 {
   uint16_t msize;
   const struct GNUNET_RESOLVER_GetMessage *msg;
@@ -437,78 +438,78 @@
 
   msize = ntohs (message->size);
   if (msize < sizeof (struct GNUNET_RESOLVER_GetMessage))
-  {
-    GNUNET_break (0);
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+      return;
+    }
   msg = (const struct GNUNET_RESOLVER_GetMessage *) message;
   size = msize - sizeof (struct GNUNET_RESOLVER_GetMessage);
   direction = ntohl (msg->direction);
   domain = ntohl (msg->domain);
   if (direction == GNUNET_NO)
-  {
-    /* IP from hostname */
-    hostname = (const char *) &msg[1];
-    if (hostname[size - 1] != '\0')
     {
-      GNUNET_break (0);
-      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-      return;
-    }
+      /* IP from hostname */
+      hostname = (const char *) &msg[1];
+      if (hostname[size - 1] != '\0')
+       {
+         GNUNET_break (0);
+         GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+         return;
+       }
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolver asked to look up 
`%s'.\n"),
-                hostname);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 _("Resolver asked to look up `%s'.\n"), hostname);
 #endif
-    get_ip_from_hostname (client, hostname, domain);
-  }
+      get_ip_from_hostname (client, hostname, domain);
+    }
   else
-  {
+    {
 #if DEBUG_RESOLVER
-    char buf[INET6_ADDRSTRLEN];
+      char buf[INET6_ADDRSTRLEN];
 #endif
-    if (size < sizeof (struct sockaddr))
-    {
-      GNUNET_break (0);
-      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-      return;
-    }
-    sa = (const struct sockaddr *) &msg[1];
-    switch (sa->sa_family)
-    {
-    case AF_INET:
-      if (size != sizeof (struct sockaddr_in))
-      {
-        GNUNET_break (0);
-        GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-        return;
-      }
+      if (size < sizeof (struct sockaddr))
+       {
+         GNUNET_break (0);
+         GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+         return;
+       }
+      sa = (const struct sockaddr *) &msg[1];
+      switch (sa->sa_family)
+       {
+       case AF_INET:
+         if (size != sizeof (struct sockaddr_in))
+           {
+             GNUNET_break (0);
+             GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+             return;
+           }
 #if DEBUG_RESOLVER
-      inet_ntop (AF_INET, sa, buf, size);
+         inet_ntop (AF_INET, sa, buf, size);
 #endif
-      break;
-    case AF_INET6:
-      if (size != sizeof (struct sockaddr_in6))
-      {
-        GNUNET_break (0);
-        GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-        return;
-      }
+         break;
+       case AF_INET6:
+         if (size != sizeof (struct sockaddr_in6))
+           {
+             GNUNET_break (0);
+             GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+             return;
+           }
 #if DEBUG_RESOLVER
-      inet_ntop (AF_INET6, sa, buf, size);
+         inet_ntop (AF_INET6, sa, buf, size);
 #endif
-      break;
-    default:
-      GNUNET_break (0);
-      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-      return;
-    }
+         break;
+       default:
+         GNUNET_break (0);
+         GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+         return;
+       }
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                _("Resolver asked to look up IP address `%s'.\n"), buf);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 _("Resolver asked to look up IP address `%s'.\n"), buf);
 #endif
-    get_ip_as_string (client, sa, size);
-  }
+      get_ip_as_string (client, sa, size);
+    }
 }
 
 
@@ -545,18 +546,18 @@
   struct IPCache *pos;
 
   ret =
-      (GNUNET_OK ==
-       GNUNET_SERVICE_run (argc, argv, "resolver", GNUNET_SERVICE_OPTION_NONE,
-                           &run, NULL)) ? 0 : 1;
+    (GNUNET_OK ==
+     GNUNET_SERVICE_run (argc, argv, "resolver", GNUNET_SERVICE_OPTION_NONE,
+                        &run, NULL)) ? 0 : 1;
 
   while (head != NULL)
-  {
-    pos = head->next;
-    GNUNET_free_non_null (head->addr);
-    GNUNET_free (head->sa);
-    GNUNET_free (head);
-    head = pos;
-  }
+    {
+      pos = head->next;
+      GNUNET_free_non_null (head->addr);
+      GNUNET_free (head->sa);
+      GNUNET_free (head);
+      head = pos;
+    }
   return ret;
 }
 

Modified: gnunet/src/util/load.c
===================================================================
--- gnunet/src/util/load.c      2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/load.c      2011-10-11 09:43:04 UTC (rev 17362)
@@ -28,6 +28,8 @@
 
 #define DEBUG_LOAD GNUNET_EXTRA_LOGGING
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Values we track for load calculations.
  */
@@ -92,23 +94,23 @@
   if (delta.rel_value < load->autodecline.rel_value)
     return;
   if (load->autodecline.rel_value == 0)
-  {
-    load->runavg_delay = 0.0;
-    load->load = 0;
-    return;
-  }
+    {
+      load->runavg_delay = 0.0;
+      load->load = 0;
+      return;
+    }
   n = delta.rel_value / load->autodecline.rel_value;
   if (n > 16)
-  {
-    load->runavg_delay = 0.0;
-    load->load = 0;
-    return;
-  }
+    {
+      load->runavg_delay = 0.0;
+      load->load = 0;
+      return;
+    }
   while (n > 0)
-  {
-    n--;
-    load->runavg_delay = (load->runavg_delay * 7.0) / 8.0;
-  }
+    {
+      n--;
+      load->runavg_delay = (load->runavg_delay * 7.0) / 8.0;
+    }
 }
 
 
@@ -140,7 +142,7 @@
  */
 void
 GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
-                               struct GNUNET_TIME_Relative autodecline)
+                              struct GNUNET_TIME_Relative autodecline)
 {
   internal_update (load);
   load->autodecline = autodecline;
@@ -175,10 +177,10 @@
   nm1 = n - 1.0;
   avgdel = sum_val_i / n;
   stddev =
-      (((double) load->cummulative_squared_delay) - 2.0 * avgdel * sum_val_i +
-       n * avgdel * avgdel) / nm1;
+    (((double) load->cummulative_squared_delay) - 2.0 * avgdel * sum_val_i +
+     n * avgdel * avgdel) / nm1;
   if (stddev <= 0)
-    stddev = 0.01;              /* must have been rounding error or zero; 
prevent division by zero */
+    stddev = 0.01;             /* must have been rounding error or zero; 
prevent division by zero */
   /* now calculate load based on how far out we are from
    * std dev; or if we are below average, simply assume load zero */
   if (load->runavg_delay < avgdel)
@@ -241,11 +243,11 @@
   internal_update (load);
   load->last_update = GNUNET_TIME_absolute_get ();
   if (data > 64 * 1024)
-  {
-    /* very large */
-    load->load = 100.0;
-    return;
-  }
+    {
+      /* very large */
+      load->load = 100.0;
+      return;
+    }
   dv = (uint32_t) data;
   load->cummulative_delay += dv;
   load->cummulative_squared_delay += dv * dv;

Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/network.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -29,6 +29,10 @@
 #include "disk.h"
 #include "gnunet_container_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 #define DEBUG_NETWORK GNUNET_EXTRA_LOGGING
 
 #define DEBUG_W32_CYCLES GNUNET_EXTRA_LOGGING
@@ -86,11 +90,11 @@
   mode = !doBlock;
   if (ioctlsocket (fd->fd, FIONBIO, &mode) == SOCKET_ERROR)
 
-  {
-    SetErrnoFromWinsockError (WSAGetLastError ());
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "ioctlsocket");
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinsockError (WSAGetLastError ());
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "ioctlsocket");
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 
 #else
@@ -99,10 +103,10 @@
 
   if (flags == -1)
 
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "fcntl");
+      return GNUNET_SYSERR;
+    }
   if (doBlock)
     flags &= ~O_NONBLOCK;
 
@@ -110,10 +114,10 @@
     flags |= O_NONBLOCK;
   if (0 != fcntl (fd->fd, F_SETFL, flags))
 
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "fcntl");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "fcntl");
+      return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 #endif
 }
@@ -158,8 +162,8 @@
 
   if (0 !=
       setsockopt (h->fd, SOL_SOCKET, SO_NOSIGPIPE, &abs_value,
-                  sizeof (abs_value)))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+                 sizeof (abs_value)))
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
 }
 #endif
 
@@ -177,15 +181,16 @@
 #ifndef WINDOWS
   int value = 1;
 
-  if (0 != setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof 
(value)))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+  if (0 !=
+      setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof (value)))
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
 #else
   const char *abs_value = "1";
 
   if (0 !=
       setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, abs_value,
-                  sizeof (abs_value)))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+                 sizeof (abs_value)))
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
 #endif
 }
 
@@ -200,7 +205,8 @@
  */
 struct GNUNET_NETWORK_Handle *
 GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
-                              struct sockaddr *address, socklen_t * 
address_len)
+                             struct sockaddr *address,
+                             socklen_t * address_len)
 {
   struct GNUNET_NETWORK_Handle *ret;
 
@@ -212,8 +218,8 @@
     int gsn = getsockname (desc->fd, &name, &namelen);
 
     if (gsn == 0)
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Accepting connection on `%s'\n",
-                  GNUNET_a2s (&name, namelen));
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Accepting connection on `%s'\n",
+          GNUNET_a2s (&name, namelen));
   }
 #endif
   ret->fd = accept (desc->fd, address, address_len);
@@ -222,36 +228,36 @@
   else
     ret->af = desc->af;
   if (ret->fd == INVALID_SOCKET)
-  {
+    {
 #ifdef MINGW
-    SetErrnoFromWinsockError (WSAGetLastError ());
+      SetErrnoFromWinsockError (WSAGetLastError ());
 #endif
-    GNUNET_free (ret);
-    return NULL;
-  }
+      GNUNET_free (ret);
+      return NULL;
+    }
 #ifndef MINGW
   if (ret->fd >= FD_SETSIZE)
-  {
-    GNUNET_break (0 == close (ret->fd));
-    GNUNET_free (ret);
-    errno = EMFILE;
-    return NULL;
-  }
+    {
+      GNUNET_break (0 == close (ret->fd));
+      GNUNET_free (ret);
+      errno = EMFILE;
+      return NULL;
+    }
 #endif
   if (GNUNET_SYSERR == socket_set_blocking (ret, GNUNET_NO))
 
-  {
+    {
 
-    /* we might want to treat this one as fatal... */
-    GNUNET_break (0);
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret));
-    return NULL;
-  }
+      /* we might want to treat this one as fatal... */
+      GNUNET_break (0);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret));
+      return NULL;
+    }
 
 #ifndef MINGW
   if (GNUNET_OK != socket_set_inheritable (ret))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                         "socket_set_inheritable");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                 "socket_set_inheritable");
 #endif
 #ifdef DARWIN
   socket_set_nosigpipe (ret);
@@ -273,8 +279,8 @@
  */
 int
 GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
-                            const struct sockaddr *address,
-                            socklen_t address_len)
+                           const struct sockaddr *address,
+                           socklen_t address_len)
 {
   int ret;
 
@@ -283,23 +289,24 @@
   const int on = 1;
 
   if (desc->af == AF_INET6)
-    if (0 != setsockopt (desc->fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof 
(on)))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "setsockopt");
+    if (0 !=
+       setsockopt (desc->fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on)))
+      LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt");
 #endif
 #endif
 #ifndef WINDOWS
   /* This is required, and required here, but only on UNIX */
   if (0 != setsockopt (desc->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_DEBUG, "setsockopt");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_DEBUG, "setsockopt");
 #endif
 #ifndef LINUX
 #ifndef MINGW
   if (address->sa_family == AF_UNIX)
-  {
-    const struct sockaddr_un *un = (const struct sockaddr_un *) address;
+    {
+      const struct sockaddr_un *un = (const struct sockaddr_un *) address;
 
-    (void) unlink (un->sun_path);
-  }
+      (void) unlink (un->sun_path);
+    }
 #endif
 #endif
   ret = bind (desc->fd, address, address_len);
@@ -334,17 +341,17 @@
   DWORD error = 0;
 
 #if DEBUG_NETWORK
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_NETWORK_socket_close",
-                   "Closing 0x%x\n", desc->fd);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_NETWORK_socket_close",
+       "Closing 0x%x\n", desc->fd);
 #endif
   SetLastError (0);
   ret = closesocket (desc->fd);
   error = WSAGetLastError ();
   SetErrnoFromWinsockError (error);
 #if DEBUG_NETWORK
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_NETWORK_socket_close",
-                   "Closed 0x%x, closesocket() returned %d, GLE is %u\n",
-                   desc->fd, ret, error);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_NETWORK_socket_close",
+       "Closed 0x%x, closesocket() returned %d, GLE is %u\n",
+       desc->fd, ret, error);
 #endif
 #else
   ret = close (desc->fd);
@@ -352,13 +359,12 @@
 #ifndef LINUX
 #ifndef MINGW
   if ((desc->af == AF_UNIX) && (NULL != desc->addr))
-  {
-    const struct sockaddr_un *un = (const struct sockaddr_un *) desc->addr;
+    {
+      const struct sockaddr_un *un = (const struct sockaddr_un *) desc->addr;
 
-    if (0 != unlink (un->sun_path))
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink",
-                                un->sun_path);
-  }
+      if (0 != unlink (un->sun_path))
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "unlink", un->sun_path);
+    }
 #endif
 #endif
   GNUNET_free_non_null (desc->addr);
@@ -382,7 +388,7 @@
   struct GNUNET_NETWORK_Handle *ret;
 
   if (fcntl (fd, F_GETFD) < 0)
-    return NULL;                /* invalid FD */
+    return NULL;               /* invalid FD */
   ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_Handle));
   ret->fd = fd;
   ret->af = AF_UNSPEC;
@@ -400,8 +406,8 @@
  */
 int
 GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
-                               const struct sockaddr *address,
-                               socklen_t address_len)
+                              const struct sockaddr *address,
+                              socklen_t address_len)
 {
   int ret;
 
@@ -409,11 +415,11 @@
 
 #ifdef MINGW
   if (SOCKET_ERROR == ret)
-  {
-    SetErrnoFromWinsockError (WSAGetLastError ());
-    if (errno == EWOULDBLOCK)
-      errno = EINPROGRESS;
-  }
+    {
+      SetErrnoFromWinsockError (WSAGetLastError ());
+      if (errno == EWOULDBLOCK)
+       errno = EINPROGRESS;
+    }
 #endif
   return ret == 0 ? GNUNET_OK : GNUNET_SYSERR;
 }
@@ -431,8 +437,8 @@
  */
 int
 GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
-                                  int level, int optname, void *optval,
-                                  socklen_t * optlen)
+                                 int level, int optname, void *optval,
+                                 socklen_t * optlen)
 {
   int ret;
 
@@ -457,7 +463,7 @@
  */
 int
 GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
-                              int backlog)
+                             int backlog)
 {
   int ret;
 
@@ -480,7 +486,7 @@
  */
 ssize_t
 GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *
-                                       desc)
+                                      desc)
 {
   int error;
 
@@ -513,8 +519,9 @@
  */
 ssize_t
 GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle * desc,
-                                void *buffer, size_t length,
-                                struct sockaddr * src_addr, socklen_t * 
addrlen)
+                               void *buffer, size_t length,
+                               struct sockaddr * src_addr,
+                               socklen_t * addrlen)
 {
   int ret;
   int flags;
@@ -542,7 +549,7 @@
  */
 ssize_t
 GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle * desc,
-                            void *buffer, size_t length)
+                           void *buffer, size_t length)
 {
   int ret;
   int flags;
@@ -571,7 +578,7 @@
  */
 ssize_t
 GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle * desc,
-                            const void *buffer, size_t length)
+                           const void *buffer, size_t length)
 {
   int ret;
   int flags;
@@ -610,9 +617,9 @@
  */
 ssize_t
 GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle * desc,
-                              const void *message, size_t length,
-                              const struct sockaddr * dest_addr,
-                              socklen_t dest_len)
+                             const void *message, size_t length,
+                             const struct sockaddr * dest_addr,
+                             socklen_t dest_len)
 {
   int ret;
   int flags;
@@ -645,8 +652,8 @@
  */
 int
 GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level,
-                                  int option_name, const void *option_value,
-                                  socklen_t option_len)
+                                 int option_name, const void *option_value,
+                                 socklen_t option_len)
 {
   int ret;
 
@@ -678,36 +685,36 @@
   ret->af = domain;
   ret->fd = socket (domain, type, protocol);
   if (INVALID_SOCKET == ret->fd)
-  {
+    {
 #ifdef MINGW
-    SetErrnoFromWinsockError (WSAGetLastError ());
+      SetErrnoFromWinsockError (WSAGetLastError ());
 #endif
-    GNUNET_free (ret);
-    return NULL;
-  }
+      GNUNET_free (ret);
+      return NULL;
+    }
 
 #ifndef MINGW
   if (ret->fd >= FD_SETSIZE)
-  {
-    GNUNET_break (0 == close (ret->fd));
-    GNUNET_free (ret);
-    errno = EMFILE;
-    return NULL;
-  }
+    {
+      GNUNET_break (0 == close (ret->fd));
+      GNUNET_free (ret);
+      errno = EMFILE;
+      return NULL;
+    }
 
 #endif
   if (GNUNET_SYSERR == socket_set_blocking (ret, GNUNET_NO))
-  {
-    /* we might want to treat this one as fatal... */
-    GNUNET_break (0);
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret));
-    return NULL;
-  }
+    {
+      /* we might want to treat this one as fatal... */
+      GNUNET_break (0);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ret));
+      return NULL;
+    }
 
 #ifndef MINGW
   if (GNUNET_OK != socket_set_inheritable (ret))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                         "socket_set_inheritable");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                 "socket_set_inheritable");
 #endif
 #ifdef DARWIN
   socket_set_nosigpipe (ret);
@@ -716,7 +723,7 @@
 #ifdef AF_UNIX
       && (domain != AF_UNIX)
 #endif
-      )
+    )
     socket_set_nodelay (ret);
   return ret;
 }
@@ -761,24 +768,24 @@
   if (0 !=
       (ret =
        setsockopt (desc->fd, SOL_SOCKET, SO_SNDBUF, (char *) &value,
-                   sizeof (value))))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+                  sizeof (value))))
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
   if (0 !=
       (ret =
        setsockopt (desc->fd, SOL_SOCKET, SO_RCVBUF, (char *) &value,
-                   sizeof (value))))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+                  sizeof (value))))
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
 #elif LINUX
   int value = 0;
 
   if (0 !=
       (ret =
        setsockopt (desc->fd, SOL_SOCKET, SO_SNDBUF, &value, sizeof (value))))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
   if (0 !=
       (ret =
        setsockopt (desc->fd, SOL_SOCKET, SO_RCVBUF, &value, sizeof (value))))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
 #endif
   return ret == 0 ? GNUNET_OK : GNUNET_SYSERR;
 }
@@ -805,7 +812,7 @@
  */
 void
 GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
-                          const struct GNUNET_NETWORK_Handle *desc)
+                         const struct GNUNET_NETWORK_Handle *desc)
 {
   FD_SET (desc->fd, &fds->sds);
   if (desc->fd + 1 > fds->nsds)
@@ -821,7 +828,7 @@
  */
 int
 GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds,
-                            const struct GNUNET_NETWORK_Handle *desc)
+                           const struct GNUNET_NETWORK_Handle *desc)
 {
   return FD_ISSET (desc->fd, &fds->sds);
 }
@@ -834,18 +841,18 @@
  */
 void
 GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
-                          const struct GNUNET_NETWORK_FDSet *src)
+                         const struct GNUNET_NETWORK_FDSet *src)
 {
   int nfds;
 
   for (nfds = src->nsds; nfds > 0; nfds--)
     if (FD_ISSET (nfds, &src->sds))
 
-    {
-      FD_SET (nfds, &dst->sds);
-      if (nfds + 1 > dst->nsds)
-        dst->nsds = nfds + 1;
-    }
+      {
+       FD_SET (nfds, &dst->sds);
+       if (nfds + 1 > dst->nsds)
+         dst->nsds = nfds + 1;
+      }
 #ifdef MINGW
   GNUNET_CONTAINER_slist_append (dst->handles, src->handles);
 #endif
@@ -860,7 +867,7 @@
  */
 void
 GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
-                           const struct GNUNET_NETWORK_FDSet *from)
+                          const struct GNUNET_NETWORK_FDSet *from)
 {
   FD_COPY (&from->sds, &to->sds);
   to->nsds = from->nsds;
@@ -894,7 +901,7 @@
  */
 void
 GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
-                                  const fd_set * from, int nfds)
+                                 const fd_set * from, int nfds)
 {
   FD_COPY (from, &to->sds);
   to->nsds = nfds;
@@ -925,7 +932,7 @@
  */
 int
 GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
-                                  int nfd)
+                                 int nfd)
 {
   if ((nfd == -1) || (to == NULL))
     return GNUNET_NO;
@@ -940,12 +947,12 @@
  */
 void
 GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
-                                 const struct GNUNET_DISK_FileHandle *h)
+                                const struct GNUNET_DISK_FileHandle *h)
 {
 #ifdef MINGW
   GNUNET_CONTAINER_slist_add (fds->handles,
-                              GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT, h,
-                              sizeof (struct GNUNET_DISK_FileHandle));
+                             GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT, h,
+                             sizeof (struct GNUNET_DISK_FileHandle));
 
 #else
   int fd;
@@ -967,13 +974,13 @@
  */
 int
 GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds,
-                                   const struct GNUNET_DISK_FileHandle *h)
+                                  const struct GNUNET_DISK_FileHandle *h)
 {
 
 #ifdef MINGW
   return GNUNET_CONTAINER_slist_contains (fds->handles, h,
-                                          sizeof (struct
-                                                  GNUNET_DISK_FileHandle));
+                                         sizeof (struct
+                                                 GNUNET_DISK_FileHandle));
 #else
   return FD_ISSET (h->fd, &fds->sds);
 #endif
@@ -988,7 +995,7 @@
  */
 int
 GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
-                              const struct GNUNET_NETWORK_FDSet *fds2)
+                             const struct GNUNET_NETWORK_FDSet *fds2)
 {
 #ifndef MINGW
   int nfds;
@@ -997,11 +1004,11 @@
   if (nfds > fds2->nsds)
     nfds = fds2->nsds;
   while (nfds > 0)
-  {
-    nfds--;
-    if (FD_ISSET (nfds, &fds1->sds) && FD_ISSET (nfds, &fds2->sds))
-      return GNUNET_YES;
-  }
+    {
+      nfds--;
+      if (FD_ISSET (nfds, &fds1->sds) && FD_ISSET (nfds, &fds2->sds))
+       return GNUNET_YES;
+    }
 #else
   struct GNUNET_CONTAINER_SList_Iterator *it;
   struct GNUNET_DISK_FileHandle *h;
@@ -1012,45 +1019,48 @@
    * inside of fd_set; also the O(n^2) is really bad... */
 
   for (i = 0; i < fds1->sds.fd_count; i++)
-  {
-    for (j = 0; j < fds2->sds.fd_count; j++)
     {
-      if (fds1->sds.fd_array[i] == fds2->sds.fd_array[j])
-        return GNUNET_YES;
+      for (j = 0; j < fds2->sds.fd_count; j++)
+       {
+         if (fds1->sds.fd_array[i] == fds2->sds.fd_array[j])
+           return GNUNET_YES;
+       }
     }
-  }
   it = GNUNET_CONTAINER_slist_begin (fds1->handles);
   while (GNUNET_CONTAINER_slist_end (it) != GNUNET_YES)
-  {
+    {
 #if DEBUG_NETWORK
-    struct GNUNET_CONTAINER_SList_Iterator *t;
+      struct GNUNET_CONTAINER_SList_Iterator *t;
 #endif
-    h = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (it, 
NULL);
+      h =
+       (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (it,
+                                                                     NULL);
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Checking that FD 0x%x is in another set:\n", h->h);
-    for (t = GNUNET_CONTAINER_slist_begin (fds2->handles);
-         GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
-         GNUNET_CONTAINER_slist_next (t))
-    {
-      struct GNUNET_DISK_FileHandle *fh;
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Checking that FD 0x%x is in another set:\n", h->h);
+      for (t = GNUNET_CONTAINER_slist_begin (fds2->handles);
+          GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
+          GNUNET_CONTAINER_slist_next (t))
+       {
+         struct GNUNET_DISK_FileHandle *fh;
 
-      fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
-                                                                         NULL);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "0x%x\n", fh->h);
-    }
+         fh =
+           (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
+                                                                         NULL);
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "0x%x\n", fh->h);
+       }
 #endif
-    if (GNUNET_CONTAINER_slist_contains
-        (fds2->handles, h, sizeof (struct GNUNET_DISK_FileHandle)))
-    {
+      if (GNUNET_CONTAINER_slist_contains
+         (fds2->handles, h, sizeof (struct GNUNET_DISK_FileHandle)))
+       {
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Match!\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "Match!\n");
 #endif
-      GNUNET_CONTAINER_slist_iter_destroy (it);
-      return GNUNET_YES;
+         GNUNET_CONTAINER_slist_iter_destroy (it);
+         return GNUNET_YES;
+       }
+      GNUNET_CONTAINER_slist_next (it);
     }
-    GNUNET_CONTAINER_slist_next (it);
-  }
   GNUNET_CONTAINER_slist_iter_destroy (it);
 #endif
   return GNUNET_NO;
@@ -1098,9 +1108,9 @@
  */
 int
 GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
-                              struct GNUNET_NETWORK_FDSet *wfds,
-                              struct GNUNET_NETWORK_FDSet *efds,
-                              const struct GNUNET_TIME_Relative timeout)
+                             struct GNUNET_NETWORK_FDSet *wfds,
+                             struct GNUNET_NETWORK_FDSet *efds,
+                             const struct GNUNET_TIME_Relative timeout)
 {
   int nfds = 0;
 
@@ -1130,7 +1140,8 @@
   DWORD newretcode = 0;
   int returnedpos = 0;
 
-  struct GNUNET_CONTAINER_SList *handles_read, *handles_write, *handles_except;
+  struct GNUNET_CONTAINER_SList *handles_read, *handles_write,
+    *handles_except;
 
   fd_set aread, awrite, aexcept;
 
@@ -1144,67 +1155,68 @@
   struct timeval tv;
 #endif
   if (NULL != rfds)
-  {
-    nfds = rfds->nsds;
+    {
+      nfds = rfds->nsds;
 #ifdef MINGW
-    handles += read_handles = GNUNET_CONTAINER_slist_count (rfds->handles);
+      handles += read_handles = GNUNET_CONTAINER_slist_count (rfds->handles);
 #if DEBUG_NETWORK
-    {
-      struct GNUNET_CONTAINER_SList_Iterator *t;
-
-      for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
-           GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
-           GNUNET_CONTAINER_slist_next (t))
       {
-        struct GNUNET_DISK_FileHandle *fh;
+       struct GNUNET_CONTAINER_SList_Iterator *t;
 
-        fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
-                                                                           
NULL);
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x (0x%x) is SET in rfds\n",
-                    fh->h, fh);
+       for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
+            GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
+            GNUNET_CONTAINER_slist_next (t))
+         {
+           struct GNUNET_DISK_FileHandle *fh;
+
+           fh =
+             (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
+                                                                           
NULL);
+           LOG (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x (0x%x) is SET in rfds\n",
+                fh->h, fh);
+         }
       }
-    }
 #endif
 #endif
-  }
+    }
   if (NULL != wfds)
-  {
-    nfds = GNUNET_MAX (nfds, wfds->nsds);
+    {
+      nfds = GNUNET_MAX (nfds, wfds->nsds);
 #ifdef MINGW
-    handles += write_handles = GNUNET_CONTAINER_slist_count (wfds->handles);
+      handles += write_handles = GNUNET_CONTAINER_slist_count (wfds->handles);
 #endif
-  }
+    }
   if (NULL != efds)
-  {
-    nfds = GNUNET_MAX (nfds, efds->nsds);
+    {
+      nfds = GNUNET_MAX (nfds, efds->nsds);
 #ifdef MINGW
-    handles += ex_handles = GNUNET_CONTAINER_slist_count (efds->handles);
+      handles += ex_handles = GNUNET_CONTAINER_slist_count (efds->handles);
 #endif
-  }
+    }
 
   if ((nfds == 0) &&
       (timeout.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
 #ifdef MINGW
       && handles == 0
 #endif
-      )
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _
-                ("Fatal internal logic error, process hangs in `%s' (abort 
with CTRL-C)!\n"),
-                "select");
-    GNUNET_break (0);
-  }
+    )
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _
+          ("Fatal internal logic error, process hangs in `%s' (abort with 
CTRL-C)!\n"),
+          "select");
+      GNUNET_break (0);
+    }
 #ifndef MINGW
   tv.tv_sec = timeout.rel_value / GNUNET_TIME_UNIT_SECONDS.rel_value;
   tv.tv_usec =
-      1000 * (timeout.rel_value -
-              (tv.tv_sec * GNUNET_TIME_UNIT_SECONDS.rel_value));
+    1000 * (timeout.rel_value -
+           (tv.tv_sec * GNUNET_TIME_UNIT_SECONDS.rel_value));
   return select (nfds, (rfds != NULL) ? &rfds->sds : NULL,
-                 (wfds != NULL) ? &wfds->sds : NULL,
-                 (efds != NULL) ? &efds->sds : NULL,
-                 (timeout.rel_value ==
-                  GNUNET_TIME_UNIT_FOREVER_REL.rel_value) ? NULL : &tv);
+                (wfds != NULL) ? &wfds->sds : NULL,
+                (efds != NULL) ? &efds->sds : NULL,
+                (timeout.rel_value ==
+                 GNUNET_TIME_UNIT_FOREVER_REL.rel_value) ? NULL : &tv);
 
 #else
 #define SAFE_FD_ISSET(fd, set)  (set != NULL && FD_ISSET(fd, set))
@@ -1215,10 +1227,10 @@
     ms_total = timeout.rel_value / GNUNET_TIME_UNIT_MILLISECONDS.rel_value;
   /* select() may be used as a portable way to sleep */
   if (!(rfds || wfds || efds))
-  {
-    Sleep (ms_total);
-    return 0;
-  }
+    {
+      Sleep (ms_total);
+      return 0;
+    }
 
   /* Events for sockets */
   if (!hEventRead)
@@ -1254,212 +1266,217 @@
   FD_ZERO (&bexcept);
 #endif
   if (rfds)
-  {
-    FD_COPY (&rfds->sds, &aread);
+    {
+      FD_COPY (&rfds->sds, &aread);
 #if DEBUG_NETWORK
-    FD_COPY (&rfds->sds, &bread);
+      FD_COPY (&rfds->sds, &bread);
 #endif
-  }
+    }
   if (wfds)
-  {
-    FD_COPY (&wfds->sds, &awrite);
+    {
+      FD_COPY (&wfds->sds, &awrite);
 #if DEBUG_NETWORK
-    FD_COPY (&wfds->sds, &bwrite);
+      FD_COPY (&wfds->sds, &bwrite);
 #endif
-  }
+    }
   if (efds)
-  {
-    FD_COPY (&efds->sds, &aexcept);
+    {
+      FD_COPY (&efds->sds, &aexcept);
 #if DEBUG_NETWORK
-    FD_COPY (&efds->sds, &bexcept);
+      FD_COPY (&efds->sds, &bexcept);
 #endif
-  }
+    }
   /* We will first Add the PIPES to the events */
   /* Read Pipes */
   if (rfds && read_handles)
-  {
-    struct GNUNET_CONTAINER_SList_Iterator *i;
-
-    for (i = GNUNET_CONTAINER_slist_begin (rfds->handles);
-         GNUNET_CONTAINER_slist_end (i) != GNUNET_YES;
-         GNUNET_CONTAINER_slist_next (i))
     {
-      struct GNUNET_DISK_FileHandle *fh;
+      struct GNUNET_CONTAINER_SList_Iterator *i;
 
-      fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (i,
-                                                                         NULL);
-      if (fh->type == GNUNET_PIPE)
-      {
-        /* Read zero bytes to check the status of the pipe */
+      for (i = GNUNET_CONTAINER_slist_begin (rfds->handles);
+          GNUNET_CONTAINER_slist_end (i) != GNUNET_YES;
+          GNUNET_CONTAINER_slist_next (i))
+       {
+         struct GNUNET_DISK_FileHandle *fh;
+
+         fh =
+           (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (i,
+                                                                         NULL);
+         if (fh->type == GNUNET_PIPE)
+           {
+             /* Read zero bytes to check the status of the pipe */
 #if DEBUG_NETWORK
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Reading 0 bytes from the pipe 0x%x\n", fh->h);
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "Reading 0 bytes from the pipe 0x%x\n", fh->h);
 #endif
-        if (!ReadFile (fh->h, NULL, 0, NULL, fh->oOverlapRead))
-        {
-          DWORD error_code = GetLastError ();
+             if (!ReadFile (fh->h, NULL, 0, NULL, fh->oOverlapRead))
+               {
+                 DWORD error_code = GetLastError ();
 
-          if (error_code == ERROR_IO_PENDING)
-          {
+                 if (error_code == ERROR_IO_PENDING)
+                   {
 #if DEBUG_NETWORK
-            GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                        "Adding the pipe's 0x%x overlapped event to the array 
as %d\n",
-                        fh->h, nhandles);
+                     LOG (GNUNET_ERROR_TYPE_DEBUG,
+                          "Adding the pipe's 0x%x overlapped event to the 
array as %d\n",
+                          fh->h, nhandles);
 #endif
-            handle_array[nhandles++] = fh->oOverlapRead->hEvent;
-            readArray[readPipes++] = fh;
-          }
-          /*
-           * else
-           * {
-           * SetErrnoFromWinError (error_code);
-           * }
-           */
-        }
-        else
-        {
+                     handle_array[nhandles++] = fh->oOverlapRead->hEvent;
+                     readArray[readPipes++] = fh;
+                   }
+                 /*
+                  * else
+                  * {
+                  * SetErrnoFromWinError (error_code);
+                  * }
+                  */
+               }
+             else
+               {
 #if DEBUG_NETWORK
-          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                      "Adding the read ready event to the array as %d\n",
-                      nhandles);
+                 LOG (GNUNET_ERROR_TYPE_DEBUG,
+                      "Adding the read ready event to the array as %d\n",
+                      nhandles);
 #endif
-          handle_array[nhandles++] = hEventReadReady;
-          readArray[readPipes++] = fh;
-        }
-      }
-      else
-      {
-        GNUNET_CONTAINER_slist_add (handles_read,
-                                    
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                    fh, sizeof (struct 
GNUNET_DISK_FileHandle));
-      }
+                 handle_array[nhandles++] = hEventReadReady;
+                 readArray[readPipes++] = fh;
+               }
+           }
+         else
+           {
+             GNUNET_CONTAINER_slist_add (handles_read,
+                                         
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                         fh,
+                                         sizeof (struct
+                                                 GNUNET_DISK_FileHandle));
+           }
+       }
+      GNUNET_CONTAINER_slist_iter_destroy (i);
     }
-    GNUNET_CONTAINER_slist_iter_destroy (i);
-  }
   if (wfds && write_handles)
-  {
+    {
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Adding the write ready event to the array as %d\n", nhandles);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Adding the write ready event to the array as %d\n", nhandles);
 #endif
-    handle_array[nhandles++] = hEventPipeWrite;
-    writePipePos = nhandles;
-  }
+      handle_array[nhandles++] = hEventPipeWrite;
+      writePipePos = nhandles;
+    }
   if (efds && ex_handles)
-  {
-    struct GNUNET_CONTAINER_SList_Iterator *i;
-
-    for (i = GNUNET_CONTAINER_slist_begin (efds->handles);
-         GNUNET_CONTAINER_slist_end (i) != GNUNET_YES;
-         GNUNET_CONTAINER_slist_next (i))
     {
-      struct GNUNET_DISK_FileHandle *fh;
-      DWORD dwBytes;
+      struct GNUNET_CONTAINER_SList_Iterator *i;
 
-      fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (i,
-                                                                         NULL);
-      if (fh->type == GNUNET_PIPE)
-      {
-        if (!PeekNamedPipe (fh->h, NULL, 0, NULL, &dwBytes, NULL))
-        {
-          GNUNET_CONTAINER_slist_add (handles_except,
-                                      
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                      fh,
-                                      sizeof (struct GNUNET_DISK_FileHandle));
-          newretcode++;
-        }
-      }
+      for (i = GNUNET_CONTAINER_slist_begin (efds->handles);
+          GNUNET_CONTAINER_slist_end (i) != GNUNET_YES;
+          GNUNET_CONTAINER_slist_next (i))
+       {
+         struct GNUNET_DISK_FileHandle *fh;
+         DWORD dwBytes;
+
+         fh =
+           (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (i,
+                                                                         NULL);
+         if (fh->type == GNUNET_PIPE)
+           {
+             if (!PeekNamedPipe (fh->h, NULL, 0, NULL, &dwBytes, NULL))
+               {
+                 GNUNET_CONTAINER_slist_add (handles_except,
+                                             
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                             fh,
+                                             sizeof (struct
+                                                     GNUNET_DISK_FileHandle));
+                 newretcode++;
+               }
+           }
+       }
+      GNUNET_CONTAINER_slist_iter_destroy (i);
     }
-    GNUNET_CONTAINER_slist_iter_destroy (i);
-  }
   if (nfds > 0)
-  {
-    if (rfds)
     {
+      if (rfds)
+       {
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Adding the socket read event to the array as %d\n",
-                  nhandles);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Adding the socket read event to the array as %d\n", nhandles);
 #endif
-      handle_array[nhandles++] = hEventRead;
-      nSockEvents++;
-      for (i = 0; i < rfds->sds.fd_count; i++)
-      {
-        WSAEventSelect (rfds->sds.fd_array[i], hEventRead,
-                        FD_ACCEPT | FD_READ | FD_CLOSE);
-        nsock++;
-      }
-    }
-    if (wfds)
-    {
-      int wakeup = 0;
+         handle_array[nhandles++] = hEventRead;
+         nSockEvents++;
+         for (i = 0; i < rfds->sds.fd_count; i++)
+           {
+             WSAEventSelect (rfds->sds.fd_array[i], hEventRead,
+                             FD_ACCEPT | FD_READ | FD_CLOSE);
+             nsock++;
+           }
+       }
+      if (wfds)
+       {
+         int wakeup = 0;
 
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Adding the socket write event to the array as %d\n",
-                  nhandles);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Adding the socket write event to the array as %d\n",
+              nhandles);
 #endif
-      handle_array[nhandles++] = hEventWrite;
-      nSockEvents++;
-      for (i = 0; i < wfds->sds.fd_count; i++)
-      {
-        DWORD error;
-        int status;
+         handle_array[nhandles++] = hEventWrite;
+         nSockEvents++;
+         for (i = 0; i < wfds->sds.fd_count; i++)
+           {
+             DWORD error;
+             int status;
 
-        status = send (wfds->sds.fd_array[i], NULL, 0, 0);
-        error = GetLastError ();
+             status = send (wfds->sds.fd_array[i], NULL, 0, 0);
+             error = GetLastError ();
 #if DEBUG_NETWORK
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "pre-send to the socket %d returned %d (%u)\n", i, status,
-                    error);
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "pre-send to the socket %d returned %d (%u)\n", i, status,
+                  error);
 #endif
-        if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN))
-          wakeup = 1;
-        WSAEventSelect (wfds->sds.fd_array[i], hEventWrite,
-                        FD_WRITE | FD_CONNECT | FD_CLOSE);
-        nsock++;
-      }
-      if (wakeup)
-        SetEvent (hEventWrite);
-    }
-    if (efds)
-    {
+             if (status == 0
+                 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN))
+               wakeup = 1;
+             WSAEventSelect (wfds->sds.fd_array[i], hEventWrite,
+                             FD_WRITE | FD_CONNECT | FD_CLOSE);
+             nsock++;
+           }
+         if (wakeup)
+           SetEvent (hEventWrite);
+       }
+      if (efds)
+       {
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Adding the socket error event to the array as %d\n",
-                  nhandles);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Adding the socket error event to the array as %d\n",
+              nhandles);
 #endif
-      handle_array[nhandles++] = hEventException;
-      nSockEvents++;
-      for (i = 0; i < efds->sds.fd_count; i++)
-      {
-        WSAEventSelect (efds->sds.fd_array[i], hEventException,
-                        FD_OOB | FD_CLOSE);
-        nsock++;
-      }
+         handle_array[nhandles++] = hEventException;
+         nSockEvents++;
+         for (i = 0; i < efds->sds.fd_count; i++)
+           {
+             WSAEventSelect (efds->sds.fd_array[i], hEventException,
+                             FD_OOB | FD_CLOSE);
+             nsock++;
+           }
+       }
     }
-  }
 
   handle_array[nhandles] = NULL;
 
 #if DEBUG_NETWORK
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Number nfds : %d\n", nfds);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Number of handles : %d\n", nhandles);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "retcode : %d\n", newretcode);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Will wait : %d\n", ms_total);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Number nfds : %d\n", nfds);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Number of handles : %d\n", nhandles);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "retcode : %d\n", newretcode);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Will wait : %d\n", ms_total);
 #endif
 
   if (nhandles)
     returncode =
-        WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total);
+      WaitForMultipleObjects (nhandles, handle_array, FALSE, ms_total);
 #if DEBUG_NETWORK
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "WaitForMultipleObjects Returned : 
%d\n",
-              returncode);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "WaitForMultipleObjects Returned : %d\n",
+       returncode);
 #endif
 
   returnedpos = returncode - WAIT_OBJECT_0;
 #if DEBUG_NETWORK
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "return pos is : %d\n", returnedpos);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "return pos is : %d\n", returnedpos);
 #endif
 
   /* FIXME: THIS LINE IS WRONG !! We should add to handles only handles that 
fired the events, not all ! */
@@ -1468,237 +1485,241 @@
    * GNUNET_CONTAINER_slist_append (handles_read, rfds->handles);
    */
   if (nhandles && (returnedpos < nhandles))
-  {
-    DWORD waitstatus;
-
-    /* Do the select */
-    if (nfds)
     {
-      struct timeval tvslice;
+      DWORD waitstatus;
 
-      tvslice.tv_sec = 0;
-      tvslice.tv_usec = 10;
-      retcode = select (nfds, &aread, &awrite, &aexcept, &tvslice);
-      if (retcode == -1)
-        retcode = 0;
+      /* Do the select */
+      if (nfds)
+       {
+         struct timeval tvslice;
+
+         tvslice.tv_sec = 0;
+         tvslice.tv_usec = 10;
+         retcode = select (nfds, &aread, &awrite, &aexcept, &tvslice);
+         if (retcode == -1)
+           retcode = 0;
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Select retcode : %d\n", retcode);
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "Select retcode : %d\n", retcode);
 #endif
-    }
-    /* FIXME: <= writePipePos? Really? */
-    if ((writePipePos != -1) && (returnedpos <= writePipePos))
-    {
-      GNUNET_CONTAINER_slist_append (handles_write, wfds->handles);
-      retcode += write_handles;
+       }
+      /* FIXME: <= writePipePos? Really? */
+      if ((writePipePos != -1) && (returnedpos <= writePipePos))
+       {
+         GNUNET_CONTAINER_slist_append (handles_write, wfds->handles);
+         retcode += write_handles;
 #if DEBUG_NETWORK
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added write pipe\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "Added write pipe\n");
 #endif
-    }
+       }
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ReadPipes is : %d\n", readPipes);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "ReadPipes is : %d\n", readPipes);
 #endif
-    /* We have some pipes ready for read. */
-    /* FIXME: it is supposed to work !! Only choose the Pipes who fired the 
event, but it is not working */
+      /* We have some pipes ready for read. */
+      /* FIXME: it is supposed to work !! Only choose the Pipes who fired the 
event, but it is not working */
 
-    if (returnedpos < readPipes)
-    {
-      /*
-       * for (i = 0; i < readPipes; i++)
-       * {
-       * waitstatus = WaitForSingleObject (handle_array[i], 0);
-       * GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read pipe %d wait status is : 
%d\n", i, waitstatus);
-       * if (waitstatus != WAIT_OBJECT_0)
-       * continue;
-       * GNUNET_CONTAINER_slist_add (handles_read,
-       * GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-       * readArray[i], sizeof (struct GNUNET_DISK_FileHandle));
-       * retcode++;
-       * GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added read Pipe\n");
-       * }
-       */
-      for (i = 0; i < readPipes; i++)
-      {
-        DWORD error;
-        BOOL bret;
+      if (returnedpos < readPipes)
+       {
+         /*
+          * for (i = 0; i < readPipes; i++)
+          * {
+          * waitstatus = WaitForSingleObject (handle_array[i], 0);
+          * LOG (GNUNET_ERROR_TYPE_DEBUG, "Read pipe %d wait status is : 
%d\n", i, waitstatus);
+          * if (waitstatus != WAIT_OBJECT_0)
+          * continue;
+          * GNUNET_CONTAINER_slist_add (handles_read,
+          * GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+          * readArray[i], sizeof (struct GNUNET_DISK_FileHandle));
+          * retcode++;
+          * LOG (GNUNET_ERROR_TYPE_DEBUG, "Added read Pipe\n");
+          * }
+          */
+         for (i = 0; i < readPipes; i++)
+           {
+             DWORD error;
+             BOOL bret;
 
-        SetLastError (0);
-        waitstatus = 0;
-        bret =
-            PeekNamedPipe (readArray[i]->h, NULL, 0, NULL, &waitstatus, NULL);
-        error = GetLastError ();
+             SetLastError (0);
+             waitstatus = 0;
+             bret =
+               PeekNamedPipe (readArray[i]->h, NULL, 0, NULL, &waitstatus,
+                              NULL);
+             error = GetLastError ();
 #if DEBUG_NETWORK
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Peek at read pipe %d (0x%x) returned %d (%d bytes 
available) GLE %u\n",
-                    i, readArray[i]->h, bret, waitstatus, error);
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "Peek at read pipe %d (0x%x) returned %d (%d bytes 
available) GLE %u\n",
+                  i, readArray[i]->h, bret, waitstatus, error);
 #endif
-        if (bret == 0)
-        {
-          if (error != ERROR_BROKEN_PIPE)
-            continue;
-        }
-        else if (waitstatus <= 0)
-          continue;
-        GNUNET_CONTAINER_slist_add (handles_read,
-                                    
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                    readArray[i],
-                                    sizeof (struct GNUNET_DISK_FileHandle));
-        retcode++;
+             if (bret == 0)
+               {
+                 if (error != ERROR_BROKEN_PIPE)
+                   continue;
+               }
+             else if (waitstatus <= 0)
+               continue;
+             GNUNET_CONTAINER_slist_add (handles_read,
+                                         
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                         readArray[i],
+                                         sizeof (struct
+                                                 GNUNET_DISK_FileHandle));
+             retcode++;
 #if DEBUG_NETWORK
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added read Pipe 0x%x (0x%x)\n",
-                    readArray[i], readArray[i]->h);
+             LOG (GNUNET_ERROR_TYPE_DEBUG, "Added read Pipe 0x%x (0x%x)\n",
+                  readArray[i], readArray[i]->h);
 #endif
-      }
-    }
-    waitstatus = WaitForSingleObject (hEventWrite, 0);
+           }
+       }
+      waitstatus = WaitForSingleObject (hEventWrite, 0);
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Wait for the write event returned %d\n", waitstatus);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Wait for the write event returned %d\n", waitstatus);
 #endif
-    if (waitstatus == WAIT_OBJECT_0)
-    {
-      for (i = 0; i < wfds->sds.fd_count; i++)
-      {
-        DWORD error;
-        int status;
-        int so_error = 0;
-        int sizeof_so_error = sizeof (so_error);
-        int gso_result =
-            getsockopt (wfds->sds.fd_array[i], SOL_SOCKET, SO_ERROR,
-                        (char *) &so_error, &sizeof_so_error);
+      if (waitstatus == WAIT_OBJECT_0)
+       {
+         for (i = 0; i < wfds->sds.fd_count; i++)
+           {
+             DWORD error;
+             int status;
+             int so_error = 0;
+             int sizeof_so_error = sizeof (so_error);
+             int gso_result =
+               getsockopt (wfds->sds.fd_array[i], SOL_SOCKET, SO_ERROR,
+                           (char *) &so_error, &sizeof_so_error);
 
-        status = send (wfds->sds.fd_array[i], NULL, 0, 0);
-        error = GetLastError ();
+             status = send (wfds->sds.fd_array[i], NULL, 0, 0);
+             error = GetLastError ();
 #if DEBUG_NETWORK
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "send to the socket %d returned %d (%u)\n", i, status,
-                    error);
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "send to the socket %d returned %d (%u)\n", i, status,
+                  error);
 #endif
-        if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN) ||
-            (status == -1 && gso_result == 0 && error == WSAENOTCONN &&
-             so_error == WSAECONNREFUSED))
-        {
-          FD_SET (wfds->sds.fd_array[i], &awrite);
-          retcode += 1;
-        }
-      }
+             if (status == 0
+                 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN)
+                 || (status == -1 && gso_result == 0 && error == WSAENOTCONN
+                     && so_error == WSAECONNREFUSED))
+               {
+                 FD_SET (wfds->sds.fd_array[i], &awrite);
+                 retcode += 1;
+               }
+           }
+       }
     }
-  }
 #if DEBUG_NETWORK
   if (!nhandles || (returnedpos >= nhandles))
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Returning from _select() with nothing!\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Returning from _select() with nothing!\n");
 #endif
   if (rfds)
-  {
-    struct GNUNET_CONTAINER_SList_Iterator *t;
-
-    for (i = 0; i < rfds->sds.fd_count; i++)
     {
-      WSAEventSelect (rfds->sds.fd_array[i], hEventRead, 0);
-      nsock++;
-    }
-    for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
-         GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
-         GNUNET_CONTAINER_slist_next (t))
-    {
-      struct GNUNET_DISK_FileHandle *fh;
+      struct GNUNET_CONTAINER_SList_Iterator *t;
 
-      fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
-                                                                         NULL);
-      if (fh->type == GNUNET_PIPE)
-      {
-        CancelIo (fh->h);
-      }
-    }
-    GNUNET_CONTAINER_slist_iter_destroy (t);
+      for (i = 0; i < rfds->sds.fd_count; i++)
+       {
+         WSAEventSelect (rfds->sds.fd_array[i], hEventRead, 0);
+         nsock++;
+       }
+      for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
+          GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
+          GNUNET_CONTAINER_slist_next (t))
+       {
+         struct GNUNET_DISK_FileHandle *fh;
+
+         fh =
+           (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
+                                                                         NULL);
+         if (fh->type == GNUNET_PIPE)
+           {
+             CancelIo (fh->h);
+           }
+       }
+      GNUNET_CONTAINER_slist_iter_destroy (t);
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Zeroing rfds\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Zeroing rfds\n");
 #endif
-    GNUNET_NETWORK_fdset_zero (rfds);
-    if (retcode != -1 && nhandles && (returnedpos < nhandles))
-      GNUNET_NETWORK_fdset_copy_native (rfds, &aread, retcode);
-    GNUNET_CONTAINER_slist_append (rfds->handles, handles_read);
-  }
+      GNUNET_NETWORK_fdset_zero (rfds);
+      if (retcode != -1 && nhandles && (returnedpos < nhandles))
+       GNUNET_NETWORK_fdset_copy_native (rfds, &aread, retcode);
+      GNUNET_CONTAINER_slist_append (rfds->handles, handles_read);
+    }
   if (wfds)
-  {
-    for (i = 0; i < wfds->sds.fd_count; i++)
     {
-      WSAEventSelect (wfds->sds.fd_array[i], hEventWrite, 0);
-      nsock++;
-    }
+      for (i = 0; i < wfds->sds.fd_count; i++)
+       {
+         WSAEventSelect (wfds->sds.fd_array[i], hEventWrite, 0);
+         nsock++;
+       }
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Zeroing wfds\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Zeroing wfds\n");
 #endif
-    GNUNET_NETWORK_fdset_zero (wfds);
-    if (retcode != -1 && nhandles && (returnedpos < nhandles))
-      GNUNET_NETWORK_fdset_copy_native (wfds, &awrite, retcode);
-    GNUNET_CONTAINER_slist_append (wfds->handles, handles_write);
-  }
+      GNUNET_NETWORK_fdset_zero (wfds);
+      if (retcode != -1 && nhandles && (returnedpos < nhandles))
+       GNUNET_NETWORK_fdset_copy_native (wfds, &awrite, retcode);
+      GNUNET_CONTAINER_slist_append (wfds->handles, handles_write);
+    }
   if (efds)
-  {
-    for (i = 0; i < efds->sds.fd_count; i++)
     {
-      WSAEventSelect (efds->sds.fd_array[i], hEventException, 0);
-      nsock++;
-    }
+      for (i = 0; i < efds->sds.fd_count; i++)
+       {
+         WSAEventSelect (efds->sds.fd_array[i], hEventException, 0);
+         nsock++;
+       }
 #if DEBUG_NETWORK
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Zeroing efds\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Zeroing efds\n");
 #endif
-    GNUNET_NETWORK_fdset_zero (efds);
-    if (retcode != -1 && nhandles && (returnedpos < nhandles))
-      GNUNET_NETWORK_fdset_copy_native (efds, &aexcept, retcode);
-    GNUNET_CONTAINER_slist_append (efds->handles, handles_except);
-  }
+      GNUNET_NETWORK_fdset_zero (efds);
+      if (retcode != -1 && nhandles && (returnedpos < nhandles))
+       GNUNET_NETWORK_fdset_copy_native (efds, &aexcept, retcode);
+      GNUNET_CONTAINER_slist_append (efds->handles, handles_except);
+    }
   GNUNET_CONTAINER_slist_destroy (handles_read);
   GNUNET_CONTAINER_slist_destroy (handles_write);
   GNUNET_CONTAINER_slist_destroy (handles_except);
 #if DEBUG_NETWORK
   if (rfds)
-  {
-    struct GNUNET_CONTAINER_SList_Iterator *t;
-
-    for (i = 0; i < bread.fd_count; i++)
     {
-      if (bread.fd_array[i] != 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in rfds\n",
-                    bread.fd_array[i],
-                    (SAFE_FD_ISSET (bread.fd_array[i], rfds)) ? "SET" :
-                    "NOT SET");
-    }
-    for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
-         GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
-         GNUNET_CONTAINER_slist_next (t))
-    {
-      struct GNUNET_DISK_FileHandle *fh;
+      struct GNUNET_CONTAINER_SList_Iterator *t;
 
-      fh = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
-                                                                         NULL);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is SET in rfds\n", fh->h);
+      for (i = 0; i < bread.fd_count; i++)
+       {
+         if (bread.fd_array[i] != 0)
+           LOG (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in rfds\n",
+                bread.fd_array[i],
+                (SAFE_FD_ISSET (bread.fd_array[i], rfds)) ? "SET" :
+                "NOT SET");
+       }
+      for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
+          GNUNET_CONTAINER_slist_end (t) != GNUNET_YES;
+          GNUNET_CONTAINER_slist_next (t))
+       {
+         struct GNUNET_DISK_FileHandle *fh;
+
+         fh =
+           (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (t,
+                                                                         NULL);
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is SET in rfds\n", fh->h);
+       }
     }
-  }
   if (wfds)
-  {
-    for (i = 0; i < bwrite.fd_count; i++)
     {
-      if (bwrite.fd_array[i] != 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in wfds\n",
-                    bwrite.fd_array[i],
-                    (SAFE_FD_ISSET (bwrite.fd_array[i], rfds)) ? "SET" :
-                    "NOT SET");
+      for (i = 0; i < bwrite.fd_count; i++)
+       {
+         if (bwrite.fd_array[i] != 0)
+           LOG (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in wfds\n",
+                bwrite.fd_array[i],
+                (SAFE_FD_ISSET (bwrite.fd_array[i], rfds)) ? "SET" :
+                "NOT SET");
+       }
     }
-  }
   if (efds)
-  {
-    for (i = 0; i < bexcept.fd_count; i++)
     {
-      if (bexcept.fd_array[i] != 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in efds\n",
-                    bexcept.fd_array[i],
-                    (SAFE_FD_ISSET (bexcept.fd_array[i], rfds)) ? "SET" :
-                    "NOT SET");
+      for (i = 0; i < bexcept.fd_count; i++)
+       {
+         if (bexcept.fd_array[i] != 0)
+           LOG (GNUNET_ERROR_TYPE_DEBUG, "FD 0x%x is %s in efds\n",
+                bexcept.fd_array[i],
+                (SAFE_FD_ISSET (bexcept.fd_array[i], rfds)) ? "SET" :
+                "NOT SET");
+       }
     }
-  }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Returning %d or 0\n", retcode);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Returning %d or 0\n", retcode);
 #endif
   if (nhandles && (returnedpos < nhandles))
     return retcode;

Modified: gnunet/src/util/os_installation.c
===================================================================
--- gnunet/src/util/os_installation.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/os_installation.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -38,6 +38,10 @@
 #include <mach-o/dyld.h>
 #endif
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 #if LINUX
 /**
  * Try to determine path by reading /proc/PID/exe
@@ -56,16 +60,16 @@
   if (f == NULL)
     return NULL;
   while (NULL != fgets (line, sizeof (line), f))
-  {
-    if ((1 ==
-         sscanf (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) 
&&
-        (NULL != (lgu = strstr (dir, "libgnunetutil"))))
     {
-      lgu[0] = '\0';
-      fclose (f);
-      return GNUNET_strdup (dir);
+      if ((1 ==
+          sscanf (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s",
+                  dir)) && (NULL != (lgu = strstr (dir, "libgnunetutil"))))
+       {
+         lgu[0] = '\0';
+         fclose (f);
+         return GNUNET_strdup (dir);
+       }
     }
-  }
   fclose (f);
   return NULL;
 }
@@ -83,19 +87,19 @@
   GNUNET_snprintf (fn, sizeof (fn), "/proc/%u/exe", getpid ());
   size = readlink (fn, lnk, sizeof (lnk) - 1);
   if (size <= 0)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "readlink", fn);
-    return NULL;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "readlink", fn);
+      return NULL;
+    }
   GNUNET_assert (size < sizeof (lnk));
   lnk[size] = '\0';
   while ((lnk[size] != '/') && (size > 0))
     size--;
   if ((size < 4) || (lnk[size - 4] != '/'))
-  {
-    /* not installed in "/bin/" -- binary path probably useless */
-    return NULL;
-  }
+    {
+      /* not installed in "/bin/" -- binary path probably useless */
+      return NULL;
+    }
   lnk[size] = '\0';
   return GNUNET_strdup (lnk);
 }
@@ -134,7 +138,7 @@
 
   path = NULL;
   func =
-      (MyNSGetExecutablePathProto) dlsym (RTLD_DEFAULT, 
"_NSGetExecutablePath");
+    (MyNSGetExecutablePathProto) dlsym (RTLD_DEFAULT, "_NSGetExecutablePath");
   if (!func)
     return NULL;
   path = &zero;
@@ -146,10 +150,10 @@
   path = GNUNET_malloc (len);
   ret = func (path, &len);
   if (ret != 0)
-  {
-    GNUNET_free (path);
-    return NULL;
-  }
+    {
+      GNUNET_free (path);
+      return NULL;
+    }
   len = strlen (path);
   while ((path[len] != '/') && (len > 0))
     len--;
@@ -168,22 +172,22 @@
   p = NULL;
   c = _dyld_image_count ();
   for (i = 0; i < c; i++)
-  {
-    if (_dyld_get_image_header (i) == &_mh_dylib_header)
     {
-      path = _dyld_get_image_name (i);
-      if (path != NULL && strlen (path) > 0)
-      {
-        p = strdup (path);
-        s = p + strlen (p);
-        while ((s > p) && (*s != '/'))
-          s--;
-        s++;
-        *s = '\0';
-      }
-      break;
+      if (_dyld_get_image_header (i) == &_mh_dylib_header)
+       {
+         path = _dyld_get_image_name (i);
+         if (path != NULL && strlen (path) > 0)
+           {
+             p = strdup (path);
+             s = p + strlen (p);
+             while ((s > p) && (*s != '/'))
+               s--;
+             s++;
+             *s = '\0';
+           }
+         break;
+       }
     }
-  }
   return p;
 }
 #endif
@@ -207,30 +211,30 @@
   p = getenv ("PATH");
   if (p == NULL)
     return NULL;
-  path = GNUNET_strdup (p);     /* because we write on it */
+  path = GNUNET_strdup (p);    /* because we write on it */
   buf = GNUNET_malloc (strlen (path) + 20);
   pos = path;
   while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
-  {
-    *end = '\0';
-    sprintf (buf, "%s/%s", pos, binary);
-    if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
     {
+      *end = '\0';
+      sprintf (buf, "%s/%s", pos, binary);
+      if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
+       {
+         pos = GNUNET_strdup (pos);
+         GNUNET_free (buf);
+         GNUNET_free (path);
+         return pos;
+       }
+      pos = end + 1;
+    }
+  sprintf (buf, "%s/%s", pos, binary);
+  if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
+    {
       pos = GNUNET_strdup (pos);
       GNUNET_free (buf);
       GNUNET_free (path);
       return pos;
     }
-    pos = end + 1;
-  }
-  sprintf (buf, "%s/%s", pos, binary);
-  if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
-  {
-    pos = GNUNET_strdup (pos);
-    GNUNET_free (buf);
-    GNUNET_free (path);
-    return pos;
-  }
   GNUNET_free (buf);
   GNUNET_free (path);
   return NULL;
@@ -286,10 +290,10 @@
   if (ret != NULL)
     return ret;
   /* other attempts here */
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-              _
-              ("Could not determine installation path for %s.  Set `%s' 
environment variable.\n"),
-              "GNUnet", "GNUNET_PREFIX");
+  LOG (GNUNET_ERROR_TYPE_ERROR,
+       _
+       ("Could not determine installation path for %s.  Set `%s' environment 
variable.\n"),
+       "GNUnet", "GNUNET_PREFIX");
   return NULL;
 }
 
@@ -355,11 +359,11 @@
 
   n = strlen (execpath);
   if (n == 0)
-  {
-    /* should never happen, but better safe than sorry */
-    GNUNET_free (execpath);
-    return NULL;
-  }
+    {
+      /* should never happen, but better safe than sorry */
+      GNUNET_free (execpath);
+      return NULL;
+    }
   /* remove filename itself */
   while ((n > 1) && (execpath[n - 1] == DIR_SEPARATOR))
     execpath[--n] = '\0';
@@ -368,59 +372,62 @@
   if ((n > 5) &&
       ((0 == strcasecmp (&execpath[n - 5], "lib32")) ||
        (0 == strcasecmp (&execpath[n - 5], "lib64"))))
-  {
-    if (dirkind != GNUNET_OS_IPK_LIBDIR)
     {
-      /* strip '/lib32' or '/lib64' */
-      execpath[n - 5] = '\0';
-      n -= 5;
+      if (dirkind != GNUNET_OS_IPK_LIBDIR)
+       {
+         /* strip '/lib32' or '/lib64' */
+         execpath[n - 5] = '\0';
+         n -= 5;
+       }
+      else
+       isbasedir = 0;
     }
-    else
-      isbasedir = 0;
-  }
   else if ((n > 3) &&
-           ((0 == strcasecmp (&execpath[n - 3], "bin")) ||
-            (0 == strcasecmp (&execpath[n - 3], "lib"))))
-  {
-    /* strip '/bin' or '/lib' */
-    execpath[n - 3] = '\0';
-    n -= 3;
-  }
+          ((0 == strcasecmp (&execpath[n - 3], "bin")) ||
+           (0 == strcasecmp (&execpath[n - 3], "lib"))))
+    {
+      /* strip '/bin' or '/lib' */
+      execpath[n - 3] = '\0';
+      n -= 3;
+    }
   /* in case this was a directory named foo-bin, remove "foo-" */
   while ((n > 1) && (execpath[n - 1] == DIR_SEPARATOR))
     execpath[--n] = '\0';
   switch (dirkind)
-  {
-  case GNUNET_OS_IPK_PREFIX:
-  case GNUNET_OS_IPK_SELF_PREFIX:
-    dirname = DIR_SEPARATOR_STR;
-    break;
-  case GNUNET_OS_IPK_BINDIR:
-    dirname = DIR_SEPARATOR_STR "bin" DIR_SEPARATOR_STR;
-    break;
-  case GNUNET_OS_IPK_LIBDIR:
-    if (isbasedir)
+    {
+    case GNUNET_OS_IPK_PREFIX:
+    case GNUNET_OS_IPK_SELF_PREFIX:
+      dirname = DIR_SEPARATOR_STR;
+      break;
+    case GNUNET_OS_IPK_BINDIR:
+      dirname = DIR_SEPARATOR_STR "bin" DIR_SEPARATOR_STR;
+      break;
+    case GNUNET_OS_IPK_LIBDIR:
+      if (isbasedir)
+       dirname =
+         DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet"
+         DIR_SEPARATOR_STR;
+      else
+       dirname = DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR;
+      break;
+    case GNUNET_OS_IPK_DATADIR:
       dirname =
-          DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR;
-    else
-      dirname = DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR;
-    break;
-  case GNUNET_OS_IPK_DATADIR:
-    dirname =
-        DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR;
-    break;
-  case GNUNET_OS_IPK_LOCALEDIR:
-    dirname =
-        DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "locale" DIR_SEPARATOR_STR;
-    break;
-  case GNUNET_OS_IPK_ICONDIR:
-    dirname =
-        DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "icons" DIR_SEPARATOR_STR;
-    break;
-  default:
-    GNUNET_free (execpath);
-    return NULL;
-  }
+       DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "gnunet"
+       DIR_SEPARATOR_STR;
+      break;
+    case GNUNET_OS_IPK_LOCALEDIR:
+      dirname =
+       DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "locale"
+       DIR_SEPARATOR_STR;
+      break;
+    case GNUNET_OS_IPK_ICONDIR:
+      dirname =
+       DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "icons" DIR_SEPARATOR_STR;
+      break;
+    default:
+      GNUNET_free (execpath);
+      return NULL;
+    }
   tmp = GNUNET_malloc (strlen (execpath) + strlen (dirname) + 1);
   sprintf (tmp, "%s%s", execpath, dirname);
   GNUNET_free (execpath);
@@ -453,59 +460,59 @@
   GNUNET_asprintf (&binaryexe, "%s.exe", binary);
   p = get_path_from_PATH (binaryexe);
   if (p != NULL)
-  {
-    GNUNET_asprintf (&pf, "%s/%s", p, binaryexe);
-    GNUNET_free (p);
-    p = pf;
-  }
+    {
+      GNUNET_asprintf (&pf, "%s/%s", p, binaryexe);
+      GNUNET_free (p);
+      p = pf;
+    }
   free (binaryexe);
 #else
   p = get_path_from_PATH (binary);
   if (p != NULL)
-  {
-    GNUNET_asprintf (&pf, "%s/%s", p, binary);
-    GNUNET_free (p);
-    p = pf;
-  }
+    {
+      GNUNET_asprintf (&pf, "%s/%s", p, binary);
+      GNUNET_free (p);
+      p = pf;
+    }
 #endif
   if (p == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Could not find binary `%s' in PATH!\n"), binary);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Could not find binary `%s' in PATH!\n"), binary);
+      return GNUNET_SYSERR;
+    }
   if (0 != STAT (p, &statbuf))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("stat (%s) failed: %s\n"), p,
-                STRERROR (errno));
-    GNUNET_free (p);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING, _("stat (%s) failed: %s\n"), p,
+          STRERROR (errno));
+      GNUNET_free (p);
+      return GNUNET_SYSERR;
+    }
 #ifndef MINGW
   if ((0 != (statbuf.st_mode & S_ISUID)) && (statbuf.st_uid == 0))
-  {
-    GNUNET_free (p);
-    return GNUNET_YES;
-  }
+    {
+      GNUNET_free (p);
+      return GNUNET_YES;
+    }
   if (0 == ACCESS (p, X_OK))
-  {
-    GNUNET_free (p);
-    return GNUNET_NO;
-  }
+    {
+      GNUNET_free (p);
+      return GNUNET_NO;
+    }
   GNUNET_free (p);
   return GNUNET_SYSERR;
 #else
   GNUNET_free (p);
   rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
   if (INVALID_SOCKET == rawsock)
-  {
-    DWORD err = GetLastError ();
+    {
+      DWORD err = GetLastError ();
 
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) failed! GLE = %d\n",
-                err);
-    return GNUNET_NO;           /* not running as administrator */
-  }
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) failed! GLE = %d\n",
+          err);
+      return GNUNET_NO;                /* not running as administrator */
+    }
   closesocket (rawsock);
   return GNUNET_YES;
 #endif

Modified: gnunet/src/util/os_network.c
===================================================================
--- gnunet/src/util/os_network.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/os_network.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -31,6 +31,10 @@
 #include "gnunet_common.h"
 #include "gnunet_os_lib.h"
 
+
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+
 /**
  * @brief Enumerate all network interfaces
  *
@@ -39,7 +43,7 @@
  */
 void
 GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
-                                   void *proc_cls)
+                                  void *proc_cls)
 {
 #ifdef MINGW
   PMIB_IFTABLE pTable;
@@ -48,118 +52,121 @@
   IPAddr theIP;
 
   /* Determine our external NIC  */
-  theIP = inet_addr ("192.0.34.166");   /* www.example.com */
+  theIP = inet_addr ("192.0.34.166");  /* www.example.com */
   if ((!GNGetBestInterface) ||
       (GNGetBestInterface (theIP, &dwExternalNIC) != NO_ERROR))
-  {
-    dwExternalNIC = 0;
-  }
+    {
+      dwExternalNIC = 0;
+    }
 
   /* Enumerate NICs */
   EnumNICs (&pTable, &pAddrTable);
 
   if (pTable)
-  {
-    for (dwIfIdx = 0; dwIfIdx <= pTable->dwNumEntries; dwIfIdx++)
     {
-      char szEntry[1001];
-      DWORD dwIP = 0;
-      PIP_ADAPTER_INFO pAdapterInfo;
-      PIP_ADAPTER_INFO pAdapter = NULL;
-      DWORD dwRetVal = 0;
+      for (dwIfIdx = 0; dwIfIdx <= pTable->dwNumEntries; dwIfIdx++)
+       {
+         char szEntry[1001];
+         DWORD dwIP = 0;
+         PIP_ADAPTER_INFO pAdapterInfo;
+         PIP_ADAPTER_INFO pAdapter = NULL;
+         DWORD dwRetVal = 0;
 
-      /* Get IP-Address */
-      int i;
+         /* Get IP-Address */
+         int i;
 
-      for (i = 0; i < pAddrTable->dwNumEntries; i++)
-      {
-        if (pAddrTable->table[i].dwIndex == pTable->table[dwIfIdx].dwIndex)
-        {
-          dwIP = pAddrTable->table[i].dwAddr;
-          break;
-        }
-      }
+         for (i = 0; i < pAddrTable->dwNumEntries; i++)
+           {
+             if (pAddrTable->table[i].dwIndex ==
+                 pTable->table[dwIfIdx].dwIndex)
+               {
+                 dwIP = pAddrTable->table[i].dwAddr;
+                 break;
+               }
+           }
 
-      if (dwIP)
-      {
-        BYTE bPhysAddr[MAXLEN_PHYSADDR];
-        char *pszIfName = NULL;
-        char dst[INET_ADDRSTRLEN];
-        struct sockaddr_in sa;
+         if (dwIP)
+           {
+             BYTE bPhysAddr[MAXLEN_PHYSADDR];
+             char *pszIfName = NULL;
+             char dst[INET_ADDRSTRLEN];
+             struct sockaddr_in sa;
 
-        /* Get friendly interface name */
-        pAdapterInfo = (IP_ADAPTER_INFO *) malloc (sizeof (IP_ADAPTER_INFO));
-        ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO);
+             /* Get friendly interface name */
+             pAdapterInfo =
+               (IP_ADAPTER_INFO *) malloc (sizeof (IP_ADAPTER_INFO));
+             ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO);
 
-        /* Make an initial call to GetAdaptersInfo to get
-         * the necessary size into the ulOutBufLen variable */
-        if (GGetAdaptersInfo (pAdapterInfo, &ulOutBufLen) ==
-            ERROR_BUFFER_OVERFLOW)
-        {
-          free (pAdapterInfo);
-          pAdapterInfo = (IP_ADAPTER_INFO *) malloc (ulOutBufLen);
-        }
+             /* Make an initial call to GetAdaptersInfo to get
+              * the necessary size into the ulOutBufLen variable */
+             if (GGetAdaptersInfo (pAdapterInfo, &ulOutBufLen) ==
+                 ERROR_BUFFER_OVERFLOW)
+               {
+                 free (pAdapterInfo);
+                 pAdapterInfo = (IP_ADAPTER_INFO *) malloc (ulOutBufLen);
+               }
 
-        if ((dwRetVal =
-             GGetAdaptersInfo (pAdapterInfo, &ulOutBufLen)) == NO_ERROR)
-        {
-          pAdapter = pAdapterInfo;
-          while (pAdapter)
-          {
-            if (pTable->table[dwIfIdx].dwIndex == pAdapter->Index)
-            {
-              char szKey[251];
-              long lLen = 250;
+             if ((dwRetVal =
+                  GGetAdaptersInfo (pAdapterInfo, &ulOutBufLen)) == NO_ERROR)
+               {
+                 pAdapter = pAdapterInfo;
+                 while (pAdapter)
+                   {
+                     if (pTable->table[dwIfIdx].dwIndex == pAdapter->Index)
+                       {
+                         char szKey[251];
+                         long lLen = 250;
 
-              sprintf (szKey,
-                       "SYSTEM\\CurrentControlSet\\Control\\Network\\"
-                       
"{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection",
-                       pAdapter->AdapterName);
-              pszIfName = (char *) malloc (251);
-              if (QueryRegistry
-                  (HKEY_LOCAL_MACHINE, szKey, "Name", pszIfName,
-                   &lLen) != ERROR_SUCCESS)
-              {
-                free (pszIfName);
-                pszIfName = NULL;
-              }
-            }
-            pAdapter = pAdapter->Next;
-          }
-        }
-        free (pAdapterInfo);
+                         sprintf (szKey,
+                                  
"SYSTEM\\CurrentControlSet\\Control\\Network\\"
+                                  
"{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection",
+                                  pAdapter->AdapterName);
+                         pszIfName = (char *) malloc (251);
+                         if (QueryRegistry
+                             (HKEY_LOCAL_MACHINE, szKey, "Name", pszIfName,
+                              &lLen) != ERROR_SUCCESS)
+                           {
+                             free (pszIfName);
+                             pszIfName = NULL;
+                           }
+                       }
+                     pAdapter = pAdapter->Next;
+                   }
+               }
+             free (pAdapterInfo);
 
-        /* Set entry */
-        memset (bPhysAddr, 0, MAXLEN_PHYSADDR);
-        memcpy (bPhysAddr, pTable->table[dwIfIdx].bPhysAddr,
-                pTable->table[dwIfIdx].dwPhysAddrLen);
+             /* Set entry */
+             memset (bPhysAddr, 0, MAXLEN_PHYSADDR);
+             memcpy (bPhysAddr, pTable->table[dwIfIdx].bPhysAddr,
+                     pTable->table[dwIfIdx].dwPhysAddrLen);
 
-        snprintf (szEntry, 1000, "%s (%s - %I64u)",
-                  pszIfName ? pszIfName : (char *) pTable->
-                  table[dwIfIdx].bDescr, inet_ntop (AF_INET, &dwIP, dst,
-                                                    INET_ADDRSTRLEN),
-                  *((unsigned long long *) bPhysAddr));
-        szEntry[1000] = 0;
+             snprintf (szEntry, 1000, "%s (%s - %I64u)",
+                       pszIfName ? pszIfName : (char *)
+                       pTable->table[dwIfIdx].bDescr, inet_ntop (AF_INET,
+                                                                 &dwIP, dst,
+                                                                 
INET_ADDRSTRLEN),
+                       *((unsigned long long *) bPhysAddr));
+             szEntry[1000] = 0;
 
-        if (pszIfName)
-          free (pszIfName);
+             if (pszIfName)
+               free (pszIfName);
 
-        sa.sin_family = AF_INET;
+             sa.sin_family = AF_INET;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-        sa.sin_len = (u_char) sizeof (struct sockaddr_in);
+             sa.sin_len = (u_char) sizeof (struct sockaddr_in);
 #endif
-        sa.sin_addr.S_un.S_addr = dwIP;
+             sa.sin_addr.S_un.S_addr = dwIP;
 
-        if (GNUNET_OK !=
-            proc (proc_cls, szEntry,
-                  pTable->table[dwIfIdx].dwIndex == dwExternalNIC,
-                  (const struct sockaddr *) &sa, sizeof (sa)))
-          break;
-      }
+             if (GNUNET_OK !=
+                 proc (proc_cls, szEntry,
+                       pTable->table[dwIfIdx].dwIndex == dwExternalNIC,
+                       (const struct sockaddr *) &sa, sizeof (sa)))
+               break;
+           }
+       }
+      GlobalFree (pAddrTable);
+      GlobalFree (pTable);
     }
-    GlobalFree (pAddrTable);
-    GlobalFree (pTable);
-  }
 
   return;
 
@@ -170,28 +177,29 @@
   socklen_t alen;
 
   if (getifaddrs (&ifa_first) == 0)
-  {
-    for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
     {
-      if (ifa_ptr->ifa_name != NULL && ifa_ptr->ifa_addr != NULL &&
-          (ifa_ptr->ifa_flags & IFF_UP) != 0)
-      {
-        if ((ifa_ptr->ifa_addr->sa_family != AF_INET) &&
-            (ifa_ptr->ifa_addr->sa_family != AF_INET6))
-          continue;
-        if (ifa_ptr->ifa_addr->sa_family == AF_INET)
-          alen = sizeof (struct sockaddr_in);
-        else
-          alen = sizeof (struct sockaddr_in6);
-        if (GNUNET_OK !=
-            proc (proc_cls, ifa_ptr->ifa_name,
-                  0 == strcmp (ifa_ptr->ifa_name, GNUNET_DEFAULT_INTERFACE),
-                  ifa_ptr->ifa_addr, alen))
-          break;
-      }
+      for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
+       {
+         if (ifa_ptr->ifa_name != NULL && ifa_ptr->ifa_addr != NULL &&
+             (ifa_ptr->ifa_flags & IFF_UP) != 0)
+           {
+             if ((ifa_ptr->ifa_addr->sa_family != AF_INET) &&
+                 (ifa_ptr->ifa_addr->sa_family != AF_INET6))
+               continue;
+             if (ifa_ptr->ifa_addr->sa_family == AF_INET)
+               alen = sizeof (struct sockaddr_in);
+             else
+               alen = sizeof (struct sockaddr_in6);
+             if (GNUNET_OK !=
+                 proc (proc_cls, ifa_ptr->ifa_name,
+                       0 == strcmp (ifa_ptr->ifa_name,
+                                    GNUNET_DEFAULT_INTERFACE),
+                       ifa_ptr->ifa_addr, alen))
+               break;
+           }
+       }
+      freeifaddrs (ifa_first);
     }
-    freeifaddrs (ifa_first);
-  }
 #else
   char line[1024];
   const char *start;
@@ -212,73 +220,76 @@
   else
     f = popen ("ifconfig -a 2> /dev/null", "r");
   if (!f)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING |
-                              GNUNET_ERROR_TYPE_BULK, "popen", "ifconfig");
-    return;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING |
+                        GNUNET_ERROR_TYPE_BULK, "popen", "ifconfig");
+      return;
+    }
 
   have_ifc = GNUNET_NO;
   ifc[11] = '\0';
   while (NULL != fgets (line, sizeof (line), f))
-  {
-    if (strlen (line) == 0)
     {
-      have_ifc = GNUNET_NO;
-      continue;
-    }
-    if (!isspace (line[0]))
-    {
-      have_ifc = (1 == SSCANF (line, "%11s", ifc)) ? GNUNET_YES : GNUNET_NO;
-      /* would end with ':' on OSX, fix it! */
-      if (ifc[strlen (ifc) - 1] == ':')
-        ifc[strlen (ifc) - 1] = '\0';
-      continue;
-    }
-    if (!have_ifc)
-      continue;                 /* strange input, hope for the best */
-    start = line;
-    while (('\0' != *start) && (isspace (*start)))
-      start++;
-    if (                        /* Linux */
-         (1 == SSCANF (start, "inet addr:%127s", addrstr)) ||
-         (1 == SSCANF (start, "inet6 addr:%127s", addrstr)) ||
-         /* Solaris, OS X */
-         (1 == SSCANF (start, "inet %127s", addrstr)) ||
-         (1 == SSCANF (start, "inet6 %127s", addrstr)))
-    {
-      /* IPv4 */
-      if (1 == inet_pton (AF_INET, addrstr, &v4))
-      {
-        memset (&a4, 0, sizeof (a4));
-        a4.sin_family = AF_INET;
+      if (strlen (line) == 0)
+       {
+         have_ifc = GNUNET_NO;
+         continue;
+       }
+      if (!isspace (line[0]))
+       {
+         have_ifc =
+           (1 == SSCANF (line, "%11s", ifc)) ? GNUNET_YES : GNUNET_NO;
+         /* would end with ':' on OSX, fix it! */
+         if (ifc[strlen (ifc) - 1] == ':')
+           ifc[strlen (ifc) - 1] = '\0';
+         continue;
+       }
+      if (!have_ifc)
+       continue;               /* strange input, hope for the best */
+      start = line;
+      while (('\0' != *start) && (isspace (*start)))
+       start++;
+      if (                     /* Linux */
+          (1 == SSCANF (start, "inet addr:%127s", addrstr)) ||
+          (1 == SSCANF (start, "inet6 addr:%127s", addrstr)) ||
+          /* Solaris, OS X */
+          (1 == SSCANF (start, "inet %127s", addrstr)) ||
+          (1 == SSCANF (start, "inet6 %127s", addrstr)))
+       {
+         /* IPv4 */
+         if (1 == inet_pton (AF_INET, addrstr, &v4))
+           {
+             memset (&a4, 0, sizeof (a4));
+             a4.sin_family = AF_INET;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-        a4.sin_len = (u_char) sizeof (struct sockaddr_in);
+             a4.sin_len = (u_char) sizeof (struct sockaddr_in);
 #endif
-        a4.sin_addr = v4;
-        if (GNUNET_OK !=
-            proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
-                  (const struct sockaddr *) &a4, sizeof (a4)))
-          break;
-        continue;
-      }
-      /* IPv6 */
-      if (1 == inet_pton (AF_INET6, addrstr, &v6))
-      {
-        memset (&a6, 0, sizeof (a6));
-        a6.sin6_family = AF_INET6;
+             a4.sin_addr = v4;
+             if (GNUNET_OK !=
+                 proc (proc_cls, ifc,
+                       0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
+                       (const struct sockaddr *) &a4, sizeof (a4)))
+               break;
+             continue;
+           }
+         /* IPv6 */
+         if (1 == inet_pton (AF_INET6, addrstr, &v6))
+           {
+             memset (&a6, 0, sizeof (a6));
+             a6.sin6_family = AF_INET6;
 #if HAVE_SOCKADDR_IN_SIN_LEN
-        a6.sin6_len = (u_char) sizeof (struct sockaddr_in6);
+             a6.sin6_len = (u_char) sizeof (struct sockaddr_in6);
 #endif
-        a6.sin6_addr = v6;
-        if (GNUNET_OK !=
-            proc (proc_cls, ifc, 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
-                  (const struct sockaddr *) &a6, sizeof (a6)))
-          break;
-        continue;
-      }
+             a6.sin6_addr = v6;
+             if (GNUNET_OK !=
+                 proc (proc_cls, ifc,
+                       0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
+                       (const struct sockaddr *) &a6, sizeof (a6)))
+               break;
+             continue;
+           }
+       }
     }
-  }
   pclose (f);
 #endif
 }

Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/os_priority.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -30,6 +30,12 @@
 #include "gnunet_scheduler_lib.h"
 #include "disk.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 #define GNUNET_OS_CONTROL_PIPE "GNUNET_OS_CONTROL_PIPE"
 
 struct GNUNET_OS_Process
@@ -53,42 +59,43 @@
  */
 static void
 parent_control_handler (void *cls,
-                        const struct GNUNET_SCHEDULER_TaskContext *tc)
+                       const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_DISK_FileHandle *control_pipe =
-      (struct GNUNET_DISK_FileHandle *) cls;
+    (struct GNUNET_DISK_FileHandle *) cls;
   int sig;
 
 #if DEBUG_OS
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n",
-              __FUNCTION__, tc->reason);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n",
+       __FUNCTION__, tc->reason);
 #endif
   if (tc->reason &
       (GNUNET_SCHEDULER_REASON_SHUTDOWN | GNUNET_SCHEDULER_REASON_TIMEOUT |
        GNUNET_SCHEDULER_REASON_PREREQ_DONE))
-  {
-    GNUNET_DISK_npipe_close (control_pipe);
-  }
-  else
-  {
-    if (GNUNET_DISK_file_read (control_pipe, &sig, sizeof (sig)) !=
-        sizeof (sig))
     {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "GNUNET_DISK_file_read");
       GNUNET_DISK_npipe_close (control_pipe);
     }
-    else
+  else
     {
+      if (GNUNET_DISK_file_read (control_pipe, &sig, sizeof (sig)) !=
+         sizeof (sig))
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "GNUNET_DISK_file_read");
+         GNUNET_DISK_npipe_close (control_pipe);
+       }
+      else
+       {
 #if DEBUG_OS
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got control code %d from parent\n",
-                  sig);
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "Got control code %d from parent\n",
+              sig);
 #endif
-      GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
-                                      control_pipe, &parent_control_handler,
-                                      control_pipe);
-      raise (sig);
+         GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+                                         control_pipe,
+                                         &parent_control_handler,
+                                         control_pipe);
+         raise (sig);
+       }
     }
-  }
 }
 
 
@@ -97,36 +104,35 @@
  */
 void
 GNUNET_OS_install_parent_control_handler (void *cls,
-                                          const struct
-                                          GNUNET_SCHEDULER_TaskContext *tc)
+                                         const struct
+                                         GNUNET_SCHEDULER_TaskContext *tc)
 {
   const char *env_buf;
   struct GNUNET_DISK_FileHandle *control_pipe;
 
   env_buf = getenv (GNUNET_OS_CONTROL_PIPE);
   if ((env_buf == NULL) || (strlen (env_buf) <= 0))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Not installing a handler because $%s=%s\n"),
-                GNUNET_OS_CONTROL_PIPE, env_buf);
-    return;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          _("Not installing a handler because $%s=%s\n"),
+          GNUNET_OS_CONTROL_PIPE, env_buf);
+      return;
+    }
   control_pipe =
-      GNUNET_DISK_npipe_open (env_buf, GNUNET_DISK_OPEN_READ,
-                              GNUNET_DISK_PERM_USER_READ |
-                              GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_npipe_open (env_buf, GNUNET_DISK_OPEN_READ,
+                           GNUNET_DISK_PERM_USER_READ |
+                           GNUNET_DISK_PERM_USER_WRITE);
   if (control_pipe == NULL)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "open", env_buf);
-    return;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "open", env_buf);
+      return;
+    }
 #if DEBUG_OS
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Adding parent control handler pipe `%s' to the scheduler\n",
-              env_buf);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding parent control handler pipe `%s' to the scheduler\n", env_buf);
 #endif
   GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, control_pipe,
-                                  &parent_control_handler, control_pipe);
+                                 &parent_control_handler, control_pipe);
 }
 
 
@@ -160,90 +166,90 @@
 
   ret = GNUNET_DISK_file_write (proc->control_pipe, &sig, sizeof (sig));
   if (ret != sizeof (sig))
-  {
-    if (errno == ECOMM)
     {
-      /* Child process is not controllable via pipe */
+      if (errno == ECOMM)
+       {
+         /* Child process is not controllable via pipe */
 #if DEBUG_OS
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Child process is not controllable, will kill it 
directly\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Child process is not controllable, will kill it directly\n");
 #endif
-    }
-    else if (errno == EPIPE)
-    {
+       }
+      else if (errno == EPIPE)
+       {
 #if DEBUG_OS
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Failed to write into control pipe, because pipe is invalid 
(the child is most likely dead)\n");
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Failed to write into control pipe, because pipe is invalid (the 
child is most likely dead)\n");
 #endif
-    }
-    else
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Failed to write into control pipe , errno is %d\n", errno);
+       }
+      else
+       LOG (GNUNET_ERROR_TYPE_WARNING,
+            "Failed to write into control pipe , errno is %d\n", errno);
 #if WINDOWS && !defined(__CYGWIN__)
-    TerminateProcess (proc->handle, 0);
+      TerminateProcess (proc->handle, 0);
 #else
-    PLIBC_KILL (proc->pid, sig);
+      PLIBC_KILL (proc->pid, sig);
 #endif
-  }
+    }
   else
-  {
+    {
 #if DEBUG_OS
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Wrote control code into control pipe, now waiting\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Wrote control code into control pipe, now waiting\n");
 #endif
 
 #if WINDOWS
-    /* Give it 3 seconds to die, then kill it in a nice Windows-specific way */
-    if (WaitForSingleObject (proc->handle, 3000) != WAIT_OBJECT_0)
-      TerminateProcess (proc->handle, 0);
-    res = 0;
+      /* Give it 3 seconds to die, then kill it in a nice Windows-specific way 
*/
+      if (WaitForSingleObject (proc->handle, 3000) != WAIT_OBJECT_0)
+       TerminateProcess (proc->handle, 0);
+      res = 0;
 #else
-    struct GNUNET_NETWORK_FDSet *rfds;
-    struct GNUNET_NETWORK_FDSet *efds;
+      struct GNUNET_NETWORK_FDSet *rfds;
+      struct GNUNET_NETWORK_FDSet *efds;
 
-    rfds = GNUNET_NETWORK_fdset_create ();
-    efds = GNUNET_NETWORK_fdset_create ();
+      rfds = GNUNET_NETWORK_fdset_create ();
+      efds = GNUNET_NETWORK_fdset_create ();
 
-    GNUNET_NETWORK_fdset_handle_set (rfds, proc->control_pipe);
-    GNUNET_NETWORK_fdset_handle_set (efds, proc->control_pipe);
+      GNUNET_NETWORK_fdset_handle_set (rfds, proc->control_pipe);
+      GNUNET_NETWORK_fdset_handle_set (efds, proc->control_pipe);
 
-    /* Ndurner thought this up, and i have no idea what it does.
-     * There's have never been any code to answer the shutdown call
-     * (write a single int into the pipe, so that this function can read it).
-     * On *nix select() will probably tell that pipe is ready
-     * for reading, once the other process shuts down,
-     * but the read () call will fail, triggering a kill ()
-     * on the pid that is already dead. This will probably result in non-0
-     * return from kill(), and therefore from this function.
-     */
-    while (1)
-    {
-      ret =
-          GNUNET_NETWORK_socket_select (rfds, NULL, efds,
-                                        GNUNET_TIME_relative_multiply
-                                        (GNUNET_TIME_relative_get_unit (),
-                                         5000));
+      /* Ndurner thought this up, and i have no idea what it does.
+       * There's have never been any code to answer the shutdown call
+       * (write a single int into the pipe, so that this function can read it).
+       * On *nix select() will probably tell that pipe is ready
+       * for reading, once the other process shuts down,
+       * but the read () call will fail, triggering a kill ()
+       * on the pid that is already dead. This will probably result in non-0
+       * return from kill(), and therefore from this function.
+       */
+      while (1)
+       {
+         ret =
+           GNUNET_NETWORK_socket_select (rfds, NULL, efds,
+                                         GNUNET_TIME_relative_multiply
+                                         (GNUNET_TIME_relative_get_unit (),
+                                          5000));
 
-      if (ret < 1 ||
-          GNUNET_NETWORK_fdset_handle_isset (efds, proc->control_pipe))
-      {
-        /* Just to be sure */
-        PLIBC_KILL (proc->pid, sig);
-        res = 0;
-        break;
-      }
-      else
-      {
-        if (GNUNET_DISK_file_read (proc->control_pipe, &ret, sizeof (ret)) !=
-            GNUNET_OK)
-          res = PLIBC_KILL (proc->pid, sig);
+         if (ret < 1 ||
+             GNUNET_NETWORK_fdset_handle_isset (efds, proc->control_pipe))
+           {
+             /* Just to be sure */
+             PLIBC_KILL (proc->pid, sig);
+             res = 0;
+             break;
+           }
+         else
+           {
+             if (GNUNET_DISK_file_read
+                 (proc->control_pipe, &ret, sizeof (ret)) != GNUNET_OK)
+               res = PLIBC_KILL (proc->pid, sig);
 
-        /* Child signaled shutdown is in progress */
-        continue;
-      }
+             /* Child signaled shutdown is in progress */
+             continue;
+           }
+       }
+#endif
     }
-#endif
-  }
 
   return res;
 #else
@@ -318,7 +324,7 @@
  */
 int
 GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
-                                enum GNUNET_SCHEDULER_Priority prio)
+                               enum GNUNET_SCHEDULER_Priority prio)
 {
   int rprio;
 
@@ -328,51 +334,51 @@
 
   /* convert to MINGW/Unix values */
   switch (prio)
-  {
-  case GNUNET_SCHEDULER_PRIORITY_UI:
-  case GNUNET_SCHEDULER_PRIORITY_URGENT:
+    {
+    case GNUNET_SCHEDULER_PRIORITY_UI:
+    case GNUNET_SCHEDULER_PRIORITY_URGENT:
 #ifdef MINGW
-    rprio = HIGH_PRIORITY_CLASS;
+      rprio = HIGH_PRIORITY_CLASS;
 #else
-    rprio = 0;
+      rprio = 0;
 #endif
-    break;
+      break;
 
-  case GNUNET_SCHEDULER_PRIORITY_HIGH:
+    case GNUNET_SCHEDULER_PRIORITY_HIGH:
 #ifdef MINGW
-    rprio = ABOVE_NORMAL_PRIORITY_CLASS;
+      rprio = ABOVE_NORMAL_PRIORITY_CLASS;
 #else
-    rprio = 5;
+      rprio = 5;
 #endif
-    break;
+      break;
 
-  case GNUNET_SCHEDULER_PRIORITY_DEFAULT:
+    case GNUNET_SCHEDULER_PRIORITY_DEFAULT:
 #ifdef MINGW
-    rprio = NORMAL_PRIORITY_CLASS;
+      rprio = NORMAL_PRIORITY_CLASS;
 #else
-    rprio = 7;
+      rprio = 7;
 #endif
-    break;
+      break;
 
-  case GNUNET_SCHEDULER_PRIORITY_BACKGROUND:
+    case GNUNET_SCHEDULER_PRIORITY_BACKGROUND:
 #ifdef MINGW
-    rprio = BELOW_NORMAL_PRIORITY_CLASS;
+      rprio = BELOW_NORMAL_PRIORITY_CLASS;
 #else
-    rprio = 10;
+      rprio = 10;
 #endif
-    break;
+      break;
 
-  case GNUNET_SCHEDULER_PRIORITY_IDLE:
+    case GNUNET_SCHEDULER_PRIORITY_IDLE:
 #ifdef MINGW
-    rprio = IDLE_PRIORITY_CLASS;
+      rprio = IDLE_PRIORITY_CLASS;
 #else
-    rprio = 19;
+      rprio = 19;
 #endif
-    break;
-  default:
-    GNUNET_assert (0);
-    return GNUNET_SYSERR;
-  }
+      break;
+    default:
+      GNUNET_assert (0);
+      return GNUNET_SYSERR;
+    }
 
   /* Set process priority */
 #ifdef MINGW
@@ -387,31 +393,31 @@
 
   pid = proc->pid;
   if ((0 == pid) || (pid == getpid ()))
-  {
-    int have = nice (0);
-    int delta = rprio - have;
+    {
+      int have = nice (0);
+      int delta = rprio - have;
 
-    errno = 0;
-    if ((delta != 0) && (rprio == nice (delta)) && (errno != 0))
-    {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
-                           "nice");
-      return GNUNET_SYSERR;
+      errno = 0;
+      if ((delta != 0) && (rprio == nice (delta)) && (errno != 0))
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
+                       "nice");
+         return GNUNET_SYSERR;
+       }
     }
-  }
   else
-  {
-    if (0 != setpriority (PRIO_PROCESS, pid, rprio))
     {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
-                           "setpriority");
-      return GNUNET_SYSERR;
+      if (0 != setpriority (PRIO_PROCESS, pid, rprio))
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
+                       "setpriority");
+         return GNUNET_SYSERR;
+       }
     }
-  }
 #else
 #if DEBUG_OS
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
-              "Priority management not availabe for this platform\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
+       "Priority management not availabe for this platform\n");
 #endif
 #endif
   return GNUNET_OK;
@@ -434,84 +440,84 @@
   win32_env_table = GetEnvironmentStringsA ();
   if (win32_env_table == NULL)
     return NULL;
-  for (c = 0, var_ptr = vars; *var_ptr; var_ptr += 2, c++) ;
+  for (c = 0, var_ptr = vars; *var_ptr; var_ptr += 2, c++);
   n_var = c;
   index = GNUNET_malloc (sizeof (char *) * n_var);
   for (c = 0; c < n_var; c++)
     index[c] = 0;
   for (items_count = 0, ptr = win32_env_table; ptr[0] != 0; items_count++)
-  {
-    size_t len = strlen (ptr);
-    int found = 0;
+    {
+      size_t len = strlen (ptr);
+      int found = 0;
 
-    for (var_ptr = vars; *var_ptr; var_ptr++)
+      for (var_ptr = vars; *var_ptr; var_ptr++)
+       {
+         var = *var_ptr++;
+         val = *var_ptr;
+         var_len = strlen (var);
+         if (strncmp (var, ptr, var_len) == 0)
+           {
+             found = 1;
+             index[c] = 1;
+             tablesize += var_len + strlen (val) + 1;
+             break;
+           }
+       }
+      if (!found)
+       tablesize += len + 1;
+      ptr += len + 1;
+    }
+  for (n_found = 0, c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
     {
       var = *var_ptr++;
       val = *var_ptr;
-      var_len = strlen (var);
-      if (strncmp (var, ptr, var_len) == 0)
-      {
-        found = 1;
-        index[c] = 1;
-        tablesize += var_len + strlen (val) + 1;
-        break;
-      }
+      if (index[c] != 1)
+       n_found += strlen (var) + strlen (val) + 1;
     }
-    if (!found)
-      tablesize += len + 1;
-    ptr += len + 1;
-  }
-  for (n_found = 0, c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
-  {
-    var = *var_ptr++;
-    val = *var_ptr;
-    if (index[c] != 1)
-      n_found += strlen (var) + strlen (val) + 1;
-  }
   result = GNUNET_malloc (tablesize + n_found + 1);
   for (result_ptr = result, ptr = win32_env_table; ptr[0] != 0;)
-  {
-    size_t len = strlen (ptr);
-    int found = 0;
+    {
+      size_t len = strlen (ptr);
+      int found = 0;
 
-    for (c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
+      for (c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
+       {
+         var = *var_ptr++;
+         val = *var_ptr;
+         var_len = strlen (var);
+         if (strncmp (var, ptr, var_len) == 0)
+           {
+             found = 1;
+             break;
+           }
+       }
+      if (!found)
+       {
+         strcpy (result_ptr, ptr);
+         result_ptr += len + 1;
+       }
+      else
+       {
+         strcpy (result_ptr, var);
+         result_ptr += var_len;
+         strcpy (result_ptr, val);
+         result_ptr += strlen (val) + 1;
+       }
+      ptr += len + 1;
+    }
+  for (c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
     {
       var = *var_ptr++;
       val = *var_ptr;
       var_len = strlen (var);
-      if (strncmp (var, ptr, var_len) == 0)
-      {
-        found = 1;
-        break;
-      }
+      if (index[c] != 1)
+       {
+         strcpy (result_ptr, var);
+         result_ptr += var_len;
+         strcpy (result_ptr, val);
+         result_ptr += strlen (val) + 1;
+       }
     }
-    if (!found)
-    {
-      strcpy (result_ptr, ptr);
-      result_ptr += len + 1;
-    }
-    else
-    {
-      strcpy (result_ptr, var);
-      result_ptr += var_len;
-      strcpy (result_ptr, val);
-      result_ptr += strlen (val) + 1;
-    }
-    ptr += len + 1;
-  }
-  for (c = 0, var_ptr = vars; *var_ptr; var_ptr++, c++)
-  {
-    var = *var_ptr++;
-    val = *var_ptr;
-    var_len = strlen (var);
-    if (index[c] != 1)
-    {
-      strcpy (result_ptr, var);
-      result_ptr += var_len;
-      strcpy (result_ptr, val);
-      result_ptr += strlen (val) + 1;
-    }
-  }
   FreeEnvironmentStrings (win32_env_table);
   GNUNET_free (index);
   *result_ptr = 0;
@@ -531,8 +537,8 @@
  */
 struct GNUNET_OS_Process *
 GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin,
-                            struct GNUNET_DISK_PipeHandle *pipe_stdout,
-                            const char *filename, va_list va)
+                           struct GNUNET_DISK_PipeHandle *pipe_stdout,
+                           const char *filename, va_list va)
 {
   va_list ap;
 
@@ -553,9 +559,9 @@
 
 #if ENABLE_WINDOWS_WORKAROUNDS
   control_pipe =
-      GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
-                                GNUNET_DISK_PERM_USER_READ |
-                                GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   if (control_pipe == NULL)
     return NULL;
 #endif
@@ -563,35 +569,38 @@
   argc = 0;
   va_copy (ap, va);
   while (NULL != va_arg (ap, char *))
-         argc++;
+      argc++;
 
   va_end (ap);
   argv = GNUNET_malloc (sizeof (char *) * (argc + 1));
   argc = 0;
   va_copy (ap, va);
   while (NULL != (argv[argc] = va_arg (ap, char *)))
-         argc++;
+      argc++;
 
   va_end (ap);
   if (pipe_stdout != NULL)
-  {
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdout,
-                                        GNUNET_DISK_PIPE_END_WRITE),
-                                       &fd_stdout_write, sizeof (int));
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdout, 
GNUNET_DISK_PIPE_END_READ),
-                                       &fd_stdout_read, sizeof (int));
-  }
+    {
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdout,
+                                         GNUNET_DISK_PIPE_END_WRITE),
+                                        &fd_stdout_write, sizeof (int));
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdout,
+                                         GNUNET_DISK_PIPE_END_READ),
+                                        &fd_stdout_read, sizeof (int));
+    }
   if (pipe_stdin != NULL)
-  {
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdin, GNUNET_DISK_PIPE_END_READ),
-                                       &fd_stdin_read, sizeof (int));
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdin, 
GNUNET_DISK_PIPE_END_WRITE),
-                                       &fd_stdin_write, sizeof (int));
-  }
+    {
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdin,
+                                         GNUNET_DISK_PIPE_END_READ),
+                                        &fd_stdin_read, sizeof (int));
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdin,
+                                         GNUNET_DISK_PIPE_END_WRITE),
+                                        &fd_stdin_write, sizeof (int));
+    }
 
 #if HAVE_WORKING_VFORK
   ret = vfork ();
@@ -599,44 +608,46 @@
   ret = fork ();
 #endif
   if (ret != 0)
-  {
-    if (ret == -1)
     {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "fork");
+      if (ret == -1)
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fork");
 #if ENABLE_WINDOWS_WORKAROUNDS
-      GNUNET_DISK_npipe_close (control_pipe);
+         GNUNET_DISK_npipe_close (control_pipe);
 #endif
-    }
-    else
-    {
+       }
+      else
+       {
 
 #if HAVE_WORKING_VFORK
-      /* let's hope vfork actually works; for some extreme cases (including
-       * a testcase) we need 'execvp' to have run before we return, since
-       * we may send a signal to the process next and we don't want it
-       * to be caught by OUR signal handler (but either by the default
-       * handler or the actual handler as installed by the process itself). */
+         /* let's hope vfork actually works; for some extreme cases (including
+          * a testcase) we need 'execvp' to have run before we return, since
+          * we may send a signal to the process next and we don't want it
+          * to be caught by OUR signal handler (but either by the default
+          * handler or the actual handler as installed by the process itself). 
*/
 #else
-      /* let's give the child process a chance to run execvp, 1s should
-       * be plenty in practice */
-      if (pipe_stdout != NULL)
-        GNUNET_DISK_pipe_close_end (pipe_stdout, GNUNET_DISK_PIPE_END_WRITE);
-      if (pipe_stdin != NULL)
-        GNUNET_DISK_pipe_close_end (pipe_stdin, GNUNET_DISK_PIPE_END_READ);
-      sleep (1);
+         /* let's give the child process a chance to run execvp, 1s should
+          * be plenty in practice */
+         if (pipe_stdout != NULL)
+           GNUNET_DISK_pipe_close_end (pipe_stdout,
+                                       GNUNET_DISK_PIPE_END_WRITE);
+         if (pipe_stdin != NULL)
+           GNUNET_DISK_pipe_close_end (pipe_stdin,
+                                       GNUNET_DISK_PIPE_END_READ);
+         sleep (1);
 #endif
-      gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
-      gnunet_proc->pid = ret;
+         gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+         gnunet_proc->pid = ret;
 #if ENABLE_WINDOWS_WORKAROUNDS
-      gnunet_proc->control_pipe = control_pipe;
+         gnunet_proc->control_pipe = control_pipe;
 #endif
-    }
-    GNUNET_free (argv);
+       }
+      GNUNET_free (argv);
 #if ENABLE_WINDOWS_WORKAROUNDS
-    GNUNET_free (childpipename);
+      GNUNET_free (childpipename);
 #endif
-    return gnunet_proc;
-  }
+      return gnunet_proc;
+    }
 
 #if ENABLE_WINDOWS_WORKAROUNDS
   setenv (GNUNET_OS_CONTROL_PIPE, childpipename, 1);
@@ -644,23 +655,23 @@
 #endif
 
   if (pipe_stdout != NULL)
-  {
-    GNUNET_break (0 == close (fd_stdout_read));
-    if (-1 == dup2 (fd_stdout_write, 1))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
-    GNUNET_break (0 == close (fd_stdout_write));
-  }
+    {
+      GNUNET_break (0 == close (fd_stdout_read));
+      if (-1 == dup2 (fd_stdout_write, 1))
+       LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "dup2");
+      GNUNET_break (0 == close (fd_stdout_write));
+    }
 
   if (pipe_stdin != NULL)
-  {
+    {
 
-    GNUNET_break (0 == close (fd_stdin_write));
-    if (-1 == dup2 (fd_stdin_read, 0))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
-    GNUNET_break (0 == close (fd_stdin_read));
-  }
+      GNUNET_break (0 == close (fd_stdin_write));
+      if (-1 == dup2 (fd_stdin_read, 0))
+       LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "dup2");
+      GNUNET_break (0 == close (fd_stdin_read));
+    }
   execvp (filename, argv);
-  GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "execvp", filename);
+  LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "execvp", filename);
   _exit (1);
 #else
   char *arg;
@@ -694,8 +705,8 @@
   pathbuf_len = GetEnvironmentVariableA ("PATH", (char *) &pathbuf, 0);
 
   alloc_len =
-      pathbuf_len + 1 + strlen (self_prefix) + 1 + strlen (bindir) + 1 +
-      strlen (libdir);
+    pathbuf_len + 1 + strlen (self_prefix) + 1 + strlen (bindir) + 1 +
+    strlen (libdir);
 
   pathbuf = GNUNET_malloc (alloc_len * sizeof (char));
 
@@ -718,39 +729,39 @@
   if (non_const_filename[1] == ':')
     snprintf (path, sizeof (path) / sizeof (char), "%s", non_const_filename);
   else if (!SearchPathA
-           (pathbuf, non_const_filename, NULL, sizeof (path) / sizeof (char),
-            path, NULL))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "SearchPath",
-                              non_const_filename);
-    GNUNET_free (non_const_filename);
-    GNUNET_free (pathbuf);
-    return NULL;
-  }
+          (pathbuf, non_const_filename, NULL, sizeof (path) / sizeof (char),
+           path, NULL))
+    {
+      SetErrnoFromWinError (GetLastError ());
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "SearchPath",
+                        non_const_filename);
+      GNUNET_free (non_const_filename);
+      GNUNET_free (pathbuf);
+      return NULL;
+    }
   GNUNET_free (pathbuf);
   GNUNET_free (non_const_filename);
 
   cmdlen = 0;
   va_copy (ap, va);
   while (NULL != (arg = va_arg (ap, char *)))
-  {
-    if (cmdlen == 0)
-      cmdlen = cmdlen + strlen (path) + 3;
-    else
-      cmdlen = cmdlen + strlen (arg) + 3;
-  }
+    {
+      if (cmdlen == 0)
+       cmdlen = cmdlen + strlen (path) + 3;
+      else
+       cmdlen = cmdlen + strlen (arg) + 3;
+    }
   va_end (ap);
 
   cmd = idx = GNUNET_malloc (sizeof (char) * (cmdlen + 1));
   va_copy (ap, va);
   while (NULL != (arg = va_arg (ap, char *)))
-  {
-    if (idx == cmd)
-      idx += sprintf (idx, "\"%s\" ", path);
-    else
-      idx += sprintf (idx, "\"%s\" ", arg);
-  }
+    {
+      if (idx == cmd)
+       idx += sprintf (idx, "\"%s\" ", path);
+      else
+       idx += sprintf (idx, "\"%s\" ", arg);
+    }
   va_end (ap);
 
   memset (&start, 0, sizeof (start));
@@ -760,36 +771,37 @@
     start.dwFlags |= STARTF_USESTDHANDLES;
 
   if (pipe_stdin != NULL)
-  {
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdin, GNUNET_DISK_PIPE_END_READ),
-                                       &stdin_handle, sizeof (HANDLE));
-    start.hStdInput = stdin_handle;
-  }
+    {
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdin,
+                                         GNUNET_DISK_PIPE_END_READ),
+                                        &stdin_handle, sizeof (HANDLE));
+      start.hStdInput = stdin_handle;
+    }
 
   if (pipe_stdout != NULL)
-  {
-    GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
-                                       (pipe_stdout,
-                                        GNUNET_DISK_PIPE_END_WRITE),
-                                       &stdout_handle, sizeof (HANDLE));
-    start.hStdOutput = stdout_handle;
-  }
+    {
+      GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle
+                                        (pipe_stdout,
+                                         GNUNET_DISK_PIPE_END_WRITE),
+                                        &stdout_handle, sizeof (HANDLE));
+      start.hStdOutput = stdout_handle;
+    }
 
   control_pipe =
-      GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
-                                GNUNET_DISK_PERM_USER_READ |
-                                GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   if (control_pipe == NULL)
-  {
-    GNUNET_free (cmd);
-    GNUNET_free (path);
-    return NULL;
-  }
+    {
+      GNUNET_free (cmd);
+      GNUNET_free (path);
+      return NULL;
+    }
 
 #if DEBUG_OS
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Opened the parent end of the pipe `%s'\n", childpipename);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Opened the parent end of the pipe `%s'\n", childpipename);
 #endif
 
   GNUNET_asprintf (&our_env[0], "%s=", GNUNET_OS_CONTROL_PIPE);
@@ -802,13 +814,13 @@
   if (!CreateProcessA
       (path, cmd, NULL, NULL, TRUE, DETACHED_PROCESS | CREATE_SUSPENDED,
        env_block, NULL, &start, &proc))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "CreateProcess", path);
-    GNUNET_free (env_block);
-    GNUNET_free (cmd);
-    return NULL;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "CreateProcess", path);
+      GNUNET_free (env_block);
+      GNUNET_free (cmd);
+      return NULL;
+    }
 
   GNUNET_free (env_block);
 
@@ -842,8 +854,8 @@
  */
 struct GNUNET_OS_Process *
 GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin,
-                         struct GNUNET_DISK_PipeHandle *pipe_stdout,
-                         const char *filename, ...)
+                        struct GNUNET_DISK_PipeHandle *pipe_stdout,
+                        const char *filename, ...)
 {
   struct GNUNET_OS_Process *ret;
   va_list ap;
@@ -866,7 +878,7 @@
  */
 struct GNUNET_OS_Process *
 GNUNET_OS_start_process_v (const int *lsocks, const char *filename,
-                           char *const argv[])
+                          char *const argv[])
 {
 #if ENABLE_WINDOWS_WORKAROUNDS
   struct GNUNET_DISK_FileHandle *control_pipe = NULL;
@@ -888,9 +900,9 @@
 
 #if ENABLE_WINDOWS_WORKAROUNDS
   control_pipe =
-      GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
-                                GNUNET_DISK_PERM_USER_READ |
-                                GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   if (control_pipe == NULL)
     return NULL;
 #endif
@@ -898,52 +910,52 @@
   lscp = NULL;
   ls = 0;
   if (lsocks != NULL)
-  {
-    i = 0;
-    while (-1 != (k = lsocks[i++]))
-      GNUNET_array_append (lscp, ls, k);
-    GNUNET_array_append (lscp, ls, -1);
-  }
+    {
+      i = 0;
+      while (-1 != (k = lsocks[i++]))
+       GNUNET_array_append (lscp, ls, k);
+      GNUNET_array_append (lscp, ls, -1);
+    }
 #if HAVE_WORKING_VFORK
   ret = vfork ();
 #else
   ret = fork ();
 #endif
   if (ret != 0)
-  {
-    if (ret == -1)
     {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "fork");
+      if (ret == -1)
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fork");
 #if ENABLE_WINDOWS_WORKAROUNDS
-      GNUNET_DISK_npipe_close (control_pipe);
+         GNUNET_DISK_npipe_close (control_pipe);
 #endif
-    }
-    else
-    {
+       }
+      else
+       {
 #if HAVE_WORKING_VFORK
-      /* let's hope vfork actually works; for some extreme cases (including
-       * a testcase) we need 'execvp' to have run before we return, since
-       * we may send a signal to the process next and we don't want it
-       * to be caught by OUR signal handler (but either by the default
-       * handler or the actual handler as installed by the process itself). */
+         /* let's hope vfork actually works; for some extreme cases (including
+          * a testcase) we need 'execvp' to have run before we return, since
+          * we may send a signal to the process next and we don't want it
+          * to be caught by OUR signal handler (but either by the default
+          * handler or the actual handler as installed by the process itself). 
*/
 #else
-      /* let's give the child process a chance to run execvp, 1s should
-       * be plenty in practice */
-      sleep (1);
+         /* let's give the child process a chance to run execvp, 1s should
+          * be plenty in practice */
+         sleep (1);
 #endif
-      gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
-      gnunet_proc->pid = ret;
+         gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+         gnunet_proc->pid = ret;
 #if ENABLE_WINDOWS_WORKAROUNDS
-      gnunet_proc->control_pipe = control_pipe;
+         gnunet_proc->control_pipe = control_pipe;
 
 #endif
-    }
-    GNUNET_array_grow (lscp, ls, 0);
+       }
+      GNUNET_array_grow (lscp, ls, 0);
 #if ENABLE_WINDOWS_WORKAROUNDS
-    GNUNET_free (childpipename);
+      GNUNET_free (childpipename);
 #endif
-    return gnunet_proc;
-  }
+      return gnunet_proc;
+    }
 
 #if ENABLE_WINDOWS_WORKAROUNDS
   setenv (GNUNET_OS_CONTROL_PIPE, childpipename, 1);
@@ -951,50 +963,50 @@
 #endif
 
   if (lscp != NULL)
-  {
-    /* read systemd documentation... */
-    GNUNET_snprintf (lpid, sizeof (lpid), "%u", getpid ());
-    setenv ("LISTEN_PID", lpid, 1);
-    i = 0;
-    tgt = 3;
-    while (-1 != lscp[i])
     {
-      j = i + 1;
-      while (-1 != lscp[j])
-      {
-        if (lscp[j] == tgt)
-        {
-          /* dup away */
-          k = dup (lscp[j]);
-          GNUNET_assert (-1 != k);
-          GNUNET_assert (0 == close (lscp[j]));
-          lscp[j] = k;
-          break;
-        }
-        j++;
-      }
-      if (lscp[i] != tgt)
-      {
-        /* Bury any existing FD, no matter what; they should all be closed
-         * on exec anyway and the important onces have been dup'ed away */
-        (void) close (tgt);
-        GNUNET_assert (-1 != dup2 (lscp[i], tgt));
-      }
-      /* unset close-on-exec flag */
-      flags = fcntl (tgt, F_GETFD);
-      GNUNET_assert (flags >= 0);
-      flags &= ~FD_CLOEXEC;
-      fflush (stderr);
-      (void) fcntl (tgt, F_SETFD, flags);
-      tgt++;
-      i++;
+      /* read systemd documentation... */
+      GNUNET_snprintf (lpid, sizeof (lpid), "%u", getpid ());
+      setenv ("LISTEN_PID", lpid, 1);
+      i = 0;
+      tgt = 3;
+      while (-1 != lscp[i])
+       {
+         j = i + 1;
+         while (-1 != lscp[j])
+           {
+             if (lscp[j] == tgt)
+               {
+                 /* dup away */
+                 k = dup (lscp[j]);
+                 GNUNET_assert (-1 != k);
+                 GNUNET_assert (0 == close (lscp[j]));
+                 lscp[j] = k;
+                 break;
+               }
+             j++;
+           }
+         if (lscp[i] != tgt)
+           {
+             /* Bury any existing FD, no matter what; they should all be closed
+              * on exec anyway and the important onces have been dup'ed away */
+             (void) close (tgt);
+             GNUNET_assert (-1 != dup2 (lscp[i], tgt));
+           }
+         /* unset close-on-exec flag */
+         flags = fcntl (tgt, F_GETFD);
+         GNUNET_assert (flags >= 0);
+         flags &= ~FD_CLOEXEC;
+         fflush (stderr);
+         (void) fcntl (tgt, F_SETFD, flags);
+         tgt++;
+         i++;
+       }
+      GNUNET_snprintf (fds, sizeof (fds), "%u", i);
+      setenv ("LISTEN_FDS", fds, 1);
     }
-    GNUNET_snprintf (fds, sizeof (fds), "%u", i);
-    setenv ("LISTEN_FDS", fds, 1);
-  }
   GNUNET_array_grow (lscp, ls, 0);
   execvp (filename, argv);
-  GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "execvp", filename);
+  LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "execvp", filename);
   _exit (1);
 #else
   char **arg, **non_const_argv;
@@ -1029,8 +1041,8 @@
   pathbuf_len = GetEnvironmentVariableA ("PATH", (char *) &pathbuf, 0);
 
   alloc_len =
-      pathbuf_len + 1 + strlen (self_prefix) + 1 + strlen (bindir) + 1 +
-      strlen (libdir);
+    pathbuf_len + 1 + strlen (self_prefix) + 1 + strlen (bindir) + 1 +
+    strlen (libdir);
 
   pathbuf = GNUNET_malloc (alloc_len * sizeof (char));
 
@@ -1042,11 +1054,11 @@
 
   alloc_len = GetEnvironmentVariableA ("PATH", ptr, pathbuf_len);
   if (alloc_len != pathbuf_len - 1)
-  {
-    GNUNET_free (pathbuf);
-    errno = ENOSYS;             /* PATH changed on the fly. What kind of error 
is that? */
-    return NULL;
-  }
+    {
+      GNUNET_free (pathbuf);
+      errno = ENOSYS;          /* PATH changed on the fly. What kind of error 
is that? */
+      return NULL;
+    }
 
   cmdlen = strlen (filename);
   if (cmdlen < 5 || strcmp (&filename[cmdlen - 4], ".exe") != 0)
@@ -1058,26 +1070,26 @@
   if (non_const_filename[1] == ':')
     snprintf (path, sizeof (path) / sizeof (char), "%s", non_const_filename);
   else if (!SearchPathA
-           (pathbuf, non_const_filename, NULL, sizeof (path) / sizeof (char),
-            path, NULL))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "SearchPath",
-                              non_const_filename);
-    GNUNET_free (non_const_filename);
-    GNUNET_free (pathbuf);
-    return NULL;
-  }
+          (pathbuf, non_const_filename, NULL, sizeof (path) / sizeof (char),
+           path, NULL))
+    {
+      SetErrnoFromWinError (GetLastError ());
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "SearchPath",
+                        non_const_filename);
+      GNUNET_free (non_const_filename);
+      GNUNET_free (pathbuf);
+      return NULL;
+    }
   GNUNET_free (pathbuf);
   GNUNET_free (non_const_filename);
 
   /* Count the number of arguments */
   arg = (char **) argv;
   while (*arg)
-  {
-    arg++;
-    argcount++;
-  }
+    {
+      arg++;
+      argcount++;
+    }
 
   /* Allocate a copy argv */
   non_const_argv = GNUNET_malloc (sizeof (char *) * (argcount + 1));
@@ -1086,33 +1098,33 @@
   argcount = 0;
   arg = (char **) argv;
   while (*arg)
-  {
-    if (arg == argv)
-      non_const_argv[argcount] = GNUNET_strdup (path);
-    else
-      non_const_argv[argcount] = GNUNET_strdup (*arg);
-    arg++;
-    argcount++;
-  }
+    {
+      if (arg == argv)
+       non_const_argv[argcount] = GNUNET_strdup (path);
+      else
+       non_const_argv[argcount] = GNUNET_strdup (*arg);
+      arg++;
+      argcount++;
+    }
   non_const_argv[argcount] = NULL;
 
   /* Count cmd len */
   cmdlen = 1;
   arg = non_const_argv;
   while (*arg)
-  {
-    cmdlen = cmdlen + strlen (*arg) + 3;
-    arg++;
-  }
+    {
+      cmdlen = cmdlen + strlen (*arg) + 3;
+      arg++;
+    }
 
   /* Allocate and create cmd */
   cmd = idx = GNUNET_malloc (sizeof (char) * cmdlen);
   arg = non_const_argv;
   while (*arg)
-  {
-    idx += sprintf (idx, "\"%s\" ", *arg);
-    arg++;
-  }
+    {
+      idx += sprintf (idx, "\"%s\" ", *arg);
+      arg++;
+    }
 
   while (argcount > 0)
     GNUNET_free (non_const_argv[--argcount]);
@@ -1122,19 +1134,19 @@
   start.cb = sizeof (start);
 
   control_pipe =
-      GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
-                                GNUNET_DISK_PERM_USER_READ |
-                                GNUNET_DISK_PERM_USER_WRITE);
+    GNUNET_DISK_npipe_create (&childpipename, GNUNET_DISK_OPEN_WRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   if (control_pipe == NULL)
-  {
-    GNUNET_free (cmd);
-    GNUNET_free (path);
-    return NULL;
-  }
+    {
+      GNUNET_free (cmd);
+      GNUNET_free (path);
+      return NULL;
+    }
 
 #if DEBUG_OS
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Opened the parent end of the pipe `%s'\n", childpipename);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Opened the parent end of the pipe `%s'\n", childpipename);
 #endif
 
   GNUNET_asprintf (&our_env[0], "%s=", GNUNET_OS_CONTROL_PIPE);
@@ -1147,13 +1159,13 @@
   if (!CreateProcess
       (path, cmd, NULL, NULL, FALSE, DETACHED_PROCESS | CREATE_SUSPENDED,
        env_block, NULL, &start, &proc))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "CreateProcess");
-    GNUNET_free (env_block);
-    GNUNET_free (cmd);
-    return NULL;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "CreateProcess");
+      GNUNET_free (env_block);
+      GNUNET_free (cmd);
+      return NULL;
+    }
 
   GNUNET_free (env_block);
 
@@ -1182,8 +1194,8 @@
  */
 int
 GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
-                          enum GNUNET_OS_ProcessStatusType *type,
-                          unsigned long *code)
+                         enum GNUNET_OS_ProcessStatusType *type,
+                         unsigned long *code)
 {
 #ifndef MINGW
   int status;
@@ -1192,48 +1204,48 @@
   GNUNET_assert (0 != proc);
   ret = waitpid (proc->pid, &status, WNOHANG);
   if (ret < 0)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "waitpid");
+      return GNUNET_SYSERR;
+    }
   if (0 == ret)
-  {
-    *type = GNUNET_OS_PROCESS_RUNNING;
-    *code = 0;
-    return GNUNET_NO;
-  }
+    {
+      *type = GNUNET_OS_PROCESS_RUNNING;
+      *code = 0;
+      return GNUNET_NO;
+    }
   if (proc->pid != ret)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "waitpid");
+      return GNUNET_SYSERR;
+    }
   if (WIFEXITED (status))
-  {
-    *type = GNUNET_OS_PROCESS_EXITED;
-    *code = WEXITSTATUS (status);
-  }
+    {
+      *type = GNUNET_OS_PROCESS_EXITED;
+      *code = WEXITSTATUS (status);
+    }
   else if (WIFSIGNALED (status))
-  {
-    *type = GNUNET_OS_PROCESS_SIGNALED;
-    *code = WTERMSIG (status);
-  }
+    {
+      *type = GNUNET_OS_PROCESS_SIGNALED;
+      *code = WTERMSIG (status);
+    }
   else if (WIFSTOPPED (status))
-  {
-    *type = GNUNET_OS_PROCESS_SIGNALED;
-    *code = WSTOPSIG (status);
-  }
+    {
+      *type = GNUNET_OS_PROCESS_SIGNALED;
+      *code = WSTOPSIG (status);
+    }
 #ifdef WIFCONTINUED
   else if (WIFCONTINUED (status))
-  {
-    *type = GNUNET_OS_PROCESS_RUNNING;
-    *code = 0;
-  }
+    {
+      *type = GNUNET_OS_PROCESS_RUNNING;
+      *code = 0;
+    }
 #endif
   else
-  {
-    *type = GNUNET_OS_PROCESS_UNKNOWN;
-    *code = 0;
-  }
+    {
+      *type = GNUNET_OS_PROCESS_UNKNOWN;
+      *code = 0;
+    }
 #else
   HANDLE h;
   DWORD c, error_code, ret;
@@ -1241,11 +1253,11 @@
   h = proc->handle;
   ret = proc->pid;
   if (h == NULL || ret == 0)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Invalid process information {%d, %08X}\n", ret, h);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          "Invalid process information {%d, %08X}\n", ret, h);
+      return GNUNET_SYSERR;
+    }
   if (h == NULL)
     h = GetCurrentProcess ();
 
@@ -1253,17 +1265,17 @@
   ret = GetExitCodeProcess (h, &c);
   error_code = GetLastError ();
   if (ret == 0 || error_code != NO_ERROR)
-  {
-    SetErrnoFromWinError (error_code);
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "GetExitCodeProcess");
-    return GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (error_code);
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "GetExitCodeProcess");
+      return GNUNET_SYSERR;
+    }
   if (STILL_ACTIVE == c)
-  {
-    *type = GNUNET_OS_PROCESS_RUNNING;
-    *code = 0;
-    return GNUNET_NO;
-  }
+    {
+      *type = GNUNET_OS_PROCESS_RUNNING;
+      *code = 0;
+      return GNUNET_NO;
+    }
   *type = GNUNET_OS_PROCESS_EXITED;
   *code = c;
 #endif
@@ -1293,19 +1305,19 @@
 
   h = proc->handle;
   if (NULL == h)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Invalid process information {%d, %08X}\n", proc->pid, h);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          "Invalid process information {%d, %08X}\n", proc->pid, h);
+      return GNUNET_SYSERR;
+    }
   if (h == NULL)
     h = GetCurrentProcess ();
 
   if (WAIT_OBJECT_0 != WaitForSingleObject (h, INFINITE))
-  {
-    SetErrnoFromWinError (GetLastError ());
-    ret = GNUNET_SYSERR;
-  }
+    {
+      SetErrnoFromWinError (GetLastError ());
+      ret = GNUNET_SYSERR;
+    }
   else
     ret = GNUNET_OK;
 
@@ -1379,10 +1391,10 @@
 {
 
   if (cmd->proc != NULL)
-  {
-    GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cmd->rtask);
-    GNUNET_SCHEDULER_cancel (cmd->rtask);
-  }
+    {
+      GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cmd->rtask);
+      GNUNET_SCHEDULER_cancel (cmd->rtask);
+    }
   (void) GNUNET_OS_process_kill (cmd->eip, SIGKILL);
   GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (cmd->eip));
   GNUNET_OS_process_close (cmd->eip);
@@ -1406,42 +1418,43 @@
   ssize_t ret;
 
   cmd->rtask = GNUNET_SCHEDULER_NO_TASK;
-  if (GNUNET_YES != GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r))
-  {
-    /* timeout, shutdown, etc. */
-    proc = cmd->proc;
-    cmd->proc = NULL;
-    proc (cmd->proc_cls, NULL);
-    return;
-  }
+  if (GNUNET_YES !=
+      GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r))
+    {
+      /* timeout, shutdown, etc. */
+      proc = cmd->proc;
+      cmd->proc = NULL;
+      proc (cmd->proc_cls, NULL);
+      return;
+    }
   ret =
-      GNUNET_DISK_file_read (cmd->r, &cmd->buf[cmd->off],
-                             sizeof (cmd->buf) - cmd->off);
+    GNUNET_DISK_file_read (cmd->r, &cmd->buf[cmd->off],
+                          sizeof (cmd->buf) - cmd->off);
   if (ret <= 0)
-  {
-    if ((cmd->off > 0) && (cmd->off < sizeof (cmd->buf)))
     {
-      cmd->buf[cmd->off] = '\0';
-      cmd->proc (cmd->proc_cls, cmd->buf);
+      if ((cmd->off > 0) && (cmd->off < sizeof (cmd->buf)))
+       {
+         cmd->buf[cmd->off] = '\0';
+         cmd->proc (cmd->proc_cls, cmd->buf);
+       }
+      proc = cmd->proc;
+      cmd->proc = NULL;
+      proc (cmd->proc_cls, NULL);
+      return;
     }
-    proc = cmd->proc;
-    cmd->proc = NULL;
-    proc (cmd->proc_cls, NULL);
-    return;
-  }
   end = memchr (&cmd->buf[cmd->off], '\n', ret);
   cmd->off += ret;
   while (end != NULL)
-  {
-    *end = '\0';
-    cmd->proc (cmd->proc_cls, cmd->buf);
-    memmove (cmd->buf, end + 1, cmd->off - (end + 1 - cmd->buf));
-    cmd->off -= (end + 1 - cmd->buf);
-    end = memchr (cmd->buf, '\n', cmd->off);
-  }
+    {
+      *end = '\0';
+      cmd->proc (cmd->proc_cls, cmd->buf);
+      memmove (cmd->buf, end + 1, cmd->off - (end + 1 - cmd->buf));
+      cmd->off -= (end + 1 - cmd->buf);
+      end = memchr (cmd->buf, '\n', cmd->off);
+    }
   cmd->rtask =
-      GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
-                                      (cmd->timeout), cmd->r, &cmd_read, cmd);
+    GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
+                                   (cmd->timeout), cmd->r, &cmd_read, cmd);
 }
 
 
@@ -1458,8 +1471,8 @@
  */
 struct GNUNET_OS_CommandHandle *
 GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls,
-                       struct GNUNET_TIME_Relative timeout, const char *binary,
-                       ...)
+                      struct GNUNET_TIME_Relative timeout,
+                      const char *binary, ...)
 {
   struct GNUNET_OS_CommandHandle *cmd;
   struct GNUNET_OS_Process *eip;
@@ -1473,10 +1486,10 @@
   eip = GNUNET_OS_start_process_va (NULL, opipe, binary, ap);
   va_end (ap);
   if (NULL == eip)
-  {
-    GNUNET_DISK_pipe_close (opipe);
-    return NULL;
-  }
+    {
+      GNUNET_DISK_pipe_close (opipe);
+      return NULL;
+    }
   GNUNET_DISK_pipe_close_end (opipe, GNUNET_DISK_PIPE_END_WRITE);
   cmd = GNUNET_malloc (sizeof (struct GNUNET_OS_CommandHandle));
   cmd->timeout = GNUNET_TIME_relative_to_absolute (timeout);
@@ -1485,7 +1498,8 @@
   cmd->proc = proc;
   cmd->proc_cls = proc_cls;
   cmd->r = GNUNET_DISK_pipe_handle (opipe, GNUNET_DISK_PIPE_END_READ);
-  cmd->rtask = GNUNET_SCHEDULER_add_read_file (timeout, cmd->r, &cmd_read, 
cmd);
+  cmd->rtask =
+    GNUNET_SCHEDULER_add_read_file (timeout, cmd->r, &cmd_read, cmd);
   return cmd;
 }
 

Modified: gnunet/src/util/peer.c
===================================================================
--- gnunet/src/util/peer.c      2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/peer.c      2011-10-11 09:43:04 UTC (rev 17362)
@@ -27,7 +27,9 @@
 #include "platform.h"
 #include "gnunet_peer_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+
 struct PeerEntry
 {
   /**
@@ -105,7 +107,7 @@
  * @return the interned identity.
  */
 GNUNET_PEER_Id
-GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
+GNUNET_PEER_intern (const struct GNUNET_PeerIdentity * pid)
 {
   GNUNET_PEER_Id ret;
   struct PeerEntry *e;
@@ -119,24 +121,24 @@
   off = (long) GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey);
   e = (off == 0) ? NULL : &table[off];
   if (e != NULL)
-  {
-    GNUNET_assert (e->rc > 0);
-    e->rc++;
-    return e->pid;
-  }
+    {
+      GNUNET_assert (e->rc > 0);
+      e->rc++;
+      return e->pid;
+    }
   ret = free_list_start;
   if (ret == size)
-  {
-    GNUNET_array_grow (table, size, size + 16);
-    for (i = ret; i < size; i++)
-      table[i].pid = i + 1;
-  }
+    {
+      GNUNET_array_grow (table, size, size + 16);
+      for (i = ret; i < size; i++)
+       table[i].pid = i + 1;
+    }
   if (ret == 0)
-  {
-    table[0].pid = 0;
-    table[0].rc = 1;
-    ret = 1;
-  }
+    {
+      table[0].pid = 0;
+      table[0].rc = 1;
+      ret = 1;
+    }
   GNUNET_assert (ret < size);
   GNUNET_assert (table[ret].rc == 0);
   free_list_start = table[ret].pid;
@@ -144,9 +146,9 @@
   table[ret].rc = 1;
   table[ret].pid = ret;
   GNUNET_break (GNUNET_OK ==
-                GNUNET_CONTAINER_multihashmap_put (map, &pid->hashPubKey,
-                                                   (void *) (long) ret,
-                                                   
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+               GNUNET_CONTAINER_multihashmap_put (map, &pid->hashPubKey,
+                                                  (void *) (long) ret,
+                                                  
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
   return ret;
 }
 
@@ -158,7 +160,7 @@
  * @param count size of the ids array
  */
 void
-GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count)
+GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id * ids, unsigned int count)
 {
   int i;
   GNUNET_PEER_Id id;
@@ -166,24 +168,25 @@
   if (count == 0)
     return;
   for (i = count - 1; i >= 0; i--)
-  {
-    id = ids[i];
-    if (id == 0)
-      continue;
-    GNUNET_assert (id < size);
-    GNUNET_assert (table[id].rc > 0);
-    table[id].rc--;
-    if (table[id].rc == 0)
     {
-      GNUNET_break (GNUNET_OK ==
-                    GNUNET_CONTAINER_multihashmap_remove (map,
-                                                          &table[id].
-                                                          id.hashPubKey,
-                                                          (void *) (long) id));
-      table[id].pid = free_list_start;
-      free_list_start = id;
+      id = ids[i];
+      if (id == 0)
+       continue;
+      GNUNET_assert (id < size);
+      GNUNET_assert (table[id].rc > 0);
+      table[id].rc--;
+      if (table[id].rc == 0)
+       {
+         GNUNET_break (GNUNET_OK ==
+                       GNUNET_CONTAINER_multihashmap_remove (map,
+                                                             &table[id].
+                                                             id.hashPubKey,
+                                                             (void *) (long)
+                                                             id));
+         table[id].pid = free_list_start;
+         free_list_start = id;
+       }
     }
-  }
 }
 
 
@@ -203,15 +206,16 @@
   GNUNET_assert ((delta >= 0) || (table[id].rc >= -delta));
   table[id].rc += delta;
   if (table[id].rc == 0)
-  {
-    GNUNET_break (GNUNET_OK ==
-                  GNUNET_CONTAINER_multihashmap_remove (map,
-                                                        &table[id].
-                                                        id.hashPubKey,
-                                                        (void *) (long) id));
-    table[id].pid = free_list_start;
-    free_list_start = id;
-  }
+    {
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_CONTAINER_multihashmap_remove (map,
+                                                         &table[id].
+                                                         id.hashPubKey,
+                                                         (void *) (long)
+                                                         id));
+      table[id].pid = free_list_start;
+      free_list_start = id;
+    }
 }
 
 
@@ -225,11 +229,11 @@
 GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
 {
   if (id == 0)
-  {
-    memset (pid, 0, sizeof (struct GNUNET_PeerIdentity));
-    GNUNET_break (0);
-    return;
-  }
+    {
+      memset (pid, 0, sizeof (struct GNUNET_PeerIdentity));
+      GNUNET_break (0);
+      return;
+    }
   GNUNET_assert (id < size);
   GNUNET_assert (table[id].rc > 0);
   *pid = table[id].id;

Modified: gnunet/src/util/perf_crypto_hash.c
===================================================================
--- gnunet/src/util/perf_crypto_hash.c  2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/perf_crypto_hash.c  2011-10-11 09:43:04 UTC (rev 17362)
@@ -42,11 +42,11 @@
   memset (buf, 1, 1024 * 64);
   GNUNET_CRYPTO_hash ("foo", 3, &hc1);
   for (i = 0; i < 1024; i++)
-  {
-    GNUNET_CRYPTO_hash (&hc1, sizeof (GNUNET_HashCode), &hc2);
-    GNUNET_CRYPTO_hash (&hc2, sizeof (GNUNET_HashCode), &hc1);
-    GNUNET_CRYPTO_hash (buf, 1024 * 64, &hc3);
-  }
+    {
+      GNUNET_CRYPTO_hash (&hc1, sizeof (GNUNET_HashCode), &hc2);
+      GNUNET_CRYPTO_hash (&hc2, sizeof (GNUNET_HashCode), &hc1);
+      GNUNET_CRYPTO_hash (buf, 1024 * 64, &hc3);
+    }
   GNUNET_free (buf);
 }
 
@@ -58,12 +58,12 @@
   start = GNUNET_TIME_absolute_get ();
   perfHash ();
   printf ("Hash perf took %llu ms\n",
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value);
   GAUGER ("UTIL", "Cryptographic hashing",
-          1024 * 64 * 1024 / (1 +
-                              GNUNET_TIME_absolute_get_duration
-                              (start).rel_value), "kb/s");
+         1024 * 64 * 1024 / (1 +
+                             GNUNET_TIME_absolute_get_duration
+                             (start).rel_value), "kb/s");
   return 0;
 }
 

Modified: gnunet/src/util/plugin.c
===================================================================
--- gnunet/src/util/plugin.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/plugin.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -30,6 +30,8 @@
 #include "gnunet_os_lib.h"
 #include "gnunet_plugin_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
 /**
  * Linked list of active plugins.
  */
@@ -83,30 +85,30 @@
 
   err = lt_dlinit ();
   if (err > 0)
-  {
-    fprintf (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
-             lt_dlerror ());
-    return;
-  }
+    {
+      fprintf (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
+              lt_dlerror ());
+      return;
+    }
   opath = lt_dlgetsearchpath ();
   if (opath != NULL)
     old_dlsearchpath = GNUNET_strdup (opath);
   path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR);
   if (path != NULL)
-  {
-    if (opath != NULL)
     {
-      GNUNET_asprintf (&cpath, "%s:%s", opath, path);
-      lt_dlsetsearchpath (cpath);
-      GNUNET_free (path);
-      GNUNET_free (cpath);
+      if (opath != NULL)
+       {
+         GNUNET_asprintf (&cpath, "%s:%s", opath, path);
+         lt_dlsetsearchpath (cpath);
+         GNUNET_free (path);
+         GNUNET_free (cpath);
+       }
+      else
+       {
+         lt_dlsetsearchpath (path);
+         GNUNET_free (path);
+       }
     }
-    else
-    {
-      lt_dlsetsearchpath (path);
-      GNUNET_free (path);
-    }
-  }
 }
 
 
@@ -118,10 +120,10 @@
 {
   lt_dlsetsearchpath (old_dlsearchpath);
   if (old_dlsearchpath != NULL)
-  {
-    GNUNET_free (old_dlsearchpath);
-    old_dlsearchpath = NULL;
-  }
+    {
+      GNUNET_free (old_dlsearchpath);
+      old_dlsearchpath = NULL;
+    }
   lt_dlexit ();
 }
 
@@ -140,9 +142,9 @@
   if (mptr == NULL)
     mptr = lt_dlsym (plug->handle, initName);
   if (mptr == NULL)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("`%s' failed to resolve method '%s' with error: %s\n"),
-                "lt_dlsym", &initName[1], lt_dlerror ());
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+        _("`%s' failed to resolve method '%s' with error: %s\n"),
+        "lt_dlsym", &initName[1], lt_dlerror ());
   GNUNET_free (initName);
   return mptr;
 }
@@ -164,10 +166,10 @@
   struct PluginList plug;
 
   if (!initialized)
-  {
-    initialized = GNUNET_YES;
-    plugin_init ();
-  }
+    {
+      initialized = GNUNET_YES;
+      plugin_init ();
+    }
   libhandle = lt_dlopenext (library_name);
   if (libhandle == NULL)
     return GNUNET_NO;
@@ -175,11 +177,11 @@
   plug.name = (char *) library_name;
   init = resolve_function (&plug, "init");
   if (init == NULL)
-  {
-    GNUNET_break (0);
-    lt_dlclose (libhandle);
-    return GNUNET_NO;
-  }
+    {
+      GNUNET_break (0);
+      lt_dlclose (libhandle);
+      return GNUNET_NO;
+    }
   lt_dlclose (libhandle);
   return GNUNET_YES;
 }
@@ -206,18 +208,18 @@
   void *ret;
 
   if (!initialized)
-  {
-    initialized = GNUNET_YES;
-    plugin_init ();
-  }
+    {
+      initialized = GNUNET_YES;
+      plugin_init ();
+    }
   libhandle = lt_dlopenext (library_name);
   if (libhandle == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("`%s' failed for library `%s' with error: %s\n"),
-                "lt_dlopenext", library_name, lt_dlerror ());
-    return NULL;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("`%s' failed for library `%s' with error: %s\n"),
+          "lt_dlopenext", library_name, lt_dlerror ());
+      return NULL;
+    }
   plug = GNUNET_malloc (sizeof (struct PluginList));
   plug->handle = libhandle;
   plug->name = GNUNET_strdup (library_name);
@@ -225,13 +227,13 @@
   plugins = plug;
   init = resolve_function (plug, "init");
   if ((init == NULL) || (NULL == (ret = init (arg))))
-  {
-    lt_dlclose (libhandle);
-    GNUNET_free (plug->name);
-    plugins = plug->next;
-    GNUNET_free (plug);
-    return NULL;
-  }
+    {
+      lt_dlclose (libhandle);
+      GNUNET_free (plug->name);
+      plugins = plug->next;
+      GNUNET_free (plug);
+      return NULL;
+    }
   return ret;
 }
 
@@ -255,10 +257,10 @@
   prev = NULL;
   pos = plugins;
   while ((pos != NULL) && (0 != strcmp (pos->name, library_name)))
-  {
-    prev = pos;
-    pos = pos->next;
-  }
+    {
+      prev = pos;
+      pos = pos->next;
+    }
   if (pos == NULL)
     return NULL;
 
@@ -274,10 +276,10 @@
   GNUNET_free (pos->name);
   GNUNET_free (pos);
   if (plugins == NULL)
-  {
-    plugin_fini ();
-    initialized = GNUNET_NO;
-  }
+    {
+      plugin_fini ();
+      initialized = GNUNET_NO;
+    }
   return ret;
 }
 

Modified: gnunet/src/util/program.c
===================================================================
--- gnunet/src/util/program.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/program.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -36,6 +36,10 @@
 #include "gnunet_scheduler_lib.h"
 #include <gcrypt.h>
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 /**
  * Context for the command.
  */
@@ -125,9 +129,9 @@
  */
 int
 GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName,
-                    const char *binaryHelp,
-                    const struct GNUNET_GETOPT_CommandLineOption *options,
-                    GNUNET_PROGRAM_Main task, void *task_cls)
+                   const char *binaryHelp,
+                   const struct GNUNET_GETOPT_CommandLineOption *options,
+                   GNUNET_PROGRAM_Main task, void *task_cls)
 {
   struct CommandContext cc;
   char *path;
@@ -155,29 +159,29 @@
   logfile = NULL;
   gargs = getenv ("GNUNET_ARGS");
   if (gargs != NULL)
-  {
-    char **gargv;
-    unsigned int gargc;
-    int i;
-    char *tok;
-    char *cargs;
+    {
+      char **gargv;
+      unsigned int gargc;
+      int i;
+      char *tok;
+      char *cargs;
 
-    gargv = NULL;
-    gargc = 0;
-    for (i = 0; i < argc; i++)
-      GNUNET_array_append (gargv, gargc, GNUNET_strdup (argv[i]));
-    cargs = GNUNET_strdup (gargs);
-    tok = strtok (cargs, " ");
-    while (NULL != tok)
-    {
-      GNUNET_array_append (gargv, gargc, GNUNET_strdup (tok));
-      tok = strtok (NULL, " ");
+      gargv = NULL;
+      gargc = 0;
+      for (i = 0; i < argc; i++)
+       GNUNET_array_append (gargv, gargc, GNUNET_strdup (argv[i]));
+      cargs = GNUNET_strdup (gargs);
+      tok = strtok (cargs, " ");
+      while (NULL != tok)
+       {
+         GNUNET_array_append (gargv, gargc, GNUNET_strdup (tok));
+         tok = strtok (NULL, " ");
+       }
+      GNUNET_free (cargs);
+      GNUNET_array_append (gargv, gargc, NULL);
+      argv = (char *const *) gargv;
+      argc = gargc - 1;
     }
-    GNUNET_free (cargs);
-    GNUNET_array_append (gargv, gargc, NULL);
-    argv = (char *const *) gargv;
-    argc = gargc - 1;
-  }
   memset (&cc, 0, sizeof (cc));
   loglev = NULL;
   cc.task = task;
@@ -189,27 +193,28 @@
   setlocale (LC_ALL, "");
   path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LOCALEDIR);
   if (path != NULL)
-  {
-    BINDTEXTDOMAIN ("GNUnet", path);
-    GNUNET_free (path);
-  }
+    {
+      BINDTEXTDOMAIN ("GNUnet", path);
+      GNUNET_free (path);
+    }
   textdomain ("GNUnet");
 #endif
   cnt = 0;
   while (options[cnt].name != NULL)
     cnt++;
   allopts =
-      GNUNET_malloc ((cnt +
-                      1) * sizeof (struct GNUNET_GETOPT_CommandLineOption) +
-                     sizeof (defoptions));
+    GNUNET_malloc ((cnt +
+                   1) * sizeof (struct GNUNET_GETOPT_CommandLineOption) +
+                  sizeof (defoptions));
   memcpy (allopts, defoptions, sizeof (defoptions));
   memcpy (&allopts
-          [sizeof (defoptions) /
-           sizeof (struct GNUNET_GETOPT_CommandLineOption)], options,
-          (cnt + 1) * sizeof (struct GNUNET_GETOPT_CommandLineOption));
-  cnt += sizeof (defoptions) / sizeof (struct GNUNET_GETOPT_CommandLineOption);
+         [sizeof (defoptions) /
+          sizeof (struct GNUNET_GETOPT_CommandLineOption)], options,
+         (cnt + 1) * sizeof (struct GNUNET_GETOPT_CommandLineOption));
+  cnt +=
+    sizeof (defoptions) / sizeof (struct GNUNET_GETOPT_CommandLineOption);
   qsort (allopts, cnt, sizeof (struct GNUNET_GETOPT_CommandLineOption),
-         &cmd_sorter);
+        &cmd_sorter);
   loglev = NULL;
   cc.cfgfile = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE);
   lpfx = GNUNET_strdup (binaryName);
@@ -217,30 +222,31 @@
     *spc = '\0';
   if ((-1 ==
        (ret =
-        GNUNET_GETOPT_run (binaryName, allopts, (unsigned int) argc, argv))) ||
-      (GNUNET_OK != GNUNET_log_setup (lpfx, loglev, logfile)) )
-  {
-    GNUNET_CONFIGURATION_destroy (cfg);
-    GNUNET_free_non_null (cc.cfgfile);
-    GNUNET_free_non_null (loglev);
-    GNUNET_free_non_null (logfile);
-    GNUNET_free (allopts);
-    GNUNET_free (lpfx);
-    return GNUNET_SYSERR;
-  }
+       GNUNET_GETOPT_run (binaryName, allopts, (unsigned int) argc, argv)))
+      || (GNUNET_OK != GNUNET_log_setup (lpfx, loglev, logfile)))
+    {
+      GNUNET_CONFIGURATION_destroy (cfg);
+      GNUNET_free_non_null (cc.cfgfile);
+      GNUNET_free_non_null (loglev);
+      GNUNET_free_non_null (logfile);
+      GNUNET_free (allopts);
+      GNUNET_free (lpfx);
+      return GNUNET_SYSERR;
+    }
   (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile);
   GNUNET_free (allopts);
   GNUNET_free (lpfx);
   if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_number (cc.cfg, "testing", "skew_offset",
-                                             &skew_offset) &&
+                                            &skew_offset) &&
       (GNUNET_OK ==
        GNUNET_CONFIGURATION_get_value_number (cc.cfg, "testing",
-                                              "skew_variance", 
&skew_variance)))
-  {
-    clock_offset = skew_offset - skew_variance;
-    GNUNET_TIME_set_offset (clock_offset);
-  }
+                                             "skew_variance",
+                                             &skew_variance)))
+    {
+      clock_offset = skew_offset - skew_variance;
+      GNUNET_TIME_set_offset (clock_offset);
+    }
   /* run */
   cc.args = &argv[ret];
   GNUNET_SCHEDULER_run (&program_main, &cc);

Modified: gnunet/src/util/pseudonym.c
===================================================================
--- gnunet/src/util/pseudonym.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/pseudonym.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -31,6 +31,10 @@
 #include "gnunet_pseudonym_lib.h"
 #include "gnunet_bio_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 /**
  * Name of the directory which stores meta data for pseudonym
  */
@@ -78,16 +82,16 @@
  */
 static void
 internal_notify (const GNUNET_HashCode * id,
-                 const struct GNUNET_CONTAINER_MetaData *md, int rating)
+                const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
   struct DiscoveryCallback *pos;
 
   pos = head;
   while (pos != NULL)
-  {
-    pos->callback (pos->closure, id, md, rating);
-    pos = pos->next;
-  }
+    {
+      pos->callback (pos->closure, id, md, rating);
+      pos = pos->next;
+    }
 }
 
 /**
@@ -99,9 +103,10 @@
  */
 int
 GNUNET_PSEUDONYM_discovery_callback_register (const struct
-                                              GNUNET_CONFIGURATION_Handle *cfg,
-                                              GNUNET_PSEUDONYM_Iterator
-                                              iterator, void *closure)
+                                             GNUNET_CONFIGURATION_Handle
+                                             *cfg,
+                                             GNUNET_PSEUDONYM_Iterator
+                                             iterator, void *closure)
 {
   struct DiscoveryCallback *list;
 
@@ -121,7 +126,7 @@
  */
 int
 GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
-                                                iterator, void *closure)
+                                               iterator, void *closure)
 {
   struct DiscoveryCallback *prev;
   struct DiscoveryCallback *pos;
@@ -129,11 +134,11 @@
   prev = NULL;
   pos = head;
   while ((pos != NULL) &&
-         ((pos->callback != iterator) || (pos->closure != closure)))
-  {
-    prev = pos;
-    pos = pos->next;
-  }
+        ((pos->callback != iterator) || (pos->closure != closure)))
+    {
+      prev = pos;
+      pos = pos->next;
+    }
   if (pos == NULL)
     return GNUNET_SYSERR;
   if (prev == NULL)
@@ -155,16 +160,17 @@
  */
 static char *
 get_data_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                   const char *prefix, const GNUNET_HashCode * psid)
+                  const char *prefix, const GNUNET_HashCode * psid)
 {
   struct GNUNET_CRYPTO_HashAsciiEncoded enc;
 
   if (psid != NULL)
     GNUNET_CRYPTO_hash_to_enc (psid, &enc);
-  return GNUNET_DISK_get_home_filename (cfg, GNUNET_CLIENT_SERVICE_NAME, 
prefix,
-                                        (psid ==
-                                         NULL) ? NULL : (const char *) &enc,
-                                        NULL);
+  return GNUNET_DISK_get_home_filename (cfg, GNUNET_CLIENT_SERVICE_NAME,
+                                       prefix,
+                                       (psid ==
+                                        NULL) ? NULL : (const char *) &enc,
+                                       NULL);
 }
 
 
@@ -178,9 +184,9 @@
  */
 static void
 write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                      const GNUNET_HashCode * nsid,
-                      const struct GNUNET_CONTAINER_MetaData *meta,
-                      int32_t ranking, const char *ns_name)
+                     const GNUNET_HashCode * nsid,
+                     const struct GNUNET_CONTAINER_MetaData *meta,
+                     int32_t ranking, const char *ns_name)
 {
   char *fn;
   struct GNUNET_BIO_WriteHandle *fileW;
@@ -189,23 +195,23 @@
   GNUNET_assert (fn != NULL);
   fileW = GNUNET_BIO_write_open (fn);
   if (NULL != fileW)
-  {
-    if ((GNUNET_OK != GNUNET_BIO_write_int32 (fileW, ranking)) ||
-        (GNUNET_OK != GNUNET_BIO_write_string (fileW, ns_name)) ||
-        (GNUNET_OK != GNUNET_BIO_write_meta_data (fileW, meta)))
     {
-      (void) GNUNET_BIO_write_close (fileW);
-      GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
-      GNUNET_free (fn);
-      return;
+      if ((GNUNET_OK != GNUNET_BIO_write_int32 (fileW, ranking)) ||
+         (GNUNET_OK != GNUNET_BIO_write_string (fileW, ns_name)) ||
+         (GNUNET_OK != GNUNET_BIO_write_meta_data (fileW, meta)))
+       {
+         (void) GNUNET_BIO_write_close (fileW);
+         GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
+         GNUNET_free (fn);
+         return;
+       }
+      if (GNUNET_OK != GNUNET_BIO_write_close (fileW))
+       {
+         GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
+         GNUNET_free (fn);
+         return;
+       }
     }
-    if (GNUNET_OK != GNUNET_BIO_write_close (fileW))
-    {
-      GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
-      GNUNET_free (fn);
-      return;
-    }
-  }
   GNUNET_free (fn);
   /* create entry for pseudonym name in names */
   /* FIXME: 90% of what this call does is not needed
@@ -224,9 +230,9 @@
  */
 static int
 read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
-           const GNUNET_HashCode * nsid,
-           struct GNUNET_CONTAINER_MetaData **meta, int32_t * ranking,
-           char **ns_name)
+          const GNUNET_HashCode * nsid,
+          struct GNUNET_CONTAINER_MetaData **meta, int32_t * ranking,
+          char **ns_name)
 {
   char *fn;
   char *emsg;
@@ -236,10 +242,10 @@
   GNUNET_assert (fn != NULL);
   fileR = GNUNET_BIO_read_open (fn);
   if (fileR == NULL)
-  {
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   emsg = NULL;
   *ns_name = NULL;
   if ((GNUNET_OK != GNUNET_BIO_read_int32 (fileR, ranking)) ||
@@ -247,30 +253,30 @@
        GNUNET_BIO_read_string (fileR, "Read string error!", ns_name, 200)) ||
       (GNUNET_OK !=
        GNUNET_BIO_read_meta_data (fileR, "Read meta data error!", meta)))
-  {
-    (void) GNUNET_BIO_read_close (fileR, &emsg);
-    GNUNET_free_non_null (emsg);
-    GNUNET_free_non_null (*ns_name);
-    *ns_name = NULL;
-    GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      (void) GNUNET_BIO_read_close (fileR, &emsg);
+      GNUNET_free_non_null (emsg);
+      GNUNET_free_non_null (*ns_name);
+      *ns_name = NULL;
+      GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   if (GNUNET_OK != GNUNET_BIO_read_close (fileR, &emsg))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _
-                ("Failed to parse metadata about pseudonym from file `%s': 
%s\n"),
-                fn, emsg);
-    GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
-    GNUNET_CONTAINER_meta_data_destroy (*meta);
-    *meta = NULL;
-    GNUNET_free_non_null (*ns_name);
-    *ns_name = NULL;
-    GNUNET_free_non_null (emsg);
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _
+          ("Failed to parse metadata about pseudonym from file `%s': %s\n"),
+          fn, emsg);
+      GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
+      GNUNET_CONTAINER_meta_data_destroy (*meta);
+      *meta = NULL;
+      GNUNET_free_non_null (*ns_name);
+      *ns_name = NULL;
+      GNUNET_free_non_null (emsg);
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (fn);
   return GNUNET_OK;
 }
@@ -286,7 +292,7 @@
  */
 char *
 GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                             const GNUNET_HashCode * nsid)
+                            const GNUNET_HashCode * nsid)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
   char *name;
@@ -304,25 +310,25 @@
   meta = NULL;
   name = NULL;
   if (GNUNET_OK == read_info (cfg, nsid, &meta, rank, &name))
-  {
-    if ((meta != NULL) && (name == NULL))
-      name =
-          GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
-                                                         
EXTRACTOR_METATYPE_TITLE,
-                                                         
EXTRACTOR_METATYPE_FILENAME,
-                                                         
EXTRACTOR_METATYPE_DESCRIPTION,
-                                                         
EXTRACTOR_METATYPE_SUBJECT,
-                                                         
EXTRACTOR_METATYPE_PUBLISHER,
-                                                         
EXTRACTOR_METATYPE_AUTHOR_NAME,
-                                                         
EXTRACTOR_METATYPE_COMMENT,
-                                                         
EXTRACTOR_METATYPE_SUMMARY,
-                                                         -1);
-    if (meta != NULL)
     {
-      GNUNET_CONTAINER_meta_data_destroy (meta);
-      meta = NULL;
+      if ((meta != NULL) && (name == NULL))
+       name =
+         GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
+                                                        
EXTRACTOR_METATYPE_TITLE,
+                                                        
EXTRACTOR_METATYPE_FILENAME,
+                                                        
EXTRACTOR_METATYPE_DESCRIPTION,
+                                                        
EXTRACTOR_METATYPE_SUBJECT,
+                                                        
EXTRACTOR_METATYPE_PUBLISHER,
+                                                        
EXTRACTOR_METATYPE_AUTHOR_NAME,
+                                                        
EXTRACTOR_METATYPE_COMMENT,
+                                                        
EXTRACTOR_METATYPE_SUMMARY,
+                                                        -1);
+      if (meta != NULL)
+       {
+         GNUNET_CONTAINER_meta_data_destroy (meta);
+         meta = NULL;
+       }
     }
-  }
   if (name == NULL)
     name = GNUNET_strdup (_("no-name"));
   GNUNET_CRYPTO_hash (name, strlen (name), &nh);
@@ -333,31 +339,31 @@
   if (0 == STAT (fn, &sbuf))
     GNUNET_DISK_file_size (fn, &len, GNUNET_YES);
   fh = GNUNET_DISK_file_open (fn,
-                              GNUNET_DISK_OPEN_CREATE |
-                              GNUNET_DISK_OPEN_READWRITE,
-                              GNUNET_DISK_PERM_USER_READ |
-                              GNUNET_DISK_PERM_USER_WRITE);
+                             GNUNET_DISK_OPEN_CREATE |
+                             GNUNET_DISK_OPEN_READWRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   i = 0;
   idx = -1;
   while ((len >= sizeof (GNUNET_HashCode)) &&
-         (sizeof (GNUNET_HashCode) ==
-          GNUNET_DISK_file_read (fh, &nh, sizeof (GNUNET_HashCode))))
-  {
-    if (0 == memcmp (&nh, nsid, sizeof (GNUNET_HashCode)))
+        (sizeof (GNUNET_HashCode) ==
+         GNUNET_DISK_file_read (fh, &nh, sizeof (GNUNET_HashCode))))
     {
+      if (0 == memcmp (&nh, nsid, sizeof (GNUNET_HashCode)))
+       {
+         idx = i;
+         break;
+       }
+      i++;
+      len -= sizeof (GNUNET_HashCode);
+    }
+  if (idx == -1)
+    {
       idx = i;
-      break;
+      if (sizeof (GNUNET_HashCode) !=
+         GNUNET_DISK_file_write (fh, nsid, sizeof (GNUNET_HashCode)))
+       LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "write", fn);
     }
-    i++;
-    len -= sizeof (GNUNET_HashCode);
-  }
-  if (idx == -1)
-  {
-    idx = i;
-    if (sizeof (GNUNET_HashCode) !=
-        GNUNET_DISK_file_write (fh, nsid, sizeof (GNUNET_HashCode)))
-      GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn);
-  }
   GNUNET_DISK_file_close (fh);
   ret = GNUNET_malloc (strlen (name) + 32);
   GNUNET_snprintf (ret, strlen (name) + 32, "%s-%u", name, idx);
@@ -376,7 +382,7 @@
  */
 int
 GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                             const char *ns_uname, GNUNET_HashCode * nsid)
+                            const char *ns_uname, GNUNET_HashCode * nsid)
 {
   size_t slen;
   uint64_t len;
@@ -402,24 +408,24 @@
   if ((GNUNET_OK != GNUNET_DISK_file_test (fn) ||
        (GNUNET_OK != GNUNET_DISK_file_size (fn, &len, GNUNET_YES))) ||
       ((idx + 1) * sizeof (GNUNET_HashCode) > len))
-  {
-    GNUNET_free (fn);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_free (fn);
+      return GNUNET_SYSERR;
+    }
   fh = GNUNET_DISK_file_open (fn,
-                              GNUNET_DISK_OPEN_CREATE |
-                              GNUNET_DISK_OPEN_READWRITE,
-                              GNUNET_DISK_PERM_USER_READ |
-                              GNUNET_DISK_PERM_USER_WRITE);
+                             GNUNET_DISK_OPEN_CREATE |
+                             GNUNET_DISK_OPEN_READWRITE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   GNUNET_free (fn);
   GNUNET_DISK_file_seek (fh, idx * sizeof (GNUNET_HashCode),
-                         GNUNET_DISK_SEEK_SET);
+                        GNUNET_DISK_SEEK_SET);
   if (sizeof (GNUNET_HashCode) !=
       GNUNET_DISK_file_read (fh, nsid, sizeof (GNUNET_HashCode)))
-  {
-    GNUNET_DISK_file_close (fh);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_DISK_file_close (fh);
+      return GNUNET_SYSERR;
+    }
   GNUNET_DISK_file_close (fh);
   return GNUNET_OK;
 }
@@ -469,15 +475,15 @@
   if (strlen (fullname) < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded))
     return GNUNET_OK;
   fn = &fullname[strlen (fullname) + 1 -
-                 sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)];
+                sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)];
   if (fn[-1] != DIR_SEPARATOR)
     return GNUNET_OK;
   ret = GNUNET_OK;
   if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (fn, &id))
-    return GNUNET_OK;           /* invalid name */
+    return GNUNET_OK;          /* invalid name */
   str = NULL;
   if (GNUNET_OK != read_info (c->cfg, &id, &meta, &rating, &str))
-    return GNUNET_OK;           /* ignore entry */
+    return GNUNET_OK;          /* ignore entry */
   GNUNET_free_non_null (str);
   if (c->iterator != NULL)
     ret = c->iterator (c->closure, &id, meta, rating);
@@ -496,7 +502,7 @@
  */
 int
 GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                           GNUNET_PSEUDONYM_Iterator iterator, void *closure)
+                          GNUNET_PSEUDONYM_Iterator iterator, void *closure)
 {
   struct ListPseudonymClosure cls;
   char *fn;
@@ -525,7 +531,7 @@
  */
 int
 GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                       const GNUNET_HashCode * nsid, int delta)
+                      const GNUNET_HashCode * nsid, int delta)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
   int ret;
@@ -535,10 +541,10 @@
   name = NULL;
   ret = read_info (cfg, nsid, &meta, &ranking, &name);
   if (ret == GNUNET_SYSERR)
-  {
-    ranking = 0;
-    meta = GNUNET_CONTAINER_meta_data_create ();
-  }
+    {
+      ranking = 0;
+      meta = GNUNET_CONTAINER_meta_data_create ();
+    }
   ranking += delta;
   write_pseudonym_info (cfg, nsid, meta, ranking, name);
   GNUNET_CONTAINER_meta_data_destroy (meta);
@@ -558,8 +564,8 @@
  */
 void
 GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                      const GNUNET_HashCode * id,
-                      const struct GNUNET_CONTAINER_MetaData *meta)
+                     const GNUNET_HashCode * id,
+                     const struct GNUNET_CONTAINER_MetaData *meta)
 {
   char *name;
   int32_t ranking;
@@ -573,16 +579,16 @@
 
   if ((0 == STAT (fn, &sbuf)) &&
       (GNUNET_OK == read_info (cfg, id, &old, &ranking, &name)))
-  {
-    GNUNET_CONTAINER_meta_data_merge (old, meta);
-    write_pseudonym_info (cfg, id, old, ranking, name);
-    GNUNET_CONTAINER_meta_data_destroy (old);
-    GNUNET_free_non_null (name);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_merge (old, meta);
+      write_pseudonym_info (cfg, id, old, ranking, name);
+      GNUNET_CONTAINER_meta_data_destroy (old);
+      GNUNET_free_non_null (name);
+    }
   else
-  {
-    write_pseudonym_info (cfg, id, meta, ranking, NULL);
-  }
+    {
+      write_pseudonym_info (cfg, id, meta, ranking, NULL);
+    }
   GNUNET_free (fn);
   internal_notify (id, meta, ranking);
 }

Modified: gnunet/src/util/resolver_api.c
===================================================================
--- gnunet/src/util/resolver_api.c      2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/resolver_api.c      2011-10-11 09:43:04 UTC (rev 17362)
@@ -35,6 +35,8 @@
 
 #define LOG(kind,...) GNUNET_log_from (kind, "resolver-api", __VA_ARGS__)
 
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, 
"resolver-api", syscall)
+
 /**
  * Maximum supported length for a hostname
  */
@@ -194,26 +196,26 @@
 #endif
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (resolver_cfg, "resolver",
-                                             "HOSTNAME", &hostname))
-  {
-    LOG (GNUNET_ERROR_TYPE_ERROR,
-         _("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME",
-         "resolver");
-    GNUNET_assert (0);
-  }
+                                            "HOSTNAME", &hostname))
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME",
+          "resolver");
+      GNUNET_assert (0);
+    }
   if ((1 != inet_pton (AF_INET, hostname, &v4)) ||
       (1 != inet_pton (AF_INET6, hostname, &v6)))
-  {
-    GNUNET_free (hostname);
-    return;
-  }
-  i = 0;
-  while (loopback[i] != NULL)
-    if (0 == strcasecmp (loopback[i++], hostname))
     {
       GNUNET_free (hostname);
       return;
     }
+  i = 0;
+  while (loopback[i] != NULL)
+    if (0 == strcasecmp (loopback[i++], hostname))
+      {
+       GNUNET_free (hostname);
+       return;
+      }
   LOG (GNUNET_ERROR_TYPE_ERROR,
        _
        ("Must specify `%s' or numeric IP address for `%s' of `%s' in 
configuration!\n"),
@@ -247,23 +249,23 @@
   GNUNET_assert (NULL == req_head);
   GNUNET_assert (NULL == req_tail);
   if (NULL != client)
-  {
+    {
 #if DEBUG_RESOLVER
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
 #endif
-    GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-    client = NULL;
-  }
+      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+      client = NULL;
+    }
   if (r_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (r_task);
-    r_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (r_task);
+      r_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   if (s_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (s_task);
-    s_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (s_task);
+      s_task = GNUNET_SCHEDULER_NO_TASK;
+    }
 }
 
 
@@ -284,37 +286,35 @@
   if (salen < sizeof (struct sockaddr))
     return NULL;
   switch (sa->sa_family)
-  {
-  case AF_INET:
-    if (salen != sizeof (struct sockaddr_in))
-      return NULL;
-    if (NULL ==
-        inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr, inet4,
-                   INET_ADDRSTRLEN))
     {
-      GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "resolver-api",
-                                "inet_ntop");
-      return NULL;
+    case AF_INET:
+      if (salen != sizeof (struct sockaddr_in))
+       return NULL;
+      if (NULL ==
+         inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr, inet4,
+                    INET_ADDRSTRLEN))
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
+         return NULL;
+       }
+      ret = GNUNET_strdup (inet4);
+      break;
+    case AF_INET6:
+      if (salen != sizeof (struct sockaddr_in6))
+       return NULL;
+      if (NULL ==
+         inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr,
+                    inet6, INET6_ADDRSTRLEN))
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
+         return NULL;
+       }
+      ret = GNUNET_strdup (inet6);
+      break;
+    default:
+      ret = NULL;
+      break;
     }
-    ret = GNUNET_strdup (inet4);
-    break;
-  case AF_INET6:
-    if (salen != sizeof (struct sockaddr_in6))
-      return NULL;
-    if (NULL ==
-        inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr, inet6,
-                   INET6_ADDRSTRLEN))
-    {
-      GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "resolver-api",
-                                "inet_ntop");
-      return NULL;
-    }
-    ret = GNUNET_strdup (inet6);
-    break;
-  default:
-    ret = NULL;
-    break;
-  }
   return ret;
 }
 
@@ -322,15 +322,13 @@
 /**
  * Adjust exponential back-off and reconnect to the service.
  */
-static void
-reconnect ();
+static void reconnect ();
 
 
 /**
  * Process pending requests to the resolver.
  */
-static void
-process_requests ();
+static void process_requests ();
 
 
 /**
@@ -352,120 +350,122 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving response from DNS service\n");
 #endif
   if (msg == NULL)
-  {
-    if (NULL != rh->name_callback)
-      LOG (GNUNET_ERROR_TYPE_INFO,
-           _("Timeout trying to resolve IP address `%s'.\n"),
-           GNUNET_a2s ((const void *) &rh[1], rh->data_len));
-    else
-      LOG (GNUNET_ERROR_TYPE_INFO,
-           _("Timeout trying to resolve hostname `%s'.\n"),
-           (const char *) &rh[1]);
-    /* check if request was canceled */
-    if (rh->was_transmitted != GNUNET_SYSERR)
     {
       if (NULL != rh->name_callback)
-      {
-        /* no reverse lookup was successful, return ip as string */
-        if (rh->received_response == GNUNET_NO)
-          rh->name_callback (rh->cls,
-                             no_resolve ((const struct sockaddr *) &rh[1],
-                                         rh->data_len));
-        /* at least one reverse lookup was successful */
-        else
-          rh->name_callback (rh->cls, NULL);
-      }
-      if (NULL != rh->addr_callback)
-        rh->addr_callback (rh->cls, NULL, 0);
+       LOG (GNUNET_ERROR_TYPE_INFO,
+            _("Timeout trying to resolve IP address `%s'.\n"),
+            GNUNET_a2s ((const void *) &rh[1], rh->data_len));
+      else
+       LOG (GNUNET_ERROR_TYPE_INFO,
+            _("Timeout trying to resolve hostname `%s'.\n"),
+            (const char *) &rh[1]);
+      /* check if request was canceled */
+      if (rh->was_transmitted != GNUNET_SYSERR)
+       {
+         if (NULL != rh->name_callback)
+           {
+             /* no reverse lookup was successful, return ip as string */
+             if (rh->received_response == GNUNET_NO)
+               rh->name_callback (rh->cls,
+                                  no_resolve ((const struct sockaddr *)
+                                              &rh[1], rh->data_len));
+             /* at least one reverse lookup was successful */
+             else
+               rh->name_callback (rh->cls, NULL);
+           }
+         if (NULL != rh->addr_callback)
+           rh->addr_callback (rh->cls, NULL, 0);
+       }
+      GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+      GNUNET_free (rh);
+      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+      client = NULL;
+      reconnect ();
+      return;
     }
-    GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
-    GNUNET_free (rh);
-    GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-    client = NULL;
-    reconnect ();
-    return;
-  }
   if (GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE != ntohs (msg->type))
-  {
-    GNUNET_break (0);
-    GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-    client = NULL;
-    reconnect ();
-    return;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+      client = NULL;
+      reconnect ();
+      return;
+    }
   size = ntohs (msg->size);
   /* message contains not data, just header */
   if (size == sizeof (struct GNUNET_MessageHeader))
-  {
-    /* check if request was canceled */
-    if (rh->was_transmitted != GNUNET_SYSERR)
     {
-      if (NULL != rh->name_callback)
-        rh->name_callback (rh->cls, NULL);
-      if (NULL != rh->addr_callback)
-        rh->addr_callback (rh->cls, NULL, 0);
-    }
-    GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
-    GNUNET_free (rh);
-    process_requests ();
-    return;
-  }
-  /* return reverse lookup results to caller */
-  if (NULL != rh->name_callback)
-  {
-    hostname = (const char *) &msg[1];
-    if (hostname[size - sizeof (struct GNUNET_MessageHeader) - 1] != '\0')
-    {
-      GNUNET_break (0);
+      /* check if request was canceled */
       if (rh->was_transmitted != GNUNET_SYSERR)
-        rh->name_callback (rh->cls, NULL);
+       {
+         if (NULL != rh->name_callback)
+           rh->name_callback (rh->cls, NULL);
+         if (NULL != rh->addr_callback)
+           rh->addr_callback (rh->cls, NULL, 0);
+       }
       GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
       GNUNET_free (rh);
-      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-      client = NULL;
-      reconnect ();
+      process_requests ();
       return;
     }
+  /* return reverse lookup results to caller */
+  if (NULL != rh->name_callback)
+    {
+      hostname = (const char *) &msg[1];
+      if (hostname[size - sizeof (struct GNUNET_MessageHeader) - 1] != '\0')
+       {
+         GNUNET_break (0);
+         if (rh->was_transmitted != GNUNET_SYSERR)
+           rh->name_callback (rh->cls, NULL);
+         GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+         GNUNET_free (rh);
+         GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+         client = NULL;
+         reconnect ();
+         return;
+       }
 #if DEBUG_RESOLVER
-    LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s' for IP `%s'.\n"),
-         hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len));
+      LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s' for IP `%s'.\n"),
+          hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len));
 #endif
-    if (rh->was_transmitted != GNUNET_SYSERR)
-      rh->name_callback (rh->cls, hostname);
-    rh->received_response = GNUNET_YES;
-    GNUNET_CLIENT_receive (client, &handle_response, rh,
-                           GNUNET_TIME_absolute_get_remaining (rh->timeout));
-  }
+      if (rh->was_transmitted != GNUNET_SYSERR)
+       rh->name_callback (rh->cls, hostname);
+      rh->received_response = GNUNET_YES;
+      GNUNET_CLIENT_receive (client, &handle_response, rh,
+                            GNUNET_TIME_absolute_get_remaining
+                            (rh->timeout));
+    }
   /* return lookup results to caller */
   if (NULL != rh->addr_callback)
-  {
-    sa = (const struct sockaddr *) &msg[1];
-    salen = size - sizeof (struct GNUNET_MessageHeader);
-    if (salen < sizeof (struct sockaddr))
     {
-      GNUNET_break (0);
-      if (rh->was_transmitted != GNUNET_SYSERR)
-        rh->addr_callback (rh->cls, NULL, 0);
-      GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
-      GNUNET_free (rh);
-      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-      client = NULL;
-      reconnect ();
-      return;
-    }
+      sa = (const struct sockaddr *) &msg[1];
+      salen = size - sizeof (struct GNUNET_MessageHeader);
+      if (salen < sizeof (struct sockaddr))
+       {
+         GNUNET_break (0);
+         if (rh->was_transmitted != GNUNET_SYSERR)
+           rh->addr_callback (rh->cls, NULL, 0);
+         GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+         GNUNET_free (rh);
+         GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+         client = NULL;
+         reconnect ();
+         return;
+       }
 #if DEBUG_RESOLVER
-    {
-      char *ips = no_resolve (sa, salen);
+      {
+       char *ips = no_resolve (sa, salen);
 
-      LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s' for `%s'.\n", ips,
-           (const char *) &rh[1]);
-      GNUNET_free (ips);
+       LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s' for `%s'.\n",
+            ips, (const char *) &rh[1]);
+       GNUNET_free (ips);
+      }
+#endif
+      rh->addr_callback (rh->cls, sa, salen);
+      GNUNET_CLIENT_receive (client, &handle_response, rh,
+                            GNUNET_TIME_absolute_get_remaining
+                            (rh->timeout));
     }
-#endif
-    rh->addr_callback (rh->cls, sa, salen);
-    GNUNET_CLIENT_receive (client, &handle_response, rh,
-                           GNUNET_TIME_absolute_get_remaining (rh->timeout));
-  }
 }
 
 
@@ -498,26 +498,27 @@
   hostname = (const char *) &rh[1];
   if (((rh->domain == AF_UNSPEC) || (rh->domain == AF_INET)) &&
       (1 == inet_pton (AF_INET, hostname, &v4.sin_addr)))
-  {
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
-    if ((rh->domain == AF_UNSPEC) &&
-        (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
     {
-      /* this can happen on some systems IF "hostname" is "localhost" */
-      rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
+      if ((rh->domain == AF_UNSPEC) &&
+         (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
+       {
+         /* this can happen on some systems IF "hostname" is "localhost" */
+         rh->addr_callback (rh->cls, (const struct sockaddr *) &v6,
+                            sizeof (v6));
+       }
+      rh->addr_callback (rh->cls, NULL, 0);
+      GNUNET_free (rh);
+      return;
     }
-    rh->addr_callback (rh->cls, NULL, 0);
-    GNUNET_free (rh);
-    return;
-  }
   if (((rh->domain == AF_UNSPEC) || (rh->domain == AF_INET6)) &&
       (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
-  {
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
-    rh->addr_callback (rh->cls, NULL, 0);
-    GNUNET_free (rh);
-    return;
-  }
+    {
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
+      rh->addr_callback (rh->cls, NULL, 0);
+      GNUNET_free (rh);
+      return;
+    }
   /* why are we here? this task should not have been scheduled! */
   GNUNET_assert (0);
   GNUNET_free (rh);
@@ -552,21 +553,21 @@
 #endif
   v6.sin6_addr = in6addr_loopback;
   switch (rh->domain)
-  {
-  case AF_INET:
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
-    break;
-  case AF_INET6:
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
-    break;
-  case AF_UNSPEC:
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
-    rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
-    break;
-  default:
-    GNUNET_break (0);
-    break;
-  }
+    {
+    case AF_INET:
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
+      break;
+    case AF_INET6:
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
+      break;
+    case AF_UNSPEC:
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
+      rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
+      break;
+    default:
+      GNUNET_break (0);
+      break;
+    }
   rh->addr_callback (rh->cls, NULL, 0);
   GNUNET_free (rh);
 }
@@ -594,25 +595,25 @@
   struct GNUNET_RESOLVER_RequestHandle *rh;
 
   if (NULL == client)
-  {
-    reconnect ();
-    return;
-  }
+    {
+      reconnect ();
+      return;
+    }
   rh = req_head;
   if (NULL == rh)
-  {
-    /* nothing to do, release socket really soon if there is nothing
-     * else happening... */
-    s_task =
-        GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
-                                      &shutdown_task, NULL);
-    return;
-  }
+    {
+      /* nothing to do, release socket really soon if there is nothing
+       * else happening... */
+      s_task =
+       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
+                                     &shutdown_task, NULL);
+      return;
+    }
   if (GNUNET_YES == rh->was_transmitted)
-    return;                     /* waiting for reply */
+    return;                    /* waiting for reply */
   msg = (struct GNUNET_RESOLVER_GetMessage *) buf;
   msg->header.size =
-      htons (sizeof (struct GNUNET_RESOLVER_GetMessage) + rh->data_len);
+    htons (sizeof (struct GNUNET_RESOLVER_GetMessage) + rh->data_len);
   msg->header.type = htons (GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST);
   msg->direction = htonl (rh->direction);
   msg->domain = htonl (rh->domain);
@@ -623,15 +624,15 @@
 #endif
   if (GNUNET_OK !=
       GNUNET_CLIENT_transmit_and_get_response (client, &msg->header,
-                                               
GNUNET_TIME_absolute_get_remaining
-                                               (rh->timeout), GNUNET_YES,
-                                               &handle_response, rh))
-  {
-    GNUNET_CLIENT_disconnect (client, GNUNET_NO);
-    client = NULL;
-    reconnect ();
-    return;
-  }
+                                              
GNUNET_TIME_absolute_get_remaining
+                                              (rh->timeout), GNUNET_YES,
+                                              &handle_response, rh))
+    {
+      GNUNET_CLIENT_disconnect (client, GNUNET_NO);
+      client = NULL;
+      reconnect ();
+      return;
+    }
   rh->was_transmitted = GNUNET_YES;
 }
 
@@ -647,7 +648,7 @@
 {
   r_task = GNUNET_SCHEDULER_NO_TASK;
   if (NULL == req_head)
-    return;                     /* no work pending */
+    return;                    /* no work pending */
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
     return;
 #if DEBUG_RESOLVER
@@ -655,11 +656,12 @@
 #endif
   client = GNUNET_CLIENT_connect ("resolver", resolver_cfg);
   if (NULL == client)
-  {
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "Failed to connect, will try again later\n");
-    reconnect ();
-    return;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Failed to connect, will try again later\n");
+      reconnect ();
+      return;
+    }
   process_requests ();
 }
 
@@ -676,26 +678,26 @@
     return;
   GNUNET_assert (NULL == client);
   if (NULL != (rh = req_head))
-  {
-    switch (rh->was_transmitted)
     {
-    case GNUNET_NO:
-      /* nothing more to do */
-      break;
-    case GNUNET_YES:
-      /* disconnected, transmit again! */
-      rh->was_transmitted = GNUNET_NO;
-      break;
-    case GNUNET_SYSERR:
-      /* request was cancelled, remove entirely */
-      GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
-      GNUNET_free (rh);
-      break;
-    default:
-      GNUNET_assert (0);
-      break;
+      switch (rh->was_transmitted)
+       {
+       case GNUNET_NO:
+         /* nothing more to do */
+         break;
+       case GNUNET_YES:
+         /* disconnected, transmit again! */
+         rh->was_transmitted = GNUNET_NO;
+         break;
+       case GNUNET_SYSERR:
+         /* request was cancelled, remove entirely */
+         GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+         GNUNET_free (rh);
+         break;
+       default:
+         GNUNET_assert (0);
+         break;
+       }
     }
-  }
 #if DEBUG_RESOLVER
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Will try to connect to DNS service in %llu ms\n",
@@ -719,9 +721,9 @@
  */
 struct GNUNET_RESOLVER_RequestHandle *
 GNUNET_RESOLVER_ip_get (const char *hostname, int domain,
-                        struct GNUNET_TIME_Relative timeout,
-                        GNUNET_RESOLVER_AddressCallback callback,
-                        void *callback_cls)
+                       struct GNUNET_TIME_Relative timeout,
+                       GNUNET_RESOLVER_AddressCallback callback,
+                       void *callback_cls)
 {
   struct GNUNET_RESOLVER_RequestHandle *rh;
   size_t slen;
@@ -732,10 +734,10 @@
   slen = strlen (hostname) + 1;
   if (slen + sizeof (struct GNUNET_RESOLVER_GetMessage) >=
       GNUNET_SERVER_MAX_MESSAGE_SIZE)
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
   rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen);
   rh->domain = domain;
   rh->addr_callback = callback;
@@ -749,25 +751,25 @@
        ((domain == AF_INET) || (domain == AF_UNSPEC))) ||
       ((1 == inet_pton (AF_INET6, hostname, &v6)) &&
        ((domain == AF_INET6) || (domain == AF_UNSPEC))))
-  {
-    rh->task = GNUNET_SCHEDULER_add_now (&numeric_resolution, rh);
-    return rh;
-  }
+    {
+      rh->task = GNUNET_SCHEDULER_add_now (&numeric_resolution, rh);
+      return rh;
+    }
   /* then, check if this is a loopback address */
   i = 0;
   while (loopback[i] != NULL)
     if (0 == strcasecmp (loopback[i++], hostname))
-    {
-      rh->task = GNUNET_SCHEDULER_add_now (&loopback_resolution, rh);
-      return rh;
-    }
+      {
+       rh->task = GNUNET_SCHEDULER_add_now (&loopback_resolution, rh);
+       return rh;
+      }
   GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh);
   rh->was_queued = GNUNET_YES;
   if (s_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (s_task);
-    s_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (s_task);
+      s_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   process_requests ();
   return rh;
 }
@@ -791,10 +793,10 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s'.\n"), result);
 #endif
   if (result != NULL)
-  {
-    rh->name_callback (rh->cls, result);
-    GNUNET_free (result);
-  }
+    {
+      rh->name_callback (rh->cls, result);
+      GNUNET_free (result);
+    }
   rh->name_callback (rh->cls, NULL);
   GNUNET_free (rh);
 }
@@ -814,10 +816,10 @@
  */
 struct GNUNET_RESOLVER_RequestHandle *
 GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen,
-                              int do_resolve,
-                              struct GNUNET_TIME_Relative timeout,
-                              GNUNET_RESOLVER_HostnameCallback callback,
-                              void *cls)
+                             int do_resolve,
+                             struct GNUNET_TIME_Relative timeout,
+                             GNUNET_RESOLVER_HostnameCallback callback,
+                             void *cls)
 {
   struct GNUNET_RESOLVER_RequestHandle *rh;
 
@@ -831,24 +833,24 @@
   rh->direction = GNUNET_YES;
   rh->received_response = GNUNET_NO;
   if (GNUNET_NO == do_resolve)
-  {
-    rh->task = GNUNET_SCHEDULER_add_now (&numeric_reverse, rh);
-    return rh;
-  }
+    {
+      rh->task = GNUNET_SCHEDULER_add_now (&numeric_reverse, rh);
+      return rh;
+    }
   if (salen + sizeof (struct GNUNET_RESOLVER_GetMessage) >=
       GNUNET_SERVER_MAX_MESSAGE_SIZE)
-  {
-    GNUNET_break (0);
-    GNUNET_free (rh);
-    return NULL;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (rh);
+      return NULL;
+    }
   GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh);
   rh->was_queued = GNUNET_YES;
   if (s_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (s_task);
-    s_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (s_task);
+      s_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   process_requests ();
   return rh;
 }
@@ -866,21 +868,21 @@
   char hostname[GNUNET_OS_get_hostname_max_length () + 1];
 
   if (0 != gethostname (hostname, sizeof (hostname) - 1))
-  {
-    GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                              "resolver-api", "gethostname");
-    return NULL;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                   "gethostname");
+      return NULL;
+    }
 #if DEBUG_RESOLVER
   LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"), hostname);
 #endif
   host = gethostbyname (hostname);
   if (NULL == host)
-  {
-    LOG (GNUNET_ERROR_TYPE_ERROR, _("Could not resolve our FQDN : %s\n"),
-         hstrerror (h_errno));
-    return NULL;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR, _("Could not resolve our FQDN : %s\n"),
+          hstrerror (h_errno));
+      return NULL;
+    }
   return GNUNET_strdup (host->h_name);
 }
 
@@ -896,18 +898,18 @@
  */
 struct GNUNET_RESOLVER_RequestHandle *
 GNUNET_RESOLVER_hostname_resolve (int domain,
-                                  struct GNUNET_TIME_Relative timeout,
-                                  GNUNET_RESOLVER_AddressCallback callback,
-                                  void *cls)
+                                 struct GNUNET_TIME_Relative timeout,
+                                 GNUNET_RESOLVER_AddressCallback callback,
+                                 void *cls)
 {
   char hostname[GNUNET_OS_get_hostname_max_length () + 1];
 
   if (0 != gethostname (hostname, sizeof (hostname) - 1))
-  {
-    GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                              "resolver-api", "gethostname");
-    return NULL;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                   "gethostname");
+      return NULL;
+    }
 #if DEBUG_RESOLVER
   LOG (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our hostname `%s'\n"), hostname);
 #endif
@@ -927,19 +929,19 @@
 GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh)
 {
   if (rh->task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (rh->task);
-    rh->task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (rh->task);
+      rh->task = GNUNET_SCHEDULER_NO_TASK;
+    }
   if (rh->was_transmitted == GNUNET_NO)
-  {
-    if (rh->was_queued == GNUNET_YES)
-      GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
-    GNUNET_free (rh);
-    return;
-  }
+    {
+      if (rh->was_queued == GNUNET_YES)
+       GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
+      GNUNET_free (rh);
+      return;
+    }
   GNUNET_assert (rh->was_transmitted == GNUNET_YES);
-  rh->was_transmitted = GNUNET_SYSERR;  /* mark as cancelled */
+  rh->was_transmitted = GNUNET_SYSERR; /* mark as cancelled */
 }
 
 

Modified: gnunet/src/util/scheduler.c
===================================================================
--- gnunet/src/util/scheduler.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/scheduler.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -34,6 +34,10 @@
 #include "execinfo.h"
 
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
 /**
  * Use lsof to generate file descriptor reports on select error?
  * (turn off for stable releases).
@@ -523,10 +527,9 @@
   while (pos != NULL)
     {
 #if DEBUG_TASKS
-      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                      "util",
-                      "Checking readiness of task: %llu / %p\n", pos->id,
-                      pos->callback_cls);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Checking readiness of task: %llu / %p\n", pos->id,
+          pos->callback_cls);
 #endif
       next = pos->next;
       if (GNUNET_YES == is_ready (pos, now, rs, ws))
@@ -656,12 +659,10 @@
       if (GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value >
          DELAY_THRESHOLD.rel_value)
        {
-         GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                          "util",
-                          "Task %llu took %llums to be scheduled\n", pos->id,
-                          (unsigned long long)
-                          GNUNET_TIME_absolute_get_duration
-                          (pos->start_time).rel_value);
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              "Task %llu took %llums to be scheduled\n", pos->id,
+              (unsigned long long)
+              GNUNET_TIME_absolute_get_duration (pos->start_time).rel_value);
        }
 #endif
       tc.reason = pos->reason;
@@ -678,20 +679,17 @@
          (!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd)))
        abort ();               // added to ready in previous select loop!
 #if DEBUG_TASKS
-      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                      "util",
-                      "Running task: %llu / %p\n", pos->id,
-                      pos->callback_cls);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Running task: %llu / %p\n", pos->id, pos->callback_cls);
 #endif
       pos->callback (pos->callback_cls, &tc);
 #if EXECINFO
       int i;
 
       for (i = 0; i < pos->num_backtrace_strings; i++)
-       GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                        "util",
-                        "Task %llu trace %d: %s\n", pos->id,
-                        i, pos->backtrace_strings[i]);
+       LOG (GNUNET_ERROR_TYPE_ERROR,
+            "Task %llu trace %d: %s\n", pos->id,
+            i, pos->backtrace_strings[i]);
 #endif
       active_task = NULL;
       destroy_task (pos);
@@ -844,8 +842,7 @@
          if (errno == EINTR)
            continue;
 
-         GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_ERROR, "util",
-                                   "select");
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "select");
 #ifndef MINGW
 #if USE_LSOF
          char lsof[512];
@@ -854,8 +851,7 @@
          (void) close (1);
          (void) dup2 (2, 1);
          if (0 != system (lsof))
-           GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "util",
-                                     "system");
+           LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "system");
 #endif
 #endif
          abort ();
@@ -863,8 +859,8 @@
        }
       if ((ret == 0) && (timeout.rel_value == 0) && (busy_wait_warning > 16))
        {
-         GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING,
-                          "util", _("Looks like we're busy waiting...\n"));
+         LOG (GNUNET_ERROR_TYPE_WARNING,
+              _("Looks like we're busy waiting...\n"));
          sleep (1);            /* mitigate */
        }
       check_ready (rs, ws);
@@ -994,10 +990,9 @@
       p++;
       if (p >= GNUNET_SCHEDULER_PRIORITY_COUNT)
        {
-         GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                          "util",
-                          _("Attempt to cancel dead task %llu!\n"),
-                          (unsigned long long) task);
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _("Attempt to cancel dead task %llu!\n"),
+              (unsigned long long) task);
          GNUNET_assert (0);
        }
       prev = NULL;
@@ -1037,9 +1032,8 @@
     }
   ret = t->callback_cls;
 #if DEBUG_TASKS
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                  "util",
-                  "Canceling task: %llu / %p\n", task, t->callback_cls);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Canceling task: %llu / %p\n", task, t->callback_cls);
 #endif
   destroy_task (t);
   return ret;
@@ -1086,10 +1080,8 @@
   t->priority = current_priority;
   t->lifeness = current_lifeness;
 #if DEBUG_TASKS
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                  "util",
-                  "Adding continuation task: %llu / %p\n",
-                  t->id, t->callback_cls);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding continuation task: %llu / %p\n", t->id, t->callback_cls);
 #endif
   queue_ready_task (t);
 }
@@ -1220,18 +1212,15 @@
   pending_timeout_last = t;
 
 #if DEBUG_TASKS
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                  "util",
-                  "Adding task: %llu / %p\n", t->id, t->callback_cls);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding task: %llu / %p\n", t->id, t->callback_cls);
 #endif
 #if EXECINFO
   int i;
 
   for (i = 0; i < t->num_backtrace_strings; i++)
-    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                    "util",
-                    "Task %llu trace %d: %s\n", t->id, i,
-                    t->backtrace_strings[i]);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "Task %llu trace %d: %s\n", t->id, i, t->backtrace_strings[i]);
 #endif
   return t->id;
 
@@ -1352,14 +1341,14 @@
 
       if ((flags == -1) && (errno == EBADF))
        {
-         GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                          "util", "Got invalid file descriptor %d!\n", rfd);
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              "Got invalid file descriptor %d!\n", rfd);
 #if EXECINFO
          int i;
 
          for (i = 0; i < t->num_backtrace_strings; i++)
-           GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                            "util", "Trace: %s\n", t->backtrace_strings[i]);
+           LOG (GNUNET_ERROR_TYPE_DEBUG,
+                "Trace: %s\n", t->backtrace_strings[i]);
 #endif
          GNUNET_assert (0);
        }
@@ -1370,14 +1359,14 @@
 
       if (flags == -1 && errno == EBADF)
        {
-         GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR,
-                          "util", "Got invalid file descriptor %d!\n", wfd);
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              "Got invalid file descriptor %d!\n", wfd);
 #if EXECINFO
          int i;
 
          for (i = 0; i < t->num_backtrace_strings; i++)
-           GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                            "util", "Trace: %s\n", t->backtrace_strings[i]);
+           LOG (GNUNET_ERROR_TYPE_DEBUG,
+                "Trace: %s\n", t->backtrace_strings[i]);
 #endif
          GNUNET_assert (0);
        }
@@ -1398,17 +1387,15 @@
   pending = t;
   max_priority_added = GNUNET_MAX (max_priority_added, t->priority);
 #if DEBUG_TASKS
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                  "util",
-                  "Adding task: %llu / %p\n", t->id, t->callback_cls);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding task: %llu / %p\n", t->id, t->callback_cls);
 #endif
 #if EXECINFO
   int i;
 
   for (i = 0; i < t->num_backtrace_strings; i++)
-    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "util",
-                    "Task %llu trace %d: %s\n", t->id, i,
-                    t->backtrace_strings[i]);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "Task %llu trace %d: %s\n", t->id, i, t->backtrace_strings[i]);
 #endif
   return t->id;
 }
@@ -1673,18 +1660,15 @@
   pending = t;
   max_priority_added = GNUNET_MAX (max_priority_added, t->priority);
 #if DEBUG_TASKS
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                  "util",
-                  "Adding task: %llu / %p\n", t->id, t->callback_cls);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding task: %llu / %p\n", t->id, t->callback_cls);
 #endif
 #if EXECINFO
   int i;
 
   for (i = 0; i < t->num_backtrace_strings; i++)
-    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
-                    "util",
-                    "Task %llu trace %d: %s\n", t->id, i,
-                    t->backtrace_strings[i]);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "Task %llu trace %d: %s\n", t->id, i, t->backtrace_strings[i]);
 #endif
   return t->id;
 }

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/server.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -33,6 +33,12 @@
 #include "gnunet_disk_lib.h"
 #include "gnunet_protocols.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 #define DEBUG_SERVER GNUNET_EXTRA_LOGGING
 
 /**
@@ -258,7 +264,8 @@
  * @param tc reason why we are running right now
  */
 static void
-process_listen_socket (void *cls, const struct GNUNET_SCHEDULER_TaskContext 
*tc)
+process_listen_socket (void *cls,
+                      const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_SERVER_Handle *server = cls;
   struct GNUNET_CONNECTION_Handle *sock;
@@ -272,46 +279,47 @@
   while (NULL != server->listen_sockets[i])
     GNUNET_NETWORK_fdset_set (r, server->listen_sockets[i++]);
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-  {
-    /* ignore shutdown, someone else will take care of it! */
-    server->listen_task =
-        GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
-                                     GNUNET_SCHEDULER_NO_TASK,
-                                     GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
-                                     &process_listen_socket, server);
-    GNUNET_NETWORK_fdset_destroy (r);
-    return;
-  }
+    {
+      /* ignore shutdown, someone else will take care of it! */
+      server->listen_task =
+       GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
+                                    GNUNET_SCHEDULER_NO_TASK,
+                                    GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
+                                    &process_listen_socket, server);
+      GNUNET_NETWORK_fdset_destroy (r);
+      return;
+    }
   i = 0;
   while (NULL != server->listen_sockets[i])
-  {
-    if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i]))
     {
-      sock =
-          GNUNET_CONNECTION_create_from_accept (server->access,
-                                                server->access_cls,
-                                                server->listen_sockets[i]);
-      if (sock != NULL)
-      {
+      if (GNUNET_NETWORK_fdset_isset
+         (tc->read_ready, server->listen_sockets[i]))
+       {
+         sock =
+           GNUNET_CONNECTION_create_from_accept (server->access,
+                                                 server->access_cls,
+                                                 server->listen_sockets[i]);
+         if (sock != NULL)
+           {
 #if DEBUG_SERVER
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Server accepted incoming connection.\n");
+             LOG (GNUNET_ERROR_TYPE_DEBUG,
+                  "Server accepted incoming connection.\n");
 #endif
-        client = GNUNET_SERVER_connect_socket (server, sock);
-        GNUNET_CONNECTION_ignore_shutdown (sock,
-                                           server->clients_ignore_shutdown);
-        /* decrement reference count, we don't keep "client" alive */
-        GNUNET_SERVER_client_drop (client);
-      }
+             client = GNUNET_SERVER_connect_socket (server, sock);
+             GNUNET_CONNECTION_ignore_shutdown (sock,
+                                                
server->clients_ignore_shutdown);
+             /* decrement reference count, we don't keep "client" alive */
+             GNUNET_SERVER_client_drop (client);
+           }
+       }
+      i++;
     }
-    i++;
-  }
   /* listen for more! */
   server->listen_task =
-      GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
-                                   GNUNET_SCHEDULER_NO_TASK,
-                                   GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
-                                   &process_listen_socket, server);
+    GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
+                                GNUNET_SCHEDULER_NO_TASK,
+                                GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
+                                &process_listen_socket, server);
   GNUNET_NETWORK_fdset_destroy (r);
 }
 
@@ -332,87 +340,87 @@
   int eno;
 
   switch (serverAddr->sa_family)
-  {
-  case AF_INET:
-    port = ntohs (((const struct sockaddr_in *) serverAddr)->sin_port);
-    break;
-  case AF_INET6:
-    port = ntohs (((const struct sockaddr_in6 *) serverAddr)->sin6_port);
-    break;
-  case AF_UNIX:
-    port = 0;
-    break;
-  default:
-    GNUNET_break (0);
-    port = 0;
-    break;
-  }
+    {
+    case AF_INET:
+      port = ntohs (((const struct sockaddr_in *) serverAddr)->sin_port);
+      break;
+    case AF_INET6:
+      port = ntohs (((const struct sockaddr_in6 *) serverAddr)->sin6_port);
+      break;
+    case AF_UNIX:
+      port = 0;
+      break;
+    default:
+      GNUNET_break (0);
+      port = 0;
+      break;
+    }
   sock = GNUNET_NETWORK_socket_create (serverAddr->sa_family, SOCK_STREAM, 0);
   if (NULL == sock)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
-    errno = 0;
-    return NULL;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket");
+      errno = 0;
+      return NULL;
+    }
   if (port != 0)
-  {
-    if (GNUNET_NETWORK_socket_setsockopt
-        (sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                           "setsockopt");
+    {
+      if (GNUNET_NETWORK_socket_setsockopt
+         (sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
+       LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                     "setsockopt");
 #ifdef IPV6_V6ONLY
-    if ((serverAddr->sa_family == AF_INET6) &&
-        (GNUNET_NETWORK_socket_setsockopt
-         (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on)) != GNUNET_OK))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                           "setsockopt");
+      if ((serverAddr->sa_family == AF_INET6) &&
+         (GNUNET_NETWORK_socket_setsockopt
+          (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof (on)) != GNUNET_OK))
+       LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                     "setsockopt");
 #endif
-  }
+    }
   /* bind the socket */
   if (GNUNET_NETWORK_socket_bind (sock, serverAddr, socklen) != GNUNET_OK)
-  {
-    eno = errno;
-    if (errno != EADDRINUSE)
     {
-      /* we don't log 'EADDRINUSE' here since an IPv4 bind may
-       * fail if we already took the port on IPv6; if both IPv4 and
-       * IPv6 binds fail, then our caller will log using the
-       * errno preserved in 'eno' */
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "bind");
-      if (port != 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _("`%s' failed for port %d (%s).\n"), "bind", port,
-                    (serverAddr->sa_family == AF_INET) ? "IPv4" : "IPv6");
-      eno = 0;
+      eno = errno;
+      if (errno != EADDRINUSE)
+       {
+         /* we don't log 'EADDRINUSE' here since an IPv4 bind may
+          * fail if we already took the port on IPv6; if both IPv4 and
+          * IPv6 binds fail, then our caller will log using the
+          * errno preserved in 'eno' */
+         LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "bind");
+         if (port != 0)
+           LOG (GNUNET_ERROR_TYPE_ERROR,
+                _("`%s' failed for port %d (%s).\n"), "bind", port,
+                (serverAddr->sa_family == AF_INET) ? "IPv4" : "IPv6");
+         eno = 0;
+       }
+      else
+       {
+         if (port != 0)
+           LOG (GNUNET_ERROR_TYPE_WARNING,
+                _("`%s' failed for port %d (%s): address already in use\n"),
+                "bind", port,
+                (serverAddr->sa_family == AF_INET) ? "IPv4" : "IPv6");
+         else if (serverAddr->sa_family == AF_UNIX)
+           LOG (GNUNET_ERROR_TYPE_WARNING,
+                _("`%s' failed for `%s': address already in use\n"), "bind",
+                ((const struct sockaddr_un *) serverAddr)->sun_path);
+
+       }
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
+      errno = eno;
+      return NULL;
     }
-    else
+  if (GNUNET_OK != GNUNET_NETWORK_socket_listen (sock, 5))
     {
-      if (port != 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                    _("`%s' failed for port %d (%s): address already in 
use\n"),
-                    "bind", port,
-                    (serverAddr->sa_family == AF_INET) ? "IPv4" : "IPv6");
-      else if (serverAddr->sa_family == AF_UNIX)
-        GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                    _("`%s' failed for `%s': address already in use\n"), 
"bind",
-                    ((const struct sockaddr_un *) serverAddr)->sun_path);
-
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "listen");
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
+      errno = 0;
+      return NULL;
     }
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
-    errno = eno;
-    return NULL;
-  }
-  if (GNUNET_OK != GNUNET_NETWORK_socket_listen (sock, 5))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "listen");
-    GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock));
-    errno = 0;
-    return NULL;
-  }
 #if DEBUG_SERVER
   if (port != 0)
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Server starts to listen on port %u.\n", port);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+        "Server starts to listen on port %u.\n", port);
 #endif
   return sock;
 }
@@ -432,10 +440,10 @@
  */
 struct GNUNET_SERVER_Handle *
 GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
-                                   void *access_cls,
-                                   struct GNUNET_NETWORK_Handle **lsocks,
-                                   struct GNUNET_TIME_Relative idle_timeout,
-                                   int require_found)
+                                  void *access_cls,
+                                  struct GNUNET_NETWORK_Handle **lsocks,
+                                  struct GNUNET_TIME_Relative idle_timeout,
+                                  int require_found)
 {
   struct GNUNET_SERVER_Handle *ret;
   struct GNUNET_NETWORK_FDSet *r;
@@ -448,18 +456,18 @@
   ret->access_cls = access_cls;
   ret->require_found = require_found;
   if (lsocks != NULL)
-  {
-    r = GNUNET_NETWORK_fdset_create ();
-    i = 0;
-    while (NULL != ret->listen_sockets[i])
-      GNUNET_NETWORK_fdset_set (r, ret->listen_sockets[i++]);
-    ret->listen_task =
-        GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
-                                     GNUNET_SCHEDULER_NO_TASK,
-                                     GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
-                                     &process_listen_socket, ret);
-    GNUNET_NETWORK_fdset_destroy (r);
-  }
+    {
+      r = GNUNET_NETWORK_fdset_create ();
+      i = 0;
+      while (NULL != ret->listen_sockets[i])
+       GNUNET_NETWORK_fdset_set (r, ret->listen_sockets[i++]);
+      ret->listen_task =
+       GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
+                                    GNUNET_SCHEDULER_NO_TASK,
+                                    GNUNET_TIME_UNIT_FOREVER_REL, r, NULL,
+                                    &process_listen_socket, ret);
+      GNUNET_NETWORK_fdset_destroy (r);
+    }
   return ret;
 }
 
@@ -479,10 +487,10 @@
  */
 struct GNUNET_SERVER_Handle *
 GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls,
-                      struct sockaddr *const *serverAddr,
-                      const socklen_t * socklen,
-                      struct GNUNET_TIME_Relative idle_timeout,
-                      int require_found)
+                     struct sockaddr *const *serverAddr,
+                     const socklen_t * socklen,
+                     struct GNUNET_TIME_Relative idle_timeout,
+                     int require_found)
 {
   struct GNUNET_NETWORK_Handle **lsocks;
   unsigned int i;
@@ -492,31 +500,32 @@
   while (serverAddr[i] != NULL)
     i++;
   if (i > 0)
-  {
-    lsocks = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_Handle *) * (i + 1));
-    i = 0;
-    j = 0;
-    while (serverAddr[i] != NULL)
     {
-      lsocks[j] = open_listen_socket (serverAddr[i], socklen[i]);
-      if (lsocks[j] != NULL)
-        j++;
-      i++;
+      lsocks =
+       GNUNET_malloc (sizeof (struct GNUNET_NETWORK_Handle *) * (i + 1));
+      i = 0;
+      j = 0;
+      while (serverAddr[i] != NULL)
+       {
+         lsocks[j] = open_listen_socket (serverAddr[i], socklen[i]);
+         if (lsocks[j] != NULL)
+           j++;
+         i++;
+       }
+      if (j == 0)
+       {
+         if (errno != 0)
+           LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "bind");
+         GNUNET_free (lsocks);
+         lsocks = NULL;
+       }
     }
-    if (j == 0)
+  else
     {
-      if (errno != 0)
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "bind");
-      GNUNET_free (lsocks);
       lsocks = NULL;
     }
-  }
-  else
-  {
-    lsocks = NULL;
-  }
   return GNUNET_SERVER_create_with_sockets (access, access_cls, lsocks,
-                                            idle_timeout, require_found);
+                                           idle_timeout, require_found);
 }
 
 
@@ -533,35 +542,35 @@
   unsigned int i;
 
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Server shutting down.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Server shutting down.\n");
 #endif
   if (GNUNET_SCHEDULER_NO_TASK != s->listen_task)
-  {
-    GNUNET_SCHEDULER_cancel (s->listen_task);
-    s->listen_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (s->listen_task);
+      s->listen_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   if (s->listen_sockets != NULL)
-  {
-    i = 0;
-    while (s->listen_sockets[i] != NULL)
-      GNUNET_break (GNUNET_OK ==
-                    GNUNET_NETWORK_socket_close (s->listen_sockets[i++]));
-    GNUNET_free (s->listen_sockets);
-    s->listen_sockets = NULL;
-  }
+    {
+      i = 0;
+      while (s->listen_sockets[i] != NULL)
+       GNUNET_break (GNUNET_OK ==
+                     GNUNET_NETWORK_socket_close (s->listen_sockets[i++]));
+      GNUNET_free (s->listen_sockets);
+      s->listen_sockets = NULL;
+    }
   while (s->clients != NULL)
     GNUNET_SERVER_client_disconnect (s->clients);
   while (NULL != (hpos = s->handlers))
-  {
-    s->handlers = hpos->next;
-    GNUNET_free (hpos);
-  }
+    {
+      s->handlers = hpos->next;
+      GNUNET_free (hpos);
+    }
   while (NULL != (npos = s->disconnect_notify_list))
-  {
-    npos->callback (npos->callback_cls, NULL);
-    s->disconnect_notify_list = npos->next;
-    GNUNET_free (npos);
-  }
+    {
+      npos->callback (npos->callback_cls, NULL);
+      s->disconnect_notify_list = npos->next;
+      GNUNET_free (npos);
+    }
   GNUNET_free (s);
 }
 
@@ -581,7 +590,8 @@
  */
 void
 GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server,
-                            const struct GNUNET_SERVER_MessageHandler 
*handlers)
+                           const struct GNUNET_SERVER_MessageHandler
+                           *handlers)
 {
   struct HandlerList *p;
 
@@ -599,21 +609,21 @@
  * @param tc scheduler context (unused)
  */
 static void
-warn_no_receive_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+warn_no_receive_done (void *cls,
+                     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_SERVER_Client *client = cls;
 
   client->warn_task =
-      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
-                                    &warn_no_receive_done, client);
+    GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+                                 &warn_no_receive_done, client);
   if (0 == (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _
-                ("Processing code for message of type %u did not call 
GNUNET_SERVER_receive_done after %llums\n"),
-                (unsigned int) client->warn_type,
-                (unsigned long long)
-                GNUNET_TIME_absolute_get_duration
-                (client->warn_start).rel_value);
+    LOG (GNUNET_ERROR_TYPE_WARNING,
+        _
+        ("Processing code for message of type %u did not call 
GNUNET_SERVER_receive_done after %llums\n"),
+        (unsigned int) client->warn_type,
+        (unsigned long long)
+        GNUNET_TIME_absolute_get_duration (client->warn_start).rel_value);
 }
 
 
@@ -625,13 +635,14 @@
  * @param client client for which to disable the warning
  */
 void
-GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client 
*client)
+GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client
+                                           *client)
 {
   if (GNUNET_SCHEDULER_NO_TASK != client->warn_task)
-  {
-    GNUNET_SCHEDULER_cancel (client->warn_task);
-    client->warn_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (client->warn_task);
+      client->warn_task = GNUNET_SCHEDULER_NO_TASK;
+    }
 }
 
 
@@ -652,8 +663,8 @@
  */
 int
 GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server,
-                      struct GNUNET_SERVER_Client *sender,
-                      const struct GNUNET_MessageHeader *message)
+                     struct GNUNET_SERVER_Client *sender,
+                     const struct GNUNET_MessageHeader *message)
 {
   struct HandlerList *pos;
   const struct GNUNET_SERVER_MessageHandler *mh;
@@ -666,56 +677,57 @@
   size = ntohs (message->size);
 #if DEBUG_SERVER
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Server schedules transmission of %u-byte message of type %u to 
client.\n",
-              size, type);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server schedules transmission of %u-byte message of type %u to 
client.\n",
+       size, type);
 #endif
   pos = server->handlers;
   found = GNUNET_NO;
   while (pos != NULL)
-  {
-    i = 0;
-    while (pos->handlers[i].callback != NULL)
     {
-      mh = &pos->handlers[i];
-      if ((mh->type == type) || (mh->type == GNUNET_MESSAGE_TYPE_ALL))
-      {
-        if ((mh->expected_size != 0) && (mh->expected_size != size))
-        {
+      i = 0;
+      while (pos->handlers[i].callback != NULL)
+       {
+         mh = &pos->handlers[i];
+         if ((mh->type == type) || (mh->type == GNUNET_MESSAGE_TYPE_ALL))
+           {
+             if ((mh->expected_size != 0) && (mh->expected_size != size))
+               {
 #if GNUNET8_NETWORK_IS_DEAD
-          GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                      "Expected %u bytes for message of type %u, got %u\n",
-                      mh->expected_size, mh->type, size);
-          GNUNET_break_op (0);
+                 LOG (GNUNET_ERROR_TYPE_WARNING,
+                      "Expected %u bytes for message of type %u, got %u\n",
+                      mh->expected_size, mh->type, size);
+                 GNUNET_break_op (0);
 #endif
-          return GNUNET_SYSERR;
-        }
-        if (sender != NULL)
-        {
-          if (0 == sender->suspended)
-          {
-            sender->warn_start = GNUNET_TIME_absolute_get ();
-            sender->warn_task =
-                GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
-                                              &warn_no_receive_done, sender);
-            sender->warn_type = type;
-          }
-          sender->suspended++;
-        }
-        mh->callback (mh->callback_cls, sender, message);
-        found = GNUNET_YES;
-      }
-      i++;
+                 return GNUNET_SYSERR;
+               }
+             if (sender != NULL)
+               {
+                 if (0 == sender->suspended)
+                   {
+                     sender->warn_start = GNUNET_TIME_absolute_get ();
+                     sender->warn_task =
+                       GNUNET_SCHEDULER_add_delayed
+                       (GNUNET_TIME_UNIT_MINUTES, &warn_no_receive_done,
+                        sender);
+                     sender->warn_type = type;
+                   }
+                 sender->suspended++;
+               }
+             mh->callback (mh->callback_cls, sender, message);
+             found = GNUNET_YES;
+           }
+         i++;
+       }
+      pos = pos->next;
     }
-    pos = pos->next;
-  }
   if (found == GNUNET_NO)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
-                "Received message of unknown type %d\n", type);
-    if (server->require_found == GNUNET_YES)
-      return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
+          "Received message of unknown type %d\n", type);
+      if (server->require_found == GNUNET_YES)
+       return GNUNET_SYSERR;
+    }
   return GNUNET_OK;
 }
 
@@ -732,7 +744,8 @@
  */
 static void
 process_incoming (void *cls, const void *buf, size_t available,
-                  const struct sockaddr *addr, socklen_t addrlen, int errCode);
+                 const struct sockaddr *addr, socklen_t addrlen,
+                 int errCode);
 
 
 /**
@@ -752,44 +765,44 @@
 process_mst (struct GNUNET_SERVER_Client *client, int ret)
 {
   while ((ret != GNUNET_SYSERR) && (client->server != NULL) &&
-         (GNUNET_YES != client->shutdown_now) && (0 == client->suspended))
-  {
-    if (ret == GNUNET_OK)
+        (GNUNET_YES != client->shutdown_now) && (0 == client->suspended))
     {
-      client->receive_pending = GNUNET_YES;
+      if (ret == GNUNET_OK)
+       {
+         client->receive_pending = GNUNET_YES;
 #if DEBUG_SERVER
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Server re-enters receive loop, timeout: %llu.\n",
-                  client->idle_timeout.rel_value);
+         LOG (GNUNET_ERROR_TYPE_DEBUG,
+              "Server re-enters receive loop, timeout: %llu.\n",
+              client->idle_timeout.rel_value);
 #endif
-      GNUNET_CONNECTION_receive (client->connection,
-                                 GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                                 client->idle_timeout, &process_incoming,
-                                 client);
-      break;
-    }
+         GNUNET_CONNECTION_receive (client->connection,
+                                    GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+                                    client->idle_timeout, &process_incoming,
+                                    client);
+         break;
+       }
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Server processes additional messages instantly.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Server processes additional messages instantly.\n");
 #endif
-    ret =
-        GNUNET_SERVER_mst_receive (client->mst, client, NULL, 0, GNUNET_NO,
-                                   GNUNET_YES);
-  }
+      ret =
+       GNUNET_SERVER_mst_receive (client->mst, client, NULL, 0, GNUNET_NO,
+                                  GNUNET_YES);
+    }
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Server leaves instant processing loop: ret = %d, server = %p, 
shutdown = %d, suspended = %u\n",
-              ret, client->server, client->shutdown_now, client->suspended);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server leaves instant processing loop: ret = %d, server = %p, shutdown 
= %d, suspended = %u\n",
+       ret, client->server, client->shutdown_now, client->suspended);
 #endif
 
   if (ret == GNUNET_NO)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Server has more data pending but is suspended.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Server has more data pending but is suspended.\n");
 #endif
-    client->receive_pending = GNUNET_SYSERR;    /* data pending */
-  }
+      client->receive_pending = GNUNET_SYSERR; /* data pending */
+    }
   if ((ret == GNUNET_SYSERR) || (GNUNET_YES == client->shutdown_now))
     GNUNET_SERVER_client_disconnect (client);
   GNUNET_SERVER_client_drop (client);
@@ -808,7 +821,7 @@
  */
 static void
 process_incoming (void *cls, const void *buf, size_t available,
-                  const struct sockaddr *addr, socklen_t addrlen, int errCode)
+                 const struct sockaddr *addr, socklen_t addrlen, int errCode)
 {
   struct GNUNET_SERVER_Client *client = cls;
   struct GNUNET_SERVER_Handle *server = client->server;
@@ -819,43 +832,44 @@
   GNUNET_assert (client->receive_pending == GNUNET_YES);
   client->receive_pending = GNUNET_NO;
   now = GNUNET_TIME_absolute_get ();
-  end = GNUNET_TIME_absolute_add (client->last_activity, client->idle_timeout);
+  end =
+    GNUNET_TIME_absolute_add (client->last_activity, client->idle_timeout);
 
   if ((buf == NULL) && (available == 0) && (addr == NULL) && (errCode == 0) &&
       (client->shutdown_now != GNUNET_YES) && (server != NULL) &&
       (GNUNET_YES == GNUNET_CONNECTION_check (client->connection)) &&
       (end.abs_value > now.abs_value))
-  {
-    /* wait longer, timeout changed (i.e. due to us sending) */
+    {
+      /* wait longer, timeout changed (i.e. due to us sending) */
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Receive time out, but no disconnect due to sending (%p)\n",
-                GNUNET_a2s (addr, addrlen));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Receive time out, but no disconnect due to sending (%p)\n",
+          GNUNET_a2s (addr, addrlen));
 #endif
-    client->receive_pending = GNUNET_YES;
-    GNUNET_CONNECTION_receive (client->connection,
-                               GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                               GNUNET_TIME_absolute_get_remaining (end),
-                               &process_incoming, client);
-    return;
-  }
-  if ((buf == NULL) || (available == 0) || (errCode != 0) || (server == NULL) 
||
-      (client->shutdown_now == GNUNET_YES) ||
-      (GNUNET_YES != GNUNET_CONNECTION_check (client->connection)))
-  {
-    /* other side closed connection, error connecting, etc. */
-    GNUNET_SERVER_client_disconnect (client);
-    return;
-  }
+      client->receive_pending = GNUNET_YES;
+      GNUNET_CONNECTION_receive (client->connection,
+                                GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+                                GNUNET_TIME_absolute_get_remaining (end),
+                                &process_incoming, client);
+      return;
+    }
+  if ((buf == NULL) || (available == 0) || (errCode != 0) || (server == NULL)
+      || (client->shutdown_now == GNUNET_YES)
+      || (GNUNET_YES != GNUNET_CONNECTION_check (client->connection)))
+    {
+      /* other side closed connection, error connecting, etc. */
+      GNUNET_SERVER_client_disconnect (client);
+      return;
+    }
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Server receives %u bytes from `%s'.\n",
-              (unsigned int) available, GNUNET_a2s (addr, addrlen));
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Server receives %u bytes from `%s'.\n",
+       (unsigned int) available, GNUNET_a2s (addr, addrlen));
 #endif
   GNUNET_SERVER_client_keep (client);
   client->last_activity = now;
   ret =
-      GNUNET_SERVER_mst_receive (client->mst, client, buf, available, 
GNUNET_NO,
-                                 GNUNET_YES);
+    GNUNET_SERVER_mst_receive (client->mst, client, buf, available, GNUNET_NO,
+                              GNUNET_YES);
   process_mst (client, ret);
 }
 
@@ -876,25 +890,26 @@
   client->restart_task = GNUNET_SCHEDULER_NO_TASK;
   if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) &&
       (GNUNET_NO == server->clients_ignore_shutdown))
-  {
-    GNUNET_SERVER_client_disconnect (client);
-    return;
-  }
+    {
+      GNUNET_SERVER_client_disconnect (client);
+      return;
+    }
   if (client->receive_pending == GNUNET_NO)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Server begins to read again from client.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Server begins to read again from client.\n");
 #endif
-    client->receive_pending = GNUNET_YES;
-    GNUNET_CONNECTION_receive (client->connection,
-                               GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                               client->idle_timeout, &process_incoming, 
client);
-    return;
-  }
+      client->receive_pending = GNUNET_YES;
+      GNUNET_CONNECTION_receive (client->connection,
+                                GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+                                client->idle_timeout, &process_incoming,
+                                client);
+      return;
+    }
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Server continues processing messages still in the buffer.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server continues processing messages still in the buffer.\n");
 #endif
   GNUNET_SERVER_client_keep (client);
   client->receive_pending = GNUNET_NO;
@@ -912,7 +927,7 @@
  */
 static void
 client_message_tokenizer_callback (void *cls, void *client,
-                                   const struct GNUNET_MessageHeader *message)
+                                  const struct GNUNET_MessageHeader *message)
 {
   struct GNUNET_SERVER_Handle *server = cls;
   struct GNUNET_SERVER_Client *sender = client;
@@ -920,9 +935,9 @@
 
 #if DEBUG_SERVER
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Tokenizer gives server message of type %u from client\n",
-              ntohs (message->type));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tokenizer gives server message of type %u from client\n",
+       ntohs (message->type));
 #endif
   sender->in_process_client_buffer = GNUNET_YES;
   ret = GNUNET_SERVER_inject (server, sender, message);
@@ -946,14 +961,14 @@
  */
 struct GNUNET_SERVER_Client *
 GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server,
-                              struct GNUNET_CONNECTION_Handle *connection)
+                             struct GNUNET_CONNECTION_Handle *connection)
 {
   struct GNUNET_SERVER_Client *client;
 
   client = GNUNET_malloc (sizeof (struct GNUNET_SERVER_Client));
   client->connection = connection;
   client->mst =
-      GNUNET_SERVER_mst_create (&client_message_tokenizer_callback, server);
+    GNUNET_SERVER_mst_create (&client_message_tokenizer_callback, server);
   client->reference_count = 1;
   client->server = server;
   client->last_activity = GNUNET_TIME_absolute_get ();
@@ -964,8 +979,8 @@
   client->callback = NULL;
   client->callback_cls = NULL;
   GNUNET_CONNECTION_receive (client->connection,
-                             GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                             client->idle_timeout, &process_incoming, client);
+                            GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+                            client->idle_timeout, &process_incoming, client);
   return client;
 }
 
@@ -980,7 +995,7 @@
  */
 void
 GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client,
-                                  struct GNUNET_TIME_Relative timeout)
+                                 struct GNUNET_TIME_Relative timeout)
 {
   client->idle_timeout = timeout;
 }
@@ -1028,7 +1043,7 @@
  */
 int
 GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client,
-                                  void **addr, size_t * addrlen)
+                                 void **addr, size_t * addrlen)
 {
   return GNUNET_CONNECTION_get_address (client->connection, addr, addrlen);
 }
@@ -1046,8 +1061,8 @@
  */
 void
 GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server,
-                                 GNUNET_SERVER_DisconnectCallback callback,
-                                 void *callback_cls)
+                                GNUNET_SERVER_DisconnectCallback callback,
+                                void *callback_cls)
 {
   struct NotifyList *n;
 
@@ -1068,8 +1083,8 @@
  */
 void
 GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server,
-                                        GNUNET_SERVER_DisconnectCallback
-                                        callback, void *callback_cls)
+                                       GNUNET_SERVER_DisconnectCallback
+                                       callback, void *callback_cls)
 {
   struct NotifyList *pos;
   struct NotifyList *prev;
@@ -1077,17 +1092,17 @@
   prev = NULL;
   pos = server->disconnect_notify_list;
   while (pos != NULL)
-  {
-    if ((pos->callback == callback) && (pos->callback_cls == callback_cls))
-      break;
-    prev = pos;
-    pos = pos->next;
-  }
+    {
+      if ((pos->callback == callback) && (pos->callback_cls == callback_cls))
+       break;
+      prev = pos;
+      pos = pos->next;
+    }
   if (pos == NULL)
-  {
-    GNUNET_break (0);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      return;
+    }
   if (prev == NULL)
     server->disconnect_notify_list = pos->next;
   else
@@ -1114,76 +1129,76 @@
   unsigned int rc;
 
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Client is being disconnected from the server.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Client is being disconnected from the server.\n");
 #endif
   if (client->restart_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (client->restart_task);
-    client->restart_task = GNUNET_SCHEDULER_NO_TASK;
-  }
-  if (client->warn_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel (client->warn_task);
-    client->warn_task = GNUNET_SCHEDULER_NO_TASK;
-  }
-  if (GNUNET_YES == client->receive_pending)
-  {
-    GNUNET_CONNECTION_receive_cancel (client->connection);
-    client->receive_pending = GNUNET_NO;
-  }
-
-  rc = client->reference_count;
-  if (client->server != NULL)
-  {
-    server = client->server;
-    client->server = NULL;
-    client->shutdown_now = GNUNET_YES;
-    prev = NULL;
-    pos = server->clients;
-    while ((pos != NULL) && (pos != client))
     {
-      prev = pos;
-      pos = pos->next;
-    }
-    GNUNET_assert (pos != NULL);
-    if (prev == NULL)
-      server->clients = pos->next;
-    else
-      prev->next = pos->next;
-    if (client->restart_task != GNUNET_SCHEDULER_NO_TASK)
-    {
       GNUNET_SCHEDULER_cancel (client->restart_task);
       client->restart_task = GNUNET_SCHEDULER_NO_TASK;
     }
-    if (client->warn_task != GNUNET_SCHEDULER_NO_TASK)
+  if (client->warn_task != GNUNET_SCHEDULER_NO_TASK)
     {
       GNUNET_SCHEDULER_cancel (client->warn_task);
       client->warn_task = GNUNET_SCHEDULER_NO_TASK;
     }
-    n = server->disconnect_notify_list;
-    while (n != NULL)
+  if (GNUNET_YES == client->receive_pending)
     {
-      n->callback (n->callback_cls, client);
-      n = n->next;
+      GNUNET_CONNECTION_receive_cancel (client->connection);
+      client->receive_pending = GNUNET_NO;
     }
-  }
+
+  rc = client->reference_count;
+  if (client->server != NULL)
+    {
+      server = client->server;
+      client->server = NULL;
+      client->shutdown_now = GNUNET_YES;
+      prev = NULL;
+      pos = server->clients;
+      while ((pos != NULL) && (pos != client))
+       {
+         prev = pos;
+         pos = pos->next;
+       }
+      GNUNET_assert (pos != NULL);
+      if (prev == NULL)
+       server->clients = pos->next;
+      else
+       prev->next = pos->next;
+      if (client->restart_task != GNUNET_SCHEDULER_NO_TASK)
+       {
+         GNUNET_SCHEDULER_cancel (client->restart_task);
+         client->restart_task = GNUNET_SCHEDULER_NO_TASK;
+       }
+      if (client->warn_task != GNUNET_SCHEDULER_NO_TASK)
+       {
+         GNUNET_SCHEDULER_cancel (client->warn_task);
+         client->warn_task = GNUNET_SCHEDULER_NO_TASK;
+       }
+      n = server->disconnect_notify_list;
+      while (n != NULL)
+       {
+         n->callback (n->callback_cls, client);
+         n = n->next;
+       }
+    }
   if (rc > 0)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "RC still positive, not destroying everything.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "RC still positive, not destroying everything.\n");
 #endif
-    return;
-  }
+      return;
+    }
   if (client->in_process_client_buffer == GNUNET_YES)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Still processing inputs, not destroying everything.\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Still processing inputs, not destroying everything.\n");
 #endif
-    return;
-  }
+      return;
+    }
 
   if (client->persist == GNUNET_YES)
     GNUNET_CONNECTION_persist_ (client->connection);
@@ -1247,17 +1262,17 @@
  */
 struct GNUNET_CONNECTION_TransmitHandle *
 GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client,
-                                     size_t size,
-                                     struct GNUNET_TIME_Relative timeout,
-                                     GNUNET_CONNECTION_TransmitReadyNotify
-                                     callback, void *callback_cls)
+                                    size_t size,
+                                    struct GNUNET_TIME_Relative timeout,
+                                    GNUNET_CONNECTION_TransmitReadyNotify
+                                    callback, void *callback_cls)
 {
   client->callback_cls = callback_cls;
   client->callback = callback;
   return GNUNET_CONNECTION_notify_transmit_ready (client->connection, size,
-                                                  timeout,
-                                                  
&transmit_ready_callback_wrapper,
-                                                  client);
+                                                 timeout,
+                                                 
&transmit_ready_callback_wrapper,
+                                                 client);
 }
 
 
@@ -1294,46 +1309,47 @@
   GNUNET_assert (client->suspended > 0);
   client->suspended--;
   if (success != GNUNET_OK)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "GNUNET_SERVER_receive_done called with failure indication\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "GNUNET_SERVER_receive_done called with failure indication\n");
 #endif
-    GNUNET_SERVER_client_disconnect (client);
-    return;
-  }
+      GNUNET_SERVER_client_disconnect (client);
+      return;
+    }
   if (client->suspended > 0)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "GNUNET_SERVER_receive_done called, but more clients 
pending\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "GNUNET_SERVER_receive_done called, but more clients pending\n");
 #endif
-    return;
-  }
+      return;
+    }
   if (GNUNET_SCHEDULER_NO_TASK != client->warn_task)
-  {
-    GNUNET_SCHEDULER_cancel (client->warn_task);
-    client->warn_task = GNUNET_SCHEDULER_NO_TASK;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (client->warn_task);
+      client->warn_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   if (client->in_process_client_buffer == GNUNET_YES)
-  {
+    {
 #if DEBUG_SERVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "GNUNET_SERVER_receive_done called while still in processing 
loop\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "GNUNET_SERVER_receive_done called while still in processing 
loop\n");
 #endif
-    return;
-  }
+      return;
+    }
   if (client->server == NULL)
-  {
-    GNUNET_SERVER_client_disconnect (client);
-    return;
-  }
+    {
+      GNUNET_SERVER_client_disconnect (client);
+      return;
+    }
 #if DEBUG_SERVER
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "GNUNET_SERVER_receive_done causes restart in reading from the 
socket\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "GNUNET_SERVER_receive_done causes restart in reading from the 
socket\n");
 #endif
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == client->restart_task);
-  client->restart_task = GNUNET_SCHEDULER_add_now (&restart_processing, 
client);
+  client->restart_task =
+    GNUNET_SCHEDULER_add_now (&restart_processing, client);
 }
 
 

Modified: gnunet/src/util/server_mst.c
===================================================================
--- gnunet/src/util/server_mst.c        2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/server_mst.c        2011-10-11 09:43:04 UTC (rev 17362)
@@ -39,7 +39,9 @@
 #define ALIGN_FACTOR 8
 #endif
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+
 /**
  * Handle to a message stream tokenizer.
  */
@@ -89,7 +91,7 @@
  */
 struct GNUNET_SERVER_MessageStreamTokenizer *
 GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
-                          void *cb_cls)
+                         void *cb_cls)
 {
   struct GNUNET_SERVER_MessageStreamTokenizer *ret;
 
@@ -119,8 +121,8 @@
  */
 int
 GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
-                           void *client_identity, const char *buf, size_t size,
-                           int purge, int one_shot)
+                          void *client_identity, const char *buf,
+                          size_t size, int purge, int one_shot)
 {
   const struct GNUNET_MessageHeader *hdr;
   size_t delta;
@@ -131,161 +133,161 @@
   int ret;
 
 #if DEBUG_SERVER_MST
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Server-mst receives %u bytes with %u bytes already in private 
buffer\n",
-              (unsigned int) size, (unsigned int) (mst->pos - mst->off));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server-mst receives %u bytes with %u bytes already in private 
buffer\n",
+       (unsigned int) size, (unsigned int) (mst->pos - mst->off));
 #endif
   ret = GNUNET_OK;
   ibuf = (char *) mst->hdr;
   while (mst->pos > 0)
-  {
-do_align:
-    if ((mst->curr_buf - mst->off < sizeof (struct GNUNET_MessageHeader)) ||
-        (0 != (mst->off % ALIGN_FACTOR)))
     {
-      /* need to align or need more space */
-      mst->pos -= mst->off;
-      memmove (ibuf, &ibuf[mst->off], mst->pos);
-      mst->off = 0;
-    }
-    if (mst->pos - mst->off < sizeof (struct GNUNET_MessageHeader))
-    {
-      delta =
-          GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) -
-                      (mst->pos - mst->off), size);
-      memcpy (&ibuf[mst->pos], buf, delta);
-      mst->pos += delta;
-      buf += delta;
-      size -= delta;
-    }
-    if (mst->pos - mst->off < sizeof (struct GNUNET_MessageHeader))
-    {
-      if (purge)
-      {
-        mst->off = 0;
-        mst->pos = 0;
-      }
-      return GNUNET_OK;
-    }
-    hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off];
-    want = ntohs (hdr->size);
-    if (want < sizeof (struct GNUNET_MessageHeader))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    if (mst->curr_buf - mst->off < want)
-    {
-      /* need more space */
-      mst->pos -= mst->off;
-      memmove (ibuf, &ibuf[mst->off], mst->pos);
-      mst->off = 0;
-    }
-    if (want > mst->curr_buf)
-    {
-      mst->hdr = GNUNET_realloc (mst->hdr, want);
-      ibuf = (char *) mst->hdr;
-      mst->curr_buf = want;
-    }
-    hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off];
-    if (mst->pos - mst->off < want)
-    {
-      delta = GNUNET_MIN (want - (mst->pos - mst->off), size);
-      memcpy (&ibuf[mst->pos], buf, delta);
-      mst->pos += delta;
-      buf += delta;
-      size -= delta;
-    }
-    if (mst->pos - mst->off < want)
-    {
-      if (purge)
-      {
-        mst->off = 0;
-        mst->pos = 0;
-      }
-      return GNUNET_OK;
-    }
-    if (one_shot == GNUNET_SYSERR)
-    {
-      /* cannot call callback again, but return value saying that
-       * we have another full message in the buffer */
-      ret = GNUNET_NO;
-      goto copy;
-    }
-    if (one_shot == GNUNET_YES)
-      one_shot = GNUNET_SYSERR;
-    mst->cb (mst->cb_cls, client_identity, hdr);
-    mst->off += want;
-    if (mst->off == mst->pos)
-    {
-      /* reset to beginning of buffer, it's free right now! */
-      mst->off = 0;
-      mst->pos = 0;
-    }
-  }
-  while (size > 0)
-  {
-#if DEBUG_SERVER_MST
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Server-mst has %u bytes left in inbound buffer\n",
-                (unsigned int) size);
-#endif
-    if (size < sizeof (struct GNUNET_MessageHeader))
-      break;
-    offset = (unsigned long) buf;
-    need_align = (0 != offset % ALIGN_FACTOR) ? GNUNET_YES : GNUNET_NO;
-    if (GNUNET_NO == need_align)
-    {
-      /* can try to do zero-copy and process directly from original buffer */
-      hdr = (const struct GNUNET_MessageHeader *) buf;
+    do_align:
+      if ((mst->curr_buf - mst->off < sizeof (struct GNUNET_MessageHeader)) ||
+         (0 != (mst->off % ALIGN_FACTOR)))
+       {
+         /* need to align or need more space */
+         mst->pos -= mst->off;
+         memmove (ibuf, &ibuf[mst->off], mst->pos);
+         mst->off = 0;
+       }
+      if (mst->pos - mst->off < sizeof (struct GNUNET_MessageHeader))
+       {
+         delta =
+           GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) -
+                       (mst->pos - mst->off), size);
+         memcpy (&ibuf[mst->pos], buf, delta);
+         mst->pos += delta;
+         buf += delta;
+         size -= delta;
+       }
+      if (mst->pos - mst->off < sizeof (struct GNUNET_MessageHeader))
+       {
+         if (purge)
+           {
+             mst->off = 0;
+             mst->pos = 0;
+           }
+         return GNUNET_OK;
+       }
+      hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off];
       want = ntohs (hdr->size);
       if (want < sizeof (struct GNUNET_MessageHeader))
-      {
-        GNUNET_break_op (0);
-        mst->off = 0;
-        return GNUNET_SYSERR;
-      }
-      if (size < want)
-        break;                  /* or not, buffer incomplete, so copy to 
private buffer... */
+       {
+         GNUNET_break_op (0);
+         return GNUNET_SYSERR;
+       }
+      if (mst->curr_buf - mst->off < want)
+       {
+         /* need more space */
+         mst->pos -= mst->off;
+         memmove (ibuf, &ibuf[mst->off], mst->pos);
+         mst->off = 0;
+       }
+      if (want > mst->curr_buf)
+       {
+         mst->hdr = GNUNET_realloc (mst->hdr, want);
+         ibuf = (char *) mst->hdr;
+         mst->curr_buf = want;
+       }
+      hdr = (const struct GNUNET_MessageHeader *) &ibuf[mst->off];
+      if (mst->pos - mst->off < want)
+       {
+         delta = GNUNET_MIN (want - (mst->pos - mst->off), size);
+         memcpy (&ibuf[mst->pos], buf, delta);
+         mst->pos += delta;
+         buf += delta;
+         size -= delta;
+       }
+      if (mst->pos - mst->off < want)
+       {
+         if (purge)
+           {
+             mst->off = 0;
+             mst->pos = 0;
+           }
+         return GNUNET_OK;
+       }
       if (one_shot == GNUNET_SYSERR)
-      {
-        /* cannot call callback again, but return value saying that
-         * we have another full message in the buffer */
-        ret = GNUNET_NO;
-        goto copy;
-      }
+       {
+         /* cannot call callback again, but return value saying that
+          * we have another full message in the buffer */
+         ret = GNUNET_NO;
+         goto copy;
+       }
       if (one_shot == GNUNET_YES)
-        one_shot = GNUNET_SYSERR;
+       one_shot = GNUNET_SYSERR;
       mst->cb (mst->cb_cls, client_identity, hdr);
-      buf += want;
-      size -= want;
+      mst->off += want;
+      if (mst->off == mst->pos)
+       {
+         /* reset to beginning of buffer, it's free right now! */
+         mst->off = 0;
+         mst->pos = 0;
+       }
     }
-    else
+  while (size > 0)
     {
-      /* need to copy to private buffer to align;
-       * yes, we go a bit more spagetti than usual here */
-      goto do_align;
+#if DEBUG_SERVER_MST
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Server-mst has %u bytes left in inbound buffer\n",
+          (unsigned int) size);
+#endif
+      if (size < sizeof (struct GNUNET_MessageHeader))
+       break;
+      offset = (unsigned long) buf;
+      need_align = (0 != offset % ALIGN_FACTOR) ? GNUNET_YES : GNUNET_NO;
+      if (GNUNET_NO == need_align)
+       {
+         /* can try to do zero-copy and process directly from original buffer 
*/
+         hdr = (const struct GNUNET_MessageHeader *) buf;
+         want = ntohs (hdr->size);
+         if (want < sizeof (struct GNUNET_MessageHeader))
+           {
+             GNUNET_break_op (0);
+             mst->off = 0;
+             return GNUNET_SYSERR;
+           }
+         if (size < want)
+           break;              /* or not, buffer incomplete, so copy to 
private buffer... */
+         if (one_shot == GNUNET_SYSERR)
+           {
+             /* cannot call callback again, but return value saying that
+              * we have another full message in the buffer */
+             ret = GNUNET_NO;
+             goto copy;
+           }
+         if (one_shot == GNUNET_YES)
+           one_shot = GNUNET_SYSERR;
+         mst->cb (mst->cb_cls, client_identity, hdr);
+         buf += want;
+         size -= want;
+       }
+      else
+       {
+         /* need to copy to private buffer to align;
+          * yes, we go a bit more spagetti than usual here */
+         goto do_align;
+       }
     }
-  }
 copy:
   if ((size > 0) && (!purge))
-  {
-    if (size + mst->pos > mst->curr_buf)
     {
-      mst->hdr = GNUNET_realloc (mst->hdr, size + mst->pos);
-      ibuf = (char *) mst->hdr;
-      mst->curr_buf = size + mst->pos;
+      if (size + mst->pos > mst->curr_buf)
+       {
+         mst->hdr = GNUNET_realloc (mst->hdr, size + mst->pos);
+         ibuf = (char *) mst->hdr;
+         mst->curr_buf = size + mst->pos;
+       }
+      GNUNET_assert (mst->pos + size <= mst->curr_buf);
+      memcpy (&ibuf[mst->pos], buf, size);
+      mst->pos += size;
     }
-    GNUNET_assert (mst->pos + size <= mst->curr_buf);
-    memcpy (&ibuf[mst->pos], buf, size);
-    mst->pos += size;
-  }
   if (purge)
     mst->off = 0;
 #if DEBUG_SERVER_MST
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Server-mst leaves %u bytes in private buffer\n",
-              (unsigned int) (mst->pos - mst->off));
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server-mst leaves %u bytes in private buffer\n",
+       (unsigned int) (mst->pos - mst->off));
 #endif
   return ret;
 }

Modified: gnunet/src/util/server_nc.c
===================================================================
--- gnunet/src/util/server_nc.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/server_nc.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -33,7 +33,9 @@
 #include "gnunet_server_lib.h"
 #include "gnunet_time_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+
 #define DEBUG_SERVER_NC GNUNET_EXTRA_LOGGING
 
 /**
@@ -154,40 +156,40 @@
   struct PendingMessageList *pml;
 
   if (client == NULL)
-  {
-    nc->server = NULL;
-    return;
-  }
+    {
+      nc->server = NULL;
+      return;
+    }
   prev = NULL;
   pos = nc->clients;
   while (NULL != pos)
-  {
-    if (pos->client == client)
-      break;
-    prev = pos;
-    pos = pos->next;
-  }
+    {
+      if (pos->client == client)
+       break;
+      prev = pos;
+      pos = pos->next;
+    }
   if (pos == NULL)
     return;
 #if DEBUG_SERVER_NC
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Client disconnected, cleaning up %u messages in NC queue\n",
-              pos->num_pending);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Client disconnected, cleaning up %u messages in NC queue\n",
+       pos->num_pending);
 #endif
   if (prev == NULL)
     nc->clients = pos->next;
   else
     prev->next = pos->next;
   while (NULL != (pml = pos->pending_head))
-  {
-    GNUNET_CONTAINER_DLL_remove (pos->pending_head, pos->pending_tail, pml);
-    GNUNET_free (pml);
-  }
+    {
+      GNUNET_CONTAINER_DLL_remove (pos->pending_head, pos->pending_tail, pml);
+      GNUNET_free (pml);
+    }
   if (pos->th != NULL)
-  {
-    GNUNET_CONNECTION_notify_transmit_ready_cancel (pos->th);
-    pos->th = NULL;
-  }
+    {
+      GNUNET_CONNECTION_notify_transmit_ready_cancel (pos->th);
+      pos->th = NULL;
+    }
   GNUNET_SERVER_client_drop (client);
   GNUNET_free (pos);
 }
@@ -203,8 +205,8 @@
  * @return handle to the notification context
  */
 struct GNUNET_SERVER_NotificationContext *
-GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server,
-                                           unsigned int queue_length)
+GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle
+                                          *server, unsigned int queue_length)
 {
   struct GNUNET_SERVER_NotificationContext *ret;
 
@@ -223,26 +225,27 @@
  */
 void
 GNUNET_SERVER_notification_context_destroy (struct
-                                            GNUNET_SERVER_NotificationContext
-                                            *nc)
+                                           GNUNET_SERVER_NotificationContext
+                                           *nc)
 {
   struct ClientList *pos;
   struct PendingMessageList *pml;
 
   while (NULL != (pos = nc->clients))
-  {
-    nc->clients = pos->next;
-    GNUNET_SERVER_client_drop (pos->client);
-    while (NULL != (pml = pos->pending_head))
     {
-      GNUNET_CONTAINER_DLL_remove (pos->pending_head, pos->pending_tail, pml);
-      GNUNET_free (pml);
+      nc->clients = pos->next;
+      GNUNET_SERVER_client_drop (pos->client);
+      while (NULL != (pml = pos->pending_head))
+       {
+         GNUNET_CONTAINER_DLL_remove (pos->pending_head, pos->pending_tail,
+                                      pml);
+         GNUNET_free (pml);
+       }
+      GNUNET_free (pos);
     }
-    GNUNET_free (pos);
-  }
   if (nc->server != NULL)
     GNUNET_SERVER_disconnect_notify_cancel (nc->server,
-                                            &handle_client_disconnect, nc);
+                                           &handle_client_disconnect, nc);
   GNUNET_free (nc);
 }
 
@@ -254,9 +257,9 @@
  * @param client client to add
  */
 void
-GNUNET_SERVER_notification_context_add (struct 
GNUNET_SERVER_NotificationContext
-                                        *nc,
-                                        struct GNUNET_SERVER_Client *client)
+GNUNET_SERVER_notification_context_add (struct
+                                       GNUNET_SERVER_NotificationContext *nc,
+                                       struct GNUNET_SERVER_Client *client)
 {
   struct ClientList *cl;
 
@@ -290,44 +293,45 @@
 
   cl->th = NULL;
   if (buf == NULL)
-  {
-    /* 'cl' should be freed via disconnect notification shortly */
+    {
+      /* 'cl' should be freed via disconnect notification shortly */
 #if DEBUG_SERVER_NC
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Failed to transmit message from NC queue to client\n");
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Failed to transmit message from NC queue to client\n");
 #endif
-    return 0;
-  }
+      return 0;
+    }
   ret = 0;
   while (NULL != (pml = cl->pending_head))
-  {
-    msize = ntohs (pml->msg->size);
-    if (size < msize)
-      break;
-    GNUNET_CONTAINER_DLL_remove (cl->pending_head, cl->pending_tail, pml);
+    {
+      msize = ntohs (pml->msg->size);
+      if (size < msize)
+       break;
+      GNUNET_CONTAINER_DLL_remove (cl->pending_head, cl->pending_tail, pml);
 #if DEBUG_SERVER_NC
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Copying message of type %u and size %u from pending queue to 
transmission buffer\n",
-                ntohs (pml->msg->type), msize);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Copying message of type %u and size %u from pending queue to 
transmission buffer\n",
+          ntohs (pml->msg->type), msize);
 #endif
-    memcpy (&cbuf[ret], pml->msg, msize);
-    ret += msize;
-    size -= msize;
-    GNUNET_free (pml);
-    cl->num_pending--;
-  }
+      memcpy (&cbuf[ret], pml->msg, msize);
+      ret += msize;
+      size -= msize;
+      GNUNET_free (pml);
+      cl->num_pending--;
+    }
   if (pml != NULL)
-  {
+    {
 #if DEBUG_SERVER_NC
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Have %u messages left in NC queue, will try transmission 
again\n",
-                cl->num_pending);
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Have %u messages left in NC queue, will try transmission again\n",
+          cl->num_pending);
 #endif
-    cl->th =
-        GNUNET_SERVER_notify_transmit_ready (cl->client, ntohs 
(pml->msg->size),
-                                             GNUNET_TIME_UNIT_FOREVER_REL,
-                                             &transmit_message, cl);
-  }
+      cl->th =
+       GNUNET_SERVER_notify_transmit_ready (cl->client,
+                                            ntohs (pml->msg->size),
+                                            GNUNET_TIME_UNIT_FOREVER_REL,
+                                            &transmit_message, cl);
+    }
   else
     GNUNET_assert (cl->num_pending == 0);
   return ret;
@@ -344,47 +348,46 @@
  */
 static void
 do_unicast (struct GNUNET_SERVER_NotificationContext *nc,
-            struct ClientList *client, const struct GNUNET_MessageHeader *msg,
-            int can_drop)
+           struct ClientList *client, const struct GNUNET_MessageHeader *msg,
+           int can_drop)
 {
   struct PendingMessageList *pml;
   uint16_t size;
 
   if ((client->num_pending > nc->queue_length) && (GNUNET_YES == can_drop))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Dropping message of type %u and size %u due to full queue (%u 
entries)\n",
-                ntohs (msg->type), ntohs (msg->size),
-                (unsigned int) nc->queue_length);
-    return;                     /* drop! */
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          "Dropping message of type %u and size %u due to full queue (%u 
entries)\n",
+          ntohs (msg->type), ntohs (msg->size),
+          (unsigned int) nc->queue_length);
+      return;                  /* drop! */
+    }
   if (client->num_pending > nc->queue_length)
-  {
-    /* FIXME: consider checking for other messages in the
-     * queue that are 'droppable' */
-  }
+    {
+      /* FIXME: consider checking for other messages in the
+       * queue that are 'droppable' */
+    }
   client->num_pending++;
   size = ntohs (msg->size);
   pml = GNUNET_malloc (sizeof (struct PendingMessageList) + size);
   pml->msg = (const struct GNUNET_MessageHeader *) &pml[1];
   pml->can_drop = can_drop;
 #if DEBUG_SERVER_NC
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Adding message of type %u and size %u to pending queue (which 
has %u entries)\n",
-              ntohs (msg->type), ntohs (msg->size),
-              (unsigned int) nc->queue_length);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Adding message of type %u and size %u to pending queue (which has %u 
entries)\n",
+       ntohs (msg->type), ntohs (msg->size), (unsigned int) nc->queue_length);
 #endif
   memcpy (&pml[1], msg, size);
   /* append */
-  GNUNET_CONTAINER_DLL_insert_tail (client->pending_head, client->pending_tail,
-                                    pml);
+  GNUNET_CONTAINER_DLL_insert_tail (client->pending_head,
+                                   client->pending_tail, pml);
   if (client->th == NULL)
     client->th =
-        GNUNET_SERVER_notify_transmit_ready (client->client,
-                                             ntohs (client->pending_head->
-                                                    msg->size),
-                                             GNUNET_TIME_UNIT_FOREVER_REL,
-                                             &transmit_message, client);
+      GNUNET_SERVER_notify_transmit_ready (client->client,
+                                          ntohs (client->pending_head->
+                                                 msg->size),
+                                          GNUNET_TIME_UNIT_FOREVER_REL,
+                                          &transmit_message, client);
 }
 
 
@@ -399,21 +402,22 @@
  */
 void
 GNUNET_SERVER_notification_context_unicast (struct
-                                            GNUNET_SERVER_NotificationContext
-                                            *nc,
-                                            struct GNUNET_SERVER_Client 
*client,
-                                            const struct GNUNET_MessageHeader
-                                            *msg, int can_drop)
+                                           GNUNET_SERVER_NotificationContext
+                                           *nc,
+                                           struct GNUNET_SERVER_Client
+                                           *client,
+                                           const struct GNUNET_MessageHeader
+                                           *msg, int can_drop)
 {
   struct ClientList *pos;
 
   pos = nc->clients;
   while (NULL != pos)
-  {
-    if (pos->client == client)
-      break;
-    pos = pos->next;
-  }
+    {
+      if (pos->client == client)
+       break;
+      pos = pos->next;
+    }
   GNUNET_assert (pos != NULL);
   do_unicast (nc, pos, msg, can_drop);
 }
@@ -428,19 +432,20 @@
  */
 void
 GNUNET_SERVER_notification_context_broadcast (struct
-                                              GNUNET_SERVER_NotificationContext
-                                              *nc,
-                                              const struct GNUNET_MessageHeader
-                                              *msg, int can_drop)
+                                             GNUNET_SERVER_NotificationContext
+                                             *nc,
+                                             const struct
+                                             GNUNET_MessageHeader *msg,
+                                             int can_drop)
 {
   struct ClientList *pos;
 
   pos = nc->clients;
   while (NULL != pos)
-  {
-    do_unicast (nc, pos, msg, can_drop);
-    pos = pos->next;
-  }
+    {
+      do_unicast (nc, pos, msg, can_drop);
+      pos = pos->next;
+    }
 }
 
 

Modified: gnunet/src/util/server_tc.c
===================================================================
--- gnunet/src/util/server_tc.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/server_tc.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -33,7 +33,9 @@
 #include "gnunet_time_lib.h"
 
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+
 /**
  * How much buffer space do we want to have at least
  * before transmitting another increment?
@@ -81,10 +83,10 @@
   size_t msize;
 
   if (buf == NULL)
-  {
-    GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
-    return 0;
-  }
+    {
+      GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
+      return 0;
+    }
   if (tc->total - tc->off > size)
     msize = size;
   else
@@ -92,27 +94,28 @@
   memcpy (buf, &tc->buf[tc->off], msize);
   tc->off += msize;
   if (tc->total == tc->off)
-  {
+    {
 
-    GNUNET_SERVER_receive_done (tc->client, GNUNET_OK);
-    GNUNET_SERVER_client_drop (tc->client);
-    GNUNET_free_non_null (tc->buf);
-    GNUNET_free (tc);
-  }
+      GNUNET_SERVER_receive_done (tc->client, GNUNET_OK);
+      GNUNET_SERVER_client_drop (tc->client);
+      GNUNET_free_non_null (tc->buf);
+      GNUNET_free (tc);
+    }
   else
-  {
-    if (NULL ==
-        GNUNET_SERVER_notify_transmit_ready (tc->client,
-                                             GNUNET_MIN (MIN_BLOCK_SIZE,
-                                                         tc->total - tc->off),
-                                             GNUNET_TIME_absolute_get_remaining
-                                             (tc->timeout), &transmit_response,
-                                             tc))
     {
-      GNUNET_break (0);
-      GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
+      if (NULL ==
+         GNUNET_SERVER_notify_transmit_ready (tc->client,
+                                              GNUNET_MIN (MIN_BLOCK_SIZE,
+                                                          tc->total -
+                                                          tc->off),
+                                              
GNUNET_TIME_absolute_get_remaining
+                                              (tc->timeout),
+                                              &transmit_response, tc))
+       {
+         GNUNET_break (0);
+         GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
+       }
     }
-  }
   return msize;
 }
 
@@ -148,9 +151,10 @@
  * @param type type of the message
  */
 void
-GNUNET_SERVER_transmit_context_append_data (struct 
GNUNET_SERVER_TransmitContext
-                                            *tc, const void *data,
-                                            size_t length, uint16_t type)
+GNUNET_SERVER_transmit_context_append_data (struct
+                                           GNUNET_SERVER_TransmitContext *tc,
+                                           const void *data, size_t length,
+                                           uint16_t type)
 {
   struct GNUNET_MessageHeader *msg;
   size_t size;
@@ -177,10 +181,10 @@
  */
 void
 GNUNET_SERVER_transmit_context_append_message (struct
-                                               GNUNET_SERVER_TransmitContext
-                                               *tc,
-                                               const struct 
GNUNET_MessageHeader
-                                               *msg)
+                                              GNUNET_SERVER_TransmitContext
+                                              *tc,
+                                              const struct
+                                              GNUNET_MessageHeader *msg)
 {
   struct GNUNET_MessageHeader *m;
   uint16_t size;
@@ -204,18 +208,18 @@
  */
 void
 GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc,
-                                    struct GNUNET_TIME_Relative timeout)
+                                   struct GNUNET_TIME_Relative timeout)
 {
   tc->timeout = GNUNET_TIME_relative_to_absolute (timeout);
   if (NULL ==
       GNUNET_SERVER_notify_transmit_ready (tc->client,
-                                           GNUNET_MIN (MIN_BLOCK_SIZE,
-                                                       tc->total), timeout,
-                                           &transmit_response, tc))
-  {
-    GNUNET_break (0);
-    GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
-  }
+                                          GNUNET_MIN (MIN_BLOCK_SIZE,
+                                                      tc->total), timeout,
+                                          &transmit_response, tc))
+    {
+      GNUNET_break (0);
+      GNUNET_SERVER_transmit_context_destroy (tc, GNUNET_SYSERR);
+    }
 }
 
 
@@ -233,8 +237,7 @@
  */
 void
 GNUNET_SERVER_transmit_context_destroy (struct GNUNET_SERVER_TransmitContext
-                                        *tc,
-                                       int success)
+                                       *tc, int success)
 {
   GNUNET_SERVER_receive_done (tc->client, success);
   GNUNET_SERVER_client_drop (tc->client);

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/service.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -36,6 +36,12 @@
 #include "gnunet_server_lib.h"
 #include "gnunet_service_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util", syscall, filename)
+
 #define DEBUG_SERVICE GNUNET_EXTRA_LOGGING
 
 /* ******************* access control ******************** */
@@ -98,120 +104,121 @@
   i = 0;
   pos = 0;
   while (i < count)
-  {
-    cnt =
-        sscanf (&routeList[pos], "%u.%u.%u.%u/%u.%u.%u.%u;", &temps[0],
-                &temps[1], &temps[2], &temps[3], &temps[4], &temps[5],
-                &temps[6], &temps[7]);
-    if (cnt == 8)
     {
-      for (j = 0; j < 8; j++)
-        if (temps[j] > 0xFF)
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      _("Invalid format for IP: `%s'\n"), &routeList[pos]);
-          GNUNET_free (result);
-          return NULL;
-        }
-      result[i].network.s_addr =
-          htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
-                 temps[3]);
-      result[i].netmask.s_addr =
-          htonl ((temps[4] << 24) + (temps[5] << 16) + (temps[6] << 8) +
-                 temps[7]);
-      while (routeList[pos] != ';')
-        pos++;
-      pos++;
-      i++;
-      continue;
+      cnt =
+       sscanf (&routeList[pos], "%u.%u.%u.%u/%u.%u.%u.%u;", &temps[0],
+               &temps[1], &temps[2], &temps[3], &temps[4], &temps[5],
+               &temps[6], &temps[7]);
+      if (cnt == 8)
+       {
+         for (j = 0; j < 8; j++)
+           if (temps[j] > 0xFF)
+             {
+               LOG (GNUNET_ERROR_TYPE_ERROR,
+                    _("Invalid format for IP: `%s'\n"), &routeList[pos]);
+               GNUNET_free (result);
+               return NULL;
+             }
+         result[i].network.s_addr =
+           htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
+                  temps[3]);
+         result[i].netmask.s_addr =
+           htonl ((temps[4] << 24) + (temps[5] << 16) + (temps[6] << 8) +
+                  temps[7]);
+         while (routeList[pos] != ';')
+           pos++;
+         pos++;
+         i++;
+         continue;
+       }
+      /* try second notation */
+      cnt =
+       sscanf (&routeList[pos], "%u.%u.%u.%u/%u;", &temps[0], &temps[1],
+               &temps[2], &temps[3], &slash);
+      if (cnt == 5)
+       {
+         for (j = 0; j < 4; j++)
+           if (temps[j] > 0xFF)
+             {
+               LOG (GNUNET_ERROR_TYPE_ERROR,
+                    _("Invalid format for IP: `%s'\n"), &routeList[pos]);
+               GNUNET_free (result);
+               return NULL;
+             }
+         result[i].network.s_addr =
+           htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
+                  temps[3]);
+         if ((slash <= 32) && (slash >= 0))
+           {
+             result[i].netmask.s_addr = 0;
+             while (slash > 0)
+               {
+                 result[i].netmask.s_addr =
+                   (result[i].netmask.s_addr >> 1) + 0x80000000;
+                 slash--;
+               }
+             result[i].netmask.s_addr = htonl (result[i].netmask.s_addr);
+             while (routeList[pos] != ';')
+               pos++;
+             pos++;
+             i++;
+             continue;
+           }
+         else
+           {
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _
+                  ("Invalid network notation ('/%d' is not legal in IPv4 
CIDR)."),
+                  slash);
+             GNUNET_free (result);
+             return NULL;      /* error */
+           }
+       }
+      /* try third notation */
+      slash = 32;
+      cnt =
+       sscanf (&routeList[pos], "%u.%u.%u.%u;", &temps[0], &temps[1],
+               &temps[2], &temps[3]);
+      if (cnt == 4)
+       {
+         for (j = 0; j < 4; j++)
+           if (temps[j] > 0xFF)
+             {
+               LOG (GNUNET_ERROR_TYPE_ERROR,
+                    _("Invalid format for IP: `%s'\n"), &routeList[pos]);
+               GNUNET_free (result);
+               return NULL;
+             }
+         result[i].network.s_addr =
+           htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
+                  temps[3]);
+         result[i].netmask.s_addr = 0;
+         while (slash > 0)
+           {
+             result[i].netmask.s_addr =
+               (result[i].netmask.s_addr >> 1) + 0x80000000;
+             slash--;
+           }
+         result[i].netmask.s_addr = htonl (result[i].netmask.s_addr);
+         while (routeList[pos] != ';')
+           pos++;
+         pos++;
+         i++;
+         continue;
+       }
+      LOG (GNUNET_ERROR_TYPE_ERROR, _("Invalid format for IP: `%s'\n"),
+          &routeList[pos]);
+      GNUNET_free (result);
+      return NULL;             /* error */
     }
-    /* try second notation */
-    cnt =
-        sscanf (&routeList[pos], "%u.%u.%u.%u/%u;", &temps[0], &temps[1],
-                &temps[2], &temps[3], &slash);
-    if (cnt == 5)
+  if (pos < strlen (routeList))
     {
-      for (j = 0; j < 4; j++)
-        if (temps[j] > 0xFF)
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      _("Invalid format for IP: `%s'\n"), &routeList[pos]);
-          GNUNET_free (result);
-          return NULL;
-        }
-      result[i].network.s_addr =
-          htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
-                 temps[3]);
-      if ((slash <= 32) && (slash >= 0))
-      {
-        result[i].netmask.s_addr = 0;
-        while (slash > 0)
-        {
-          result[i].netmask.s_addr =
-              (result[i].netmask.s_addr >> 1) + 0x80000000;
-          slash--;
-        }
-        result[i].netmask.s_addr = htonl (result[i].netmask.s_addr);
-        while (routeList[pos] != ';')
-          pos++;
-        pos++;
-        i++;
-        continue;
-      }
-      else
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _
-                    ("Invalid network notation ('/%d' is not legal in IPv4 
CIDR)."),
-                    slash);
-        GNUNET_free (result);
-        return NULL;            /* error */
-      }
+      LOG (GNUNET_ERROR_TYPE_ERROR, _("Invalid format for IP: `%s'\n"),
+          &routeList[pos]);
+      GNUNET_free (result);
+      return NULL;             /* oops */
     }
-    /* try third notation */
-    slash = 32;
-    cnt =
-        sscanf (&routeList[pos], "%u.%u.%u.%u;", &temps[0], &temps[1],
-                &temps[2], &temps[3]);
-    if (cnt == 4)
-    {
-      for (j = 0; j < 4; j++)
-        if (temps[j] > 0xFF)
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      _("Invalid format for IP: `%s'\n"), &routeList[pos]);
-          GNUNET_free (result);
-          return NULL;
-        }
-      result[i].network.s_addr =
-          htonl ((temps[0] << 24) + (temps[1] << 16) + (temps[2] << 8) +
-                 temps[3]);
-      result[i].netmask.s_addr = 0;
-      while (slash > 0)
-      {
-        result[i].netmask.s_addr = (result[i].netmask.s_addr >> 1) + 
0x80000000;
-        slash--;
-      }
-      result[i].netmask.s_addr = htonl (result[i].netmask.s_addr);
-      while (routeList[pos] != ';')
-        pos++;
-      pos++;
-      i++;
-      continue;
-    }
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Invalid format for IP: `%s'\n"),
-                &routeList[pos]);
-    GNUNET_free (result);
-    return NULL;                /* error */
-  }
-  if (pos < strlen (routeList))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Invalid format for IP: `%s'\n"),
-                &routeList[pos]);
-    GNUNET_free (result);
-    return NULL;                /* oops */
-  }
-  return result;                /* ok */
+  return result;               /* ok */
 }
 
 
@@ -253,84 +260,85 @@
     if (routeList[i] == ';')
       count++;
   if (routeList[len - 1] != ';')
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("Invalid network notation (does not end with ';': `%s')\n"),
-                routeList);
-    GNUNET_free (routeList);
-    return NULL;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("Invalid network notation (does not end with ';': `%s')\n"),
+          routeList);
+      GNUNET_free (routeList);
+      return NULL;
+    }
 
   result = GNUNET_malloc (sizeof (struct IPv6NetworkSet) * (count + 1));
   memset (result, 0, sizeof (struct IPv6NetworkSet) * (count + 1));
   i = 0;
   pos = 0;
   while (i < count)
-  {
-    start = pos;
-    while (routeList[pos] != ';')
-      pos++;
-    slash = pos;
-    while ((slash >= start) && (routeList[slash] != '/'))
-      slash--;
-    if (slash < start)
     {
-      memset (&result[i].netmask, 0xFF, sizeof (struct in6_addr));
+      start = pos;
+      while (routeList[pos] != ';')
+       pos++;
       slash = pos;
-    }
-    else
-    {
-      routeList[pos] = '\0';
-      ret = inet_pton (AF_INET6, &routeList[slash + 1], &result[i].netmask);
+      while ((slash >= start) && (routeList[slash] != '/'))
+       slash--;
+      if (slash < start)
+       {
+         memset (&result[i].netmask, 0xFF, sizeof (struct in6_addr));
+         slash = pos;
+       }
+      else
+       {
+         routeList[pos] = '\0';
+         ret =
+           inet_pton (AF_INET6, &routeList[slash + 1], &result[i].netmask);
+         if (ret <= 0)
+           {
+             save = errno;
+             if ((1 != SSCANF (&routeList[slash + 1], "%u", &bits))
+                 || (bits >= 128))
+               {
+                 if (ret == 0)
+                   LOG (GNUNET_ERROR_TYPE_ERROR,
+                        _("Wrong format `%s' for netmask\n"),
+                        &routeList[slash + 1]);
+                 else
+                   {
+                     errno = save;
+                     LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "inet_pton");
+                   }
+                 GNUNET_free (result);
+                 GNUNET_free (routeList);
+                 return NULL;
+               }
+             off = 0;
+             while (bits > 8)
+               {
+                 result[i].netmask.s6_addr[off++] = 0xFF;
+                 bits -= 8;
+               }
+             while (bits > 0)
+               {
+                 result[i].netmask.s6_addr[off] =
+                   (result[i].netmask.s6_addr[off] >> 1) + 0x80;
+                 bits--;
+               }
+           }
+       }
+      routeList[slash] = '\0';
+      ret = inet_pton (AF_INET6, &routeList[start], &result[i].network);
       if (ret <= 0)
-      {
-        save = errno;
-        if ((1 != SSCANF (&routeList[slash + 1], "%u", &bits)) || (bits >= 
128))
-        {
-          if (ret == 0)
-            GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                        _("Wrong format `%s' for netmask\n"),
-                        &routeList[slash + 1]);
-          else
-          {
-            errno = save;
-            GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "inet_pton");
-          }
-          GNUNET_free (result);
-          GNUNET_free (routeList);
-          return NULL;
-        }
-        off = 0;
-        while (bits > 8)
-        {
-          result[i].netmask.s6_addr[off++] = 0xFF;
-          bits -= 8;
-        }
-        while (bits > 0)
-        {
-          result[i].netmask.s6_addr[off] =
-              (result[i].netmask.s6_addr[off] >> 1) + 0x80;
-          bits--;
-        }
-      }
+       {
+         if (ret == 0)
+           LOG (GNUNET_ERROR_TYPE_ERROR,
+                _("Wrong format `%s' for network\n"), &routeList[slash + 1]);
+         else
+           LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "inet_pton");
+         GNUNET_free (result);
+         GNUNET_free (routeList);
+         return NULL;
+       }
+      pos++;
+      i++;
     }
-    routeList[slash] = '\0';
-    ret = inet_pton (AF_INET6, &routeList[start], &result[i].network);
-    if (ret <= 0)
-    {
-      if (ret == 0)
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _("Wrong format `%s' for network\n"),
-                    &routeList[slash + 1]);
-      else
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "inet_pton");
-      GNUNET_free (result);
-      GNUNET_free (routeList);
-      return NULL;
-    }
-    pos++;
-    i++;
-  }
   GNUNET_free (routeList);
   return result;
 }
@@ -344,7 +352,8 @@
  * @return GNUNET_NO if the IP is not in the list, GNUNET_YES if it it is
  */
 static int
-check_ipv4_listed (const struct IPv4NetworkSet *list, const struct in_addr 
*add)
+check_ipv4_listed (const struct IPv4NetworkSet *list,
+                  const struct in_addr *add)
 {
   int i;
 
@@ -353,12 +362,12 @@
     return GNUNET_NO;
 
   while ((list[i].network.s_addr != 0) || (list[i].netmask.s_addr != 0))
-  {
-    if ((add->s_addr & list[i].netmask.s_addr) ==
-        (list[i].network.s_addr & list[i].netmask.s_addr))
-      return GNUNET_YES;
-    i++;
-  }
+    {
+      if ((add->s_addr & list[i].netmask.s_addr) ==
+         (list[i].network.s_addr & list[i].netmask.s_addr))
+       return GNUNET_YES;
+      i++;
+    }
   return GNUNET_NO;
 }
 
@@ -370,7 +379,8 @@
  * @return GNUNET_NO if the IP is not in the list, GNUNET_YES if it it is
  */
 static int
-check_ipv6_listed (const struct IPv6NetworkSet *list, const struct in6_addr 
*ip)
+check_ipv6_listed (const struct IPv6NetworkSet *list,
+                  const struct in6_addr *ip)
 {
   unsigned int i;
   unsigned int j;
@@ -383,16 +393,16 @@
   i = 0;
 NEXT:
   while (memcmp (&zero, &list[i].network, sizeof (struct in6_addr)) != 0)
-  {
-    for (j = 0; j < sizeof (struct in6_addr) / sizeof (int); j++)
-      if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) !=
-          (((int *) &list[i].network)[j] & ((int *) &list[i].netmask)[j]))
-      {
-        i++;
-        goto NEXT;
-      }
-    return GNUNET_YES;
-  }
+    {
+      for (j = 0; j < sizeof (struct in6_addr) / sizeof (int); j++)
+       if (((((int *) ip)[j] & ((int *) &list[i].netmask)[j])) !=
+           (((int *) &list[i].network)[j] & ((int *) &list[i].netmask)[j]))
+         {
+           i++;
+           goto NEXT;
+         }
+      return GNUNET_YES;
+    }
   return GNUNET_NO;
 }
 
@@ -526,10 +536,10 @@
   struct GNUNET_MessageHeader *msg;
 
   if (size < sizeof (struct GNUNET_MessageHeader))
-  {
-    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
-    return 0;                   /* client disconnected */
-  }
+    {
+      GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+      return 0;                        /* client disconnected */
+    }
   msg = (struct GNUNET_MessageHeader *) buf;
   msg->type = htons (GNUNET_MESSAGE_TYPE_TEST);
   msg->size = htons (sizeof (struct GNUNET_MessageHeader));
@@ -546,14 +556,15 @@
  */
 static void
 handle_test (void *cls, struct GNUNET_SERVER_Client *client,
-             const struct GNUNET_MessageHeader *message)
+            const struct GNUNET_MessageHeader *message)
 {
   /* simply bounce message back to acknowledge */
   if (NULL ==
       GNUNET_SERVER_notify_transmit_ready (client,
-                                           sizeof (struct 
GNUNET_MessageHeader),
-                                           GNUNET_TIME_UNIT_FOREVER_REL,
-                                           &write_test, client))
+                                          sizeof (struct
+                                                  GNUNET_MessageHeader),
+                                          GNUNET_TIME_UNIT_FOREVER_REL,
+                                          &write_test, client))
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
 }
 
@@ -586,7 +597,7 @@
  */
 static int
 check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
-              const struct sockaddr *addr, socklen_t addrlen)
+             const struct sockaddr *addr, socklen_t addrlen)
 {
   struct GNUNET_SERVICE_Context *sctx = cls;
   const struct sockaddr_in *i4;
@@ -594,51 +605,51 @@
   int ret;
 
   switch (addr->sa_family)
-  {
-  case AF_INET:
-    GNUNET_assert (addrlen == sizeof (struct sockaddr_in));
-    i4 = (const struct sockaddr_in *) addr;
-    ret = ((sctx->v4_allowed == NULL) ||
-           (check_ipv4_listed (sctx->v4_allowed, &i4->sin_addr))) &&
-        ((sctx->v4_denied == NULL) ||
-         (!check_ipv4_listed (sctx->v4_denied, &i4->sin_addr)));
-    break;
-  case AF_INET6:
-    GNUNET_assert (addrlen == sizeof (struct sockaddr_in6));
-    i6 = (const struct sockaddr_in6 *) addr;
-    ret = ((sctx->v6_allowed == NULL) ||
-           (check_ipv6_listed (sctx->v6_allowed, &i6->sin6_addr))) &&
-        ((sctx->v6_denied == NULL) ||
-         (!check_ipv6_listed (sctx->v6_denied, &i6->sin6_addr)));
-    break;
+    {
+    case AF_INET:
+      GNUNET_assert (addrlen == sizeof (struct sockaddr_in));
+      i4 = (const struct sockaddr_in *) addr;
+      ret = ((sctx->v4_allowed == NULL) ||
+            (check_ipv4_listed (sctx->v4_allowed, &i4->sin_addr))) &&
+       ((sctx->v4_denied == NULL) ||
+        (!check_ipv4_listed (sctx->v4_denied, &i4->sin_addr)));
+      break;
+    case AF_INET6:
+      GNUNET_assert (addrlen == sizeof (struct sockaddr_in6));
+      i6 = (const struct sockaddr_in6 *) addr;
+      ret = ((sctx->v6_allowed == NULL) ||
+            (check_ipv6_listed (sctx->v6_allowed, &i6->sin6_addr))) &&
+       ((sctx->v6_denied == NULL) ||
+        (!check_ipv6_listed (sctx->v6_denied, &i6->sin6_addr)));
+      break;
 #ifndef WINDOWS
-  case AF_UNIX:
-    ret = GNUNET_OK;            /* always OK for now */
-    if ((sctx->match_uid == GNUNET_YES) || (sctx->match_gid == GNUNET_YES))
-      ret = GNUNET_NO;
-    if ((uc != NULL) &&
-        ((sctx->match_uid != GNUNET_YES) || (uc->uid == geteuid ()) ||
-         (uc->uid == getuid ())) && ((sctx->match_gid != GNUNET_YES) ||
-                                     (uc->gid == getegid ()) ||
-                                     (uc->gid == getgid ())))
-      ret = GNUNET_YES;
-    else
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("Access denied to UID %d / GID %d\n"),
-                  (uc == NULL) ? -1 : uc->uid, (uc == NULL) ? -1 : uc->gid);
-    break;
+    case AF_UNIX:
+      ret = GNUNET_OK;         /* always OK for now */
+      if ((sctx->match_uid == GNUNET_YES) || (sctx->match_gid == GNUNET_YES))
+       ret = GNUNET_NO;
+      if ((uc != NULL) &&
+         ((sctx->match_uid != GNUNET_YES) || (uc->uid == geteuid ()) ||
+          (uc->uid == getuid ())) && ((sctx->match_gid != GNUNET_YES) ||
+                                      (uc->gid == getegid ()) ||
+                                      (uc->gid == getgid ())))
+       ret = GNUNET_YES;
+      else
+       LOG (GNUNET_ERROR_TYPE_WARNING,
+            _("Access denied to UID %d / GID %d\n"),
+            (uc == NULL) ? -1 : uc->uid, (uc == NULL) ? -1 : uc->gid);
+      break;
 #endif
-  default:
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Unknown address family %d\n"),
-                addr->sa_family);
-    return GNUNET_SYSERR;
-  }
+    default:
+      LOG (GNUNET_ERROR_TYPE_WARNING, _("Unknown address family %d\n"),
+          addr->sa_family);
+      return GNUNET_SYSERR;
+    }
   if (ret != GNUNET_OK)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("Access from `%s' denied to service `%s'\n"),
-                GNUNET_a2s (addr, addrlen), sctx->serviceName);
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("Access from `%s' denied to service `%s'\n"),
+          GNUNET_a2s (addr, addrlen), sctx->serviceName);
+    }
   return ret;
 }
 
@@ -655,7 +666,7 @@
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (sctx->cfg, sctx->serviceName,
-                                               "PIDFILE", &pif))
+                                              "PIDFILE", &pif))
     return NULL;
   return pif;
 }
@@ -665,26 +676,26 @@
  * Parse an IPv4 access control list.
  */
 static int
-process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx,
-              const char *option)
+process_acl4 (struct IPv4NetworkSet **ret,
+             struct GNUNET_SERVICE_Context *sctx, const char *option)
 {
   char *opt;
 
   if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option))
     return GNUNET_OK;
   GNUNET_break (GNUNET_OK ==
-                GNUNET_CONFIGURATION_get_value_string (sctx->cfg,
-                                                       sctx->serviceName,
-                                                       option, &opt));
+               GNUNET_CONFIGURATION_get_value_string (sctx->cfg,
+                                                      sctx->serviceName,
+                                                      option, &opt));
   if (NULL == (*ret = parse_ipv4_specification (opt)))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _
-                ("Could not parse IPv4 network specification `%s' for 
`%s:%s'\n"),
-                opt, sctx->serviceName, option);
-    GNUNET_free (opt);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _
+          ("Could not parse IPv4 network specification `%s' for `%s:%s'\n"),
+          opt, sctx->serviceName, option);
+      GNUNET_free (opt);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (opt);
   return GNUNET_OK;
 }
@@ -694,26 +705,26 @@
  * Parse an IPv4 access control list.
  */
 static int
-process_acl6 (struct IPv6NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx,
-              const char *option)
+process_acl6 (struct IPv6NetworkSet **ret,
+             struct GNUNET_SERVICE_Context *sctx, const char *option)
 {
   char *opt;
 
   if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option))
     return GNUNET_OK;
   GNUNET_break (GNUNET_OK ==
-                GNUNET_CONFIGURATION_get_value_string (sctx->cfg,
-                                                       sctx->serviceName,
-                                                       option, &opt));
+               GNUNET_CONFIGURATION_get_value_string (sctx->cfg,
+                                                      sctx->serviceName,
+                                                      option, &opt));
   if (NULL == (*ret = parse_ipv6_specification (opt)))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _
-                ("Could not parse IPv6 network specification `%s' for 
`%s:%s'\n"),
-                opt, sctx->serviceName, option);
-    GNUNET_free (opt);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _
+          ("Could not parse IPv6 network specification `%s' for `%s:%s'\n"),
+          opt, sctx->serviceName, option);
+      GNUNET_free (opt);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (opt);
   return GNUNET_OK;
 }
@@ -728,7 +739,7 @@
  */
 static void
 add_unixpath (struct sockaddr **saddrs, socklen_t * saddrlens,
-              const char *unixpath)
+             const char *unixpath)
 {
 #ifdef AF_UNIX
   struct sockaddr_un *un;
@@ -780,9 +791,9 @@
  */
 int
 GNUNET_SERVICE_get_server_addresses (const char *serviceName,
-                                     const struct GNUNET_CONFIGURATION_Handle
-                                     *cfg, struct sockaddr ***addrs,
-                                     socklen_t ** addr_lens)
+                                    const struct GNUNET_CONFIGURATION_Handle
+                                    *cfg, struct sockaddr ***addrs,
+                                    socklen_t ** addr_lens)
 {
   int disablev6;
   struct GNUNET_NETWORK_Handle *desc;
@@ -803,62 +814,64 @@
   *addr_lens = NULL;
   desc = NULL;
   if (GNUNET_CONFIGURATION_have_value (cfg, serviceName, "DISABLEV6"))
-  {
-    if (GNUNET_SYSERR ==
-        (disablev6 =
-         GNUNET_CONFIGURATION_get_value_yesno (cfg, serviceName, "DISABLEV6")))
-      return GNUNET_SYSERR;
-  }
+    {
+      if (GNUNET_SYSERR ==
+         (disablev6 =
+          GNUNET_CONFIGURATION_get_value_yesno (cfg, serviceName,
+                                                "DISABLEV6")))
+       return GNUNET_SYSERR;
+    }
   else
     disablev6 = GNUNET_NO;
 
   if (!disablev6)
-  {
-    /* probe IPv6 support */
-    desc = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0);
-    if (NULL == desc)
     {
-      if ((errno == ENOBUFS) || (errno == ENOMEM) || (errno == ENFILE) ||
-          (errno == EACCES))
-      {
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
-        return GNUNET_SYSERR;
-      }
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _
-                  ("Disabling IPv6 support for service `%s', failed to create 
IPv6 socket: %s\n"),
-                  serviceName, STRERROR (errno));
-      disablev6 = GNUNET_YES;
+      /* probe IPv6 support */
+      desc = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0);
+      if (NULL == desc)
+       {
+         if ((errno == ENOBUFS) || (errno == ENOMEM) || (errno == ENFILE) ||
+             (errno == EACCES))
+           {
+             LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket");
+             return GNUNET_SYSERR;
+           }
+         LOG (GNUNET_ERROR_TYPE_INFO,
+              _
+              ("Disabling IPv6 support for service `%s', failed to create IPv6 
socket: %s\n"),
+              serviceName, STRERROR (errno));
+         disablev6 = GNUNET_YES;
+       }
+      else
+       {
+         GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (desc));
+         desc = NULL;
+       }
     }
-    else
-    {
-      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (desc));
-      desc = NULL;
-    }
-  }
 
   port = 0;
   if (GNUNET_CONFIGURATION_have_value (cfg, serviceName, "PORT"))
-  {
-    GNUNET_break (GNUNET_OK ==
-                  GNUNET_CONFIGURATION_get_value_number (cfg, serviceName,
-                                                         "PORT", &port));
-    if (port > 65535)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _
-                  ("Require valid port number for service `%s' in 
configuration!\n"),
-                  serviceName);
-      return GNUNET_SYSERR;
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_CONFIGURATION_get_value_number (cfg, serviceName,
+                                                          "PORT", &port));
+      if (port > 65535)
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _
+              ("Require valid port number for service `%s' in 
configuration!\n"),
+              serviceName);
+         return GNUNET_SYSERR;
+       }
     }
-  }
 
   if (GNUNET_CONFIGURATION_have_value (cfg, serviceName, "BINDTO"))
-  {
-    GNUNET_break (GNUNET_OK ==
-                  GNUNET_CONFIGURATION_get_value_string (cfg, serviceName,
-                                                         "BINDTO", &hostname));
-  }
+    {
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_CONFIGURATION_get_value_string (cfg, serviceName,
+                                                          "BINDTO",
+                                                          &hostname));
+    }
   else
     hostname = NULL;
 
@@ -868,211 +881,211 @@
        GNUNET_CONFIGURATION_have_value (cfg, serviceName, "UNIXPATH")) &&
       (GNUNET_OK ==
        GNUNET_CONFIGURATION_get_value_string (cfg, serviceName, "UNIXPATH",
-                                              &unixpath)) &&
+                                             &unixpath)) &&
       (0 < strlen (unixpath)))
-  {
-    /* probe UNIX support */
-    struct sockaddr_un s_un;
-
-    if (strlen (unixpath) >= sizeof (s_un.sun_path))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("UNIXPATH `%s' too long, maximum length is %llu\n"),
-                  unixpath, sizeof (s_un.sun_path));
-      GNUNET_free_non_null (hostname);
-      GNUNET_free (unixpath);
-      return GNUNET_SYSERR;
-    }
+      /* probe UNIX support */
+      struct sockaddr_un s_un;
 
-    desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0);
-    if (NULL == desc)
-    {
-      if ((errno == ENOBUFS) || (errno == ENOMEM) || (errno == ENFILE) ||
-          (errno == EACCES))
-      {
-        GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
-        GNUNET_free_non_null (hostname);
-        GNUNET_free (unixpath);
-        return GNUNET_SYSERR;
-      }
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _
-                  ("Disabling UNIX domain socket support for service `%s', 
failed to create UNIX domain socket: %s\n"),
-                  serviceName, STRERROR (errno));
-      GNUNET_free (unixpath);
-      unixpath = NULL;
+      if (strlen (unixpath) >= sizeof (s_un.sun_path))
+       {
+         LOG (GNUNET_ERROR_TYPE_WARNING,
+              _("UNIXPATH `%s' too long, maximum length is %llu\n"),
+              unixpath, sizeof (s_un.sun_path));
+         GNUNET_free_non_null (hostname);
+         GNUNET_free (unixpath);
+         return GNUNET_SYSERR;
+       }
+
+      desc = GNUNET_NETWORK_socket_create (AF_UNIX, SOCK_STREAM, 0);
+      if (NULL == desc)
+       {
+         if ((errno == ENOBUFS) || (errno == ENOMEM) || (errno == ENFILE) ||
+             (errno == EACCES))
+           {
+             LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket");
+             GNUNET_free_non_null (hostname);
+             GNUNET_free (unixpath);
+             return GNUNET_SYSERR;
+           }
+         LOG (GNUNET_ERROR_TYPE_INFO,
+              _
+              ("Disabling UNIX domain socket support for service `%s', failed 
to create UNIX domain socket: %s\n"),
+              serviceName, STRERROR (errno));
+         GNUNET_free (unixpath);
+         unixpath = NULL;
+       }
+      else
+       {
+         GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (desc));
+         desc = NULL;
+       }
     }
-    else
-    {
-      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (desc));
-      desc = NULL;
-    }
-  }
 #endif
 
   if ((port == 0) && (unixpath == NULL))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _
-                ("Have neither PORT nor UNIXPATH for service `%s', but one is 
required\n"),
-                serviceName);
-    GNUNET_free_non_null (hostname);
-    return GNUNET_SYSERR;
-  }
-  if (port == 0)
-  {
-    saddrs = GNUNET_malloc (2 * sizeof (struct sockaddr *));
-    saddrlens = GNUNET_malloc (2 * sizeof (socklen_t));
-    add_unixpath (saddrs, saddrlens, unixpath);
-    GNUNET_free_non_null (unixpath);
-    GNUNET_free_non_null (hostname);
-    *addrs = saddrs;
-    *addr_lens = saddrlens;
-    return 1;
-  }
-
-  if (hostname != NULL)
-  {
-#if DEBUG_SERVICE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Resolving `%s' since that is where `%s' will bind to.\n",
-                hostname, serviceName);
-#endif
-    memset (&hints, 0, sizeof (struct addrinfo));
-    if (disablev6)
-      hints.ai_family = AF_INET;
-    if ((0 != (ret = getaddrinfo (hostname, NULL, &hints, &res))) ||
-        (res == NULL))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to resolve `%s': %s\n"),
-                  hostname, gai_strerror (ret));
-      GNUNET_free (hostname);
-      GNUNET_free_non_null (unixpath);
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _
+          ("Have neither PORT nor UNIXPATH for service `%s', but one is 
required\n"),
+          serviceName);
+      GNUNET_free_non_null (hostname);
       return GNUNET_SYSERR;
     }
-    next = res;
-    i = 0;
-    while (NULL != (pos = next))
+  if (port == 0)
     {
-      next = pos->ai_next;
-      if ((disablev6) && (pos->ai_family == AF_INET6))
-        continue;
-      i++;
-    }
-    if (0 == i)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _("Failed to find %saddress for `%s'.\n"),
-                  disablev6 ? "IPv4 " : "", hostname);
-      freeaddrinfo (res);
-      GNUNET_free (hostname);
+      saddrs = GNUNET_malloc (2 * sizeof (struct sockaddr *));
+      saddrlens = GNUNET_malloc (2 * sizeof (socklen_t));
+      add_unixpath (saddrs, saddrlens, unixpath);
       GNUNET_free_non_null (unixpath);
-      return GNUNET_SYSERR;
+      GNUNET_free_non_null (hostname);
+      *addrs = saddrs;
+      *addr_lens = saddrlens;
+      return 1;
     }
-    resi = i;
-    if (NULL != unixpath)
-      resi++;
-    saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *));
-    saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t));
-    i = 0;
-    if (NULL != unixpath)
+
+  if (hostname != NULL)
     {
-      add_unixpath (saddrs, saddrlens, unixpath);
-      i++;
-    }
-    next = res;
-    while (NULL != (pos = next))
-    {
-      next = pos->ai_next;
-      if ((disablev6) && (pos->ai_family == AF_INET6))
-        continue;
-      if ((pos->ai_protocol != IPPROTO_TCP) && (pos->ai_protocol != 0))
-        continue;               /* not TCP */
-      if ((pos->ai_socktype != SOCK_STREAM) && (pos->ai_socktype != 0))
-        continue;               /* huh? */
 #if DEBUG_SERVICE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service `%s' will bind to `%s'\n",
-                  serviceName, GNUNET_a2s (pos->ai_addr, pos->ai_addrlen));
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+          "Resolving `%s' since that is where `%s' will bind to.\n",
+          hostname, serviceName);
 #endif
-      if (pos->ai_family == AF_INET)
-      {
-        GNUNET_assert (pos->ai_addrlen == sizeof (struct sockaddr_in));
-        saddrlens[i] = pos->ai_addrlen;
-        saddrs[i] = GNUNET_malloc (saddrlens[i]);
-        memcpy (saddrs[i], pos->ai_addr, saddrlens[i]);
-        ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
-      }
-      else
-      {
-        GNUNET_assert (pos->ai_family == AF_INET6);
-        GNUNET_assert (pos->ai_addrlen == sizeof (struct sockaddr_in6));
-        saddrlens[i] = pos->ai_addrlen;
-        saddrs[i] = GNUNET_malloc (saddrlens[i]);
-        memcpy (saddrs[i], pos->ai_addr, saddrlens[i]);
-        ((struct sockaddr_in6 *) saddrs[i])->sin6_port = htons (port);
-      }
-      i++;
-    }
-    GNUNET_free (hostname);
-    freeaddrinfo (res);
-    resi = i;
-  }
-  else
-  {
-    /* will bind against everything, just set port */
-    if (disablev6)
-    {
-      /* V4-only */
-      resi = 1;
+      memset (&hints, 0, sizeof (struct addrinfo));
+      if (disablev6)
+       hints.ai_family = AF_INET;
+      if ((0 != (ret = getaddrinfo (hostname, NULL, &hints, &res))) ||
+         (res == NULL))
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR, _("Failed to resolve `%s': %s\n"),
+              hostname, gai_strerror (ret));
+         GNUNET_free (hostname);
+         GNUNET_free_non_null (unixpath);
+         return GNUNET_SYSERR;
+       }
+      next = res;
+      i = 0;
+      while (NULL != (pos = next))
+       {
+         next = pos->ai_next;
+         if ((disablev6) && (pos->ai_family == AF_INET6))
+           continue;
+         i++;
+       }
+      if (0 == i)
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _("Failed to find %saddress for `%s'.\n"),
+              disablev6 ? "IPv4 " : "", hostname);
+         freeaddrinfo (res);
+         GNUNET_free (hostname);
+         GNUNET_free_non_null (unixpath);
+         return GNUNET_SYSERR;
+       }
+      resi = i;
       if (NULL != unixpath)
-        resi++;
-      i = 0;
+       resi++;
       saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *));
       saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t));
+      i = 0;
       if (NULL != unixpath)
-      {
-        add_unixpath (saddrs, saddrlens, unixpath);
-        i++;
-      }
-      saddrlens[i] = sizeof (struct sockaddr_in);
-      saddrs[i] = GNUNET_malloc (saddrlens[i]);
-#if HAVE_SOCKADDR_IN_SIN_LEN
-      ((struct sockaddr_in *) saddrs[i])->sin_len = saddrlens[i];
+       {
+         add_unixpath (saddrs, saddrlens, unixpath);
+         i++;
+       }
+      next = res;
+      while (NULL != (pos = next))
+       {
+         next = pos->ai_next;
+         if ((disablev6) && (pos->ai_family == AF_INET6))
+           continue;
+         if ((pos->ai_protocol != IPPROTO_TCP) && (pos->ai_protocol != 0))
+           continue;           /* not TCP */
+         if ((pos->ai_socktype != SOCK_STREAM) && (pos->ai_socktype != 0))
+           continue;           /* huh? */
+#if DEBUG_SERVICE
+         LOG (GNUNET_ERROR_TYPE_DEBUG, "Service `%s' will bind to `%s'\n",
+              serviceName, GNUNET_a2s (pos->ai_addr, pos->ai_addrlen));
 #endif
-      ((struct sockaddr_in *) saddrs[i])->sin_family = AF_INET;
-      ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
+         if (pos->ai_family == AF_INET)
+           {
+             GNUNET_assert (pos->ai_addrlen == sizeof (struct sockaddr_in));
+             saddrlens[i] = pos->ai_addrlen;
+             saddrs[i] = GNUNET_malloc (saddrlens[i]);
+             memcpy (saddrs[i], pos->ai_addr, saddrlens[i]);
+             ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
+           }
+         else
+           {
+             GNUNET_assert (pos->ai_family == AF_INET6);
+             GNUNET_assert (pos->ai_addrlen == sizeof (struct sockaddr_in6));
+             saddrlens[i] = pos->ai_addrlen;
+             saddrs[i] = GNUNET_malloc (saddrlens[i]);
+             memcpy (saddrs[i], pos->ai_addr, saddrlens[i]);
+             ((struct sockaddr_in6 *) saddrs[i])->sin6_port = htons (port);
+           }
+         i++;
+       }
+      GNUNET_free (hostname);
+      freeaddrinfo (res);
+      resi = i;
     }
-    else
+  else
     {
-      /* dual stack */
-      resi = 2;
-      if (NULL != unixpath)
-        resi++;
-      saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *));
-      saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t));
-      i = 0;
-      if (NULL != unixpath)
-      {
-        add_unixpath (saddrs, saddrlens, unixpath);
-        i++;
-      }
-      saddrlens[i] = sizeof (struct sockaddr_in6);
-      saddrs[i] = GNUNET_malloc (saddrlens[i]);
+      /* will bind against everything, just set port */
+      if (disablev6)
+       {
+         /* V4-only */
+         resi = 1;
+         if (NULL != unixpath)
+           resi++;
+         i = 0;
+         saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *));
+         saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t));
+         if (NULL != unixpath)
+           {
+             add_unixpath (saddrs, saddrlens, unixpath);
+             i++;
+           }
+         saddrlens[i] = sizeof (struct sockaddr_in);
+         saddrs[i] = GNUNET_malloc (saddrlens[i]);
 #if HAVE_SOCKADDR_IN_SIN_LEN
-      ((struct sockaddr_in6 *) saddrs[i])->sin6_len = saddrlens[0];
+         ((struct sockaddr_in *) saddrs[i])->sin_len = saddrlens[i];
 #endif
-      ((struct sockaddr_in6 *) saddrs[i])->sin6_family = AF_INET6;
-      ((struct sockaddr_in6 *) saddrs[i])->sin6_port = htons (port);
-      i++;
-      saddrlens[i] = sizeof (struct sockaddr_in);
-      saddrs[i] = GNUNET_malloc (saddrlens[i]);
+         ((struct sockaddr_in *) saddrs[i])->sin_family = AF_INET;
+         ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
+       }
+      else
+       {
+         /* dual stack */
+         resi = 2;
+         if (NULL != unixpath)
+           resi++;
+         saddrs = GNUNET_malloc ((resi + 1) * sizeof (struct sockaddr *));
+         saddrlens = GNUNET_malloc ((resi + 1) * sizeof (socklen_t));
+         i = 0;
+         if (NULL != unixpath)
+           {
+             add_unixpath (saddrs, saddrlens, unixpath);
+             i++;
+           }
+         saddrlens[i] = sizeof (struct sockaddr_in6);
+         saddrs[i] = GNUNET_malloc (saddrlens[i]);
 #if HAVE_SOCKADDR_IN_SIN_LEN
-      ((struct sockaddr_in *) saddrs[i])->sin_len = saddrlens[1];
+         ((struct sockaddr_in6 *) saddrs[i])->sin6_len = saddrlens[0];
 #endif
-      ((struct sockaddr_in *) saddrs[i])->sin_family = AF_INET;
-      ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
+         ((struct sockaddr_in6 *) saddrs[i])->sin6_family = AF_INET6;
+         ((struct sockaddr_in6 *) saddrs[i])->sin6_port = htons (port);
+         i++;
+         saddrlens[i] = sizeof (struct sockaddr_in);
+         saddrs[i] = GNUNET_malloc (saddrlens[i]);
+#if HAVE_SOCKADDR_IN_SIN_LEN
+         ((struct sockaddr_in *) saddrs[i])->sin_len = saddrlens[1];
+#endif
+         ((struct sockaddr_in *) saddrs[i])->sin_family = AF_INET;
+         ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
+       }
     }
-  }
   GNUNET_free_non_null (unixpath);
   *addrs = saddrs;
   *addr_lens = saddrlens;
@@ -1111,36 +1124,37 @@
   int flags;
 #endif
 
-  if (GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, 
"TIMEOUT"))
-  {
-    if (GNUNET_OK !=
-        GNUNET_CONFIGURATION_get_value_time (sctx->cfg, sctx->serviceName,
-                                             "TIMEOUT", &idleout))
+  if (GNUNET_CONFIGURATION_have_value
+      (sctx->cfg, sctx->serviceName, "TIMEOUT"))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _("Specified value for `%s' of service `%s' is invalid\n"),
-                  "TIMEOUT", sctx->serviceName);
-      return GNUNET_SYSERR;
+      if (GNUNET_OK !=
+         GNUNET_CONFIGURATION_get_value_time (sctx->cfg, sctx->serviceName,
+                                              "TIMEOUT", &idleout))
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _("Specified value for `%s' of service `%s' is invalid\n"),
+              "TIMEOUT", sctx->serviceName);
+         return GNUNET_SYSERR;
+       }
+      sctx->timeout = idleout;
     }
-    sctx->timeout = idleout;
-  }
   else
     sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
 
   if (GNUNET_CONFIGURATION_have_value
       (sctx->cfg, sctx->serviceName, "TOLERANT"))
-  {
-    if (GNUNET_SYSERR ==
-        (tolerant =
-         GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
-                                               "TOLERANT")))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _("Specified value for `%s' of service `%s' is invalid\n"),
-                  "TOLERANT", sctx->serviceName);
-      return GNUNET_SYSERR;
+      if (GNUNET_SYSERR ==
+         (tolerant =
+          GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
+                                                "TOLERANT")))
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _("Specified value for `%s' of service `%s' is invalid\n"),
+              "TOLERANT", sctx->serviceName);
+         return GNUNET_SYSERR;
+       }
     }
-  }
   else
     tolerant = GNUNET_NO;
 
@@ -1151,45 +1165,48 @@
       (NULL != (nfds = getenv ("LISTEN_FDS"))) &&
       (1 == sscanf (nfds, "%u", &cnt)) && (cnt > 0) && (cnt < FD_SETSIZE) &&
       (cnt + 4 < FD_SETSIZE))
-  {
-    sctx->lsocks =
-        GNUNET_malloc (sizeof (struct GNUNET_NETWORK_Handle *) * (cnt + 1));
-    while (0 < cnt--)
     {
-      flags = fcntl (3 + cnt, F_GETFD);
-      if ((flags < 0) || (0 != (flags & FD_CLOEXEC)) ||
-          (NULL ==
-           (sctx->lsocks[cnt] = GNUNET_NETWORK_socket_box_native (3 + cnt))))
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    _
-                    ("Could not access pre-bound socket %u, will try to bind 
myself\n"),
-                    (unsigned int) 3 + cnt);
-        cnt++;
-        while (sctx->lsocks[cnt] != NULL)
-          GNUNET_break (0 == GNUNET_NETWORK_socket_close 
(sctx->lsocks[cnt++]));
-        GNUNET_free (sctx->lsocks);
-        sctx->lsocks = NULL;
-        break;
-      }
+      sctx->lsocks =
+       GNUNET_malloc (sizeof (struct GNUNET_NETWORK_Handle *) * (cnt + 1));
+      while (0 < cnt--)
+       {
+         flags = fcntl (3 + cnt, F_GETFD);
+         if ((flags < 0) || (0 != (flags & FD_CLOEXEC)) ||
+             (NULL ==
+              (sctx->lsocks[cnt] =
+               GNUNET_NETWORK_socket_box_native (3 + cnt))))
+           {
+             LOG (GNUNET_ERROR_TYPE_ERROR,
+                  _
+                  ("Could not access pre-bound socket %u, will try to bind 
myself\n"),
+                  (unsigned int) 3 + cnt);
+             cnt++;
+             while (sctx->lsocks[cnt] != NULL)
+               GNUNET_break (0 ==
+                             GNUNET_NETWORK_socket_close (sctx->lsocks
+                                                          [cnt++]));
+             GNUNET_free (sctx->lsocks);
+             sctx->lsocks = NULL;
+             break;
+           }
+       }
+      unsetenv ("LISTEN_PID");
+      unsetenv ("LISTEN_FDS");
     }
-    unsetenv ("LISTEN_PID");
-    unsetenv ("LISTEN_FDS");
-  }
 #endif
 
   if ((sctx->lsocks == NULL) &&
       (GNUNET_SYSERR ==
        GNUNET_SERVICE_get_server_addresses (sctx->serviceName, sctx->cfg,
-                                            &sctx->addrs, &sctx->addrlens)))
+                                           &sctx->addrs, &sctx->addrlens)))
     return GNUNET_SYSERR;
   sctx->require_found = tolerant ? GNUNET_NO : GNUNET_YES;
   sctx->match_uid =
-      GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
-                                            "UNIX_MATCH_UID");
+    GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
+                                         "UNIX_MATCH_UID");
   sctx->match_gid =
-      GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
-                                            "UNIX_MATCH_GID");
+    GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
+                                         "UNIX_MATCH_GID");
   process_acl4 (&sctx->v4_denied, sctx, "REJECT_FROM");
   process_acl4 (&sctx->v4_allowed, sctx, "ACCEPT_FROM");
   process_acl6 (&sctx->v6_denied, sctx, "REJECT_FROM6");
@@ -1211,7 +1228,7 @@
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (sctx->cfg, sctx->serviceName,
-                                               "USERNAME", &un))
+                                              "USERNAME", &un))
     return NULL;
   return un;
 }
@@ -1229,7 +1246,7 @@
   int len;
 
   if (NULL == (pif = get_pid_file_name (sctx)))
-    return GNUNET_OK;           /* no file desired */
+    return GNUNET_OK;          /* no file desired */
   user = get_user_name (sctx);
   rdir = GNUNET_strdup (pif);
   len = strlen (rdir);
@@ -1237,32 +1254,32 @@
     len--;
   rdir[len] = '\0';
   if (0 != ACCESS (rdir, F_OK))
-  {
-    /* we get to create a directory -- and claim it
-     * as ours! */
-    GNUNET_DISK_directory_create (rdir);
-    if ((user != NULL) && (0 < strlen (user)))
-      GNUNET_DISK_file_change_owner (rdir, user);
-  }
+    {
+      /* we get to create a directory -- and claim it
+       * as ours! */
+      GNUNET_DISK_directory_create (rdir);
+      if ((user != NULL) && (0 < strlen (user)))
+       GNUNET_DISK_file_change_owner (rdir, user);
+    }
   if (0 != ACCESS (rdir, W_OK | X_OK))
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "access", rdir);
-    GNUNET_free (rdir);
-    GNUNET_free_non_null (user);
-    GNUNET_free (pif);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "access", rdir);
+      GNUNET_free (rdir);
+      GNUNET_free_non_null (user);
+      GNUNET_free (pif);
+      return GNUNET_SYSERR;
+    }
   GNUNET_free (rdir);
   pidfd = FOPEN (pif, "w");
   if (pidfd == NULL)
-  {
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", pif);
-    GNUNET_free (pif);
-    GNUNET_free_non_null (user);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "fopen", pif);
+      GNUNET_free (pif);
+      GNUNET_free_non_null (user);
+      return GNUNET_SYSERR;
+    }
   if (0 > FPRINTF (pidfd, "%u", pid))
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fprintf", pif);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "fprintf", pif);
   GNUNET_break (0 == fclose (pidfd));
   if ((user != NULL) && (0 < strlen (user)))
     GNUNET_DISK_file_change_owner (pif, user);
@@ -1299,35 +1316,35 @@
   GNUNET_RESOLVER_connect (sctx->cfg);
   if (sctx->lsocks != NULL)
     sctx->server =
-        GNUNET_SERVER_create_with_sockets (&check_access, sctx, sctx->lsocks,
-                                           sctx->timeout, sctx->require_found);
+      GNUNET_SERVER_create_with_sockets (&check_access, sctx, sctx->lsocks,
+                                        sctx->timeout, sctx->require_found);
   else
     sctx->server =
-        GNUNET_SERVER_create (&check_access, sctx, sctx->addrs, sctx->addrlens,
-                              sctx->timeout, sctx->require_found);
+      GNUNET_SERVER_create (&check_access, sctx, sctx->addrs, sctx->addrlens,
+                           sctx->timeout, sctx->require_found);
   if (sctx->server == NULL)
-  {
-    if (sctx->addrs != NULL)
     {
-      i = 0;
-      while (sctx->addrs[i] != NULL)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Failed to start `%s' at 
`%s'\n"),
-                    sctx->serviceName, GNUNET_a2s (sctx->addrs[i],
-                                                   sctx->addrlens[i]));
-        i++;
-      }
+      if (sctx->addrs != NULL)
+       {
+         i = 0;
+         while (sctx->addrs[i] != NULL)
+           {
+             LOG (GNUNET_ERROR_TYPE_INFO,
+                  _("Failed to start `%s' at `%s'\n"), sctx->serviceName,
+                  GNUNET_a2s (sctx->addrs[i], sctx->addrlens[i]));
+             i++;
+           }
+       }
+      sctx->ret = GNUNET_SYSERR;
+      return;
     }
-    sctx->ret = GNUNET_SYSERR;
-    return;
-  }
   if (0 == (sctx->options & GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN))
-  {
-    /* install a task that will kill the server
-     * process if the scheduler ever gets a shutdown signal */
-    GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
-                                  sctx->server);
-  }
+    {
+      /* install a task that will kill the server
+       * process if the scheduler ever gets a shutdown signal */
+      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+                                   &shutdown_task, sctx->server);
+    }
   sctx->my_handlers = GNUNET_malloc (sizeof (defhandlers));
   memcpy (sctx->my_handlers, defhandlers, sizeof (defhandlers));
   i = 0;
@@ -1335,23 +1352,23 @@
     sctx->my_handlers[i++].callback_cls = sctx;
   GNUNET_SERVER_add_handlers (sctx->server, sctx->my_handlers);
   if (sctx->ready_confirm_fd != -1)
-  {
-    GNUNET_break (1 == WRITE (sctx->ready_confirm_fd, ".", 1));
-    GNUNET_break (0 == CLOSE (sctx->ready_confirm_fd));
-    sctx->ready_confirm_fd = -1;
-    write_pid_file (sctx, getpid ());
-  }
+    {
+      GNUNET_break (1 == WRITE (sctx->ready_confirm_fd, ".", 1));
+      GNUNET_break (0 == CLOSE (sctx->ready_confirm_fd));
+      sctx->ready_confirm_fd = -1;
+      write_pid_file (sctx, getpid ());
+    }
   if (sctx->addrs != NULL)
-  {
-    i = 0;
-    while (sctx->addrs[i] != NULL)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' runs at %s\n"),
-                  sctx->serviceName, GNUNET_a2s (sctx->addrs[i],
-                                                 sctx->addrlens[i]));
-      i++;
+      i = 0;
+      while (sctx->addrs[i] != NULL)
+       {
+         LOG (GNUNET_ERROR_TYPE_INFO, _("Service `%s' runs at %s\n"),
+              sctx->serviceName, GNUNET_a2s (sctx->addrs[i],
+                                             sctx->addrlens[i]));
+         i++;
+       }
     }
-  }
   sctx->task (sctx->task_cls, sctx->server, sctx->cfg);
 }
 
@@ -1368,45 +1385,45 @@
   int filedes[2];
 
   if (0 != PIPE (filedes))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pipe");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe");
+      return GNUNET_SYSERR;
+    }
   pid = fork ();
   if (pid < 0)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "fork");
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fork");
+      return GNUNET_SYSERR;
+    }
   if (pid != 0)
-  {
-    /* Parent */
-    char c;
+    {
+      /* Parent */
+      char c;
 
-    GNUNET_break (0 == CLOSE (filedes[1]));
-    c = 'X';
-    if (1 != READ (filedes[0], &c, sizeof (char)))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "read");
-    fflush (stdout);
-    switch (c)
-    {
-    case '.':
-      exit (0);
-    case 'I':
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _("Service process failed to initialize\n"));
-      break;
-    case 'S':
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _("Service process could not initialize server function\n"));
-      break;
-    case 'X':
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  _("Service process failed to report status\n"));
-      break;
+      GNUNET_break (0 == CLOSE (filedes[1]));
+      c = 'X';
+      if (1 != READ (filedes[0], &c, sizeof (char)))
+       LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "read");
+      fflush (stdout);
+      switch (c)
+       {
+       case '.':
+         exit (0);
+       case 'I':
+         LOG (GNUNET_ERROR_TYPE_INFO,
+              _("Service process failed to initialize\n"));
+         break;
+       case 'S':
+         LOG (GNUNET_ERROR_TYPE_INFO,
+              _("Service process could not initialize server function\n"));
+         break;
+       case 'X':
+         LOG (GNUNET_ERROR_TYPE_INFO,
+              _("Service process failed to report status\n"));
+         break;
+       }
+      exit (1);                        /* child reported error */
     }
-    exit (1);                   /* child reported error */
-  }
   GNUNET_break (0 == CLOSE (0));
   GNUNET_break (0 == CLOSE (1));
   GNUNET_break (0 == CLOSE (filedes[0]));
@@ -1415,16 +1432,16 @@
     return GNUNET_SYSERR;
   /* set stdin/stdout to /dev/null */
   if ((dup2 (nullfd, 0) < 0) || (dup2 (nullfd, 1) < 0))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
-    (void) CLOSE (nullfd);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "dup2");
+      (void) CLOSE (nullfd);
+      return GNUNET_SYSERR;
+    }
   (void) CLOSE (nullfd);
   /* Detach from controlling terminal */
   pid = setsid ();
   if (pid == -1)
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "setsid");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "setsid");
   sctx->ready_confirm_fd = filedes[1];
 #else
   /* FIXME: we probably need to do something else
@@ -1444,36 +1461,36 @@
   char *user;
 
   if (NULL == (user = get_user_name (sctx)))
-    return GNUNET_OK;           /* keep */
+    return GNUNET_OK;          /* keep */
 #ifndef MINGW
   struct passwd *pws;
 
   errno = 0;
   pws = getpwnam (user);
   if (pws == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("Cannot obtain information about user `%s': %s\n"), user,
-                errno == 0 ? _("No such user") : STRERROR (errno));
-    GNUNET_free (user);
-    return GNUNET_SYSERR;
-  }
+    {
+      LOG (GNUNET_ERROR_TYPE_ERROR,
+          _("Cannot obtain information about user `%s': %s\n"), user,
+          errno == 0 ? _("No such user") : STRERROR (errno));
+      GNUNET_free (user);
+      return GNUNET_SYSERR;
+    }
   if ((0 != setgid (pws->pw_gid)) || (0 != setegid (pws->pw_gid)) ||
 #if HAVE_INITGROUPS
       (0 != initgroups (user, pws->pw_gid)) ||
 #endif
       (0 != setuid (pws->pw_uid)) || (0 != seteuid (pws->pw_uid)))
-  {
-    if ((0 != setregid (pws->pw_gid, pws->pw_gid)) ||
-        (0 != setreuid (pws->pw_uid, pws->pw_uid)))
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _("Cannot change user/group to `%s': %s\n"), user,
-                  STRERROR (errno));
-      GNUNET_free (user);
-      return GNUNET_SYSERR;
+      if ((0 != setregid (pws->pw_gid, pws->pw_gid)) ||
+         (0 != setreuid (pws->pw_uid, pws->pw_uid)))
+       {
+         LOG (GNUNET_ERROR_TYPE_ERROR,
+              _("Cannot change user/group to `%s': %s\n"), user,
+              STRERROR (errno));
+         GNUNET_free (user);
+         return GNUNET_SYSERR;
+       }
     }
-  }
 #endif
   GNUNET_free (user);
   return GNUNET_OK;
@@ -1489,9 +1506,9 @@
   char *pif = get_pid_file_name (sctx);
 
   if (pif == NULL)
-    return;                     /* no PID file */
+    return;                    /* no PID file */
   if (0 != UNLINK (pif))
-    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", pif);
+    LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "unlink", pif);
   GNUNET_free (pif);
 }
 
@@ -1511,8 +1528,8 @@
  */
 int
 GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName,
-                    enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task,
-                    void *task_cls)
+                   enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task,
+                   void *task_cls)
 {
 #define HANDLE_ERROR do { GNUNET_break (0); goto shutdown; } while (0)
 
@@ -1568,24 +1585,24 @@
   if (GNUNET_OK != set_user_id (&sctx))
     goto shutdown;
 #if DEBUG_SERVICE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Service `%s' runs with configuration from `%s'\n", serviceName,
-              cfg_fn);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Service `%s' runs with configuration from `%s'\n", serviceName,
+       cfg_fn);
 #endif
   if (GNUNET_OK ==
-      GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing", 
"skew_offset",
-                                             &skew_offset) &&
-      (GNUNET_OK ==
-       GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing",
-                                              "skew_variance", 
&skew_variance)))
-  {
-    clock_offset = skew_offset - skew_variance;
-    GNUNET_TIME_set_offset (clock_offset);
+      GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing",
+                                            "skew_offset", &skew_offset)
+      && (GNUNET_OK ==
+         GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing",
+                                                "skew_variance",
+                                                &skew_variance)))
+    {
+      clock_offset = skew_offset - skew_variance;
+      GNUNET_TIME_set_offset (clock_offset);
 #if DEBUG_SERVICE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skewing clock by %dll\n",
-                clock_offset);
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Skewing clock by %dll\n", clock_offset);
 #endif
-  }
+    }
   /* actually run service */
   err = 0;
   GNUNET_SCHEDULER_run (&service_task, &sctx);
@@ -1597,11 +1614,11 @@
 
 shutdown:
   if (sctx.ready_confirm_fd != -1)
-  {
-    if (1 != WRITE (sctx.ready_confirm_fd, err ? "I" : "S", 1))
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "write");
-    GNUNET_break (0 == CLOSE (sctx.ready_confirm_fd));
-  }
+    {
+      if (1 != WRITE (sctx.ready_confirm_fd, err ? "I" : "S", 1))
+       LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "write");
+      GNUNET_break (0 == CLOSE (sctx.ready_confirm_fd));
+    }
 
   GNUNET_CONFIGURATION_destroy (cfg);
   i = 0;
@@ -1632,13 +1649,13 @@
  */
 struct GNUNET_SERVICE_Context *
 GNUNET_SERVICE_start (const char *serviceName,
-                      const struct GNUNET_CONFIGURATION_Handle *cfg)
+                     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int i;
   struct GNUNET_SERVICE_Context *sctx;
 
   sctx = GNUNET_malloc (sizeof (struct GNUNET_SERVICE_Context));
-  sctx->ready_confirm_fd = -1;  /* no daemonizing */
+  sctx->ready_confirm_fd = -1; /* no daemonizing */
   sctx->ret = GNUNET_OK;
   sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
   sctx->serviceName = serviceName;
@@ -1646,24 +1663,24 @@
 
   /* setup subsystems */
   if (GNUNET_OK != setup_service (sctx))
-  {
-    GNUNET_SERVICE_stop (sctx);
-    return NULL;
-  }
+    {
+      GNUNET_SERVICE_stop (sctx);
+      return NULL;
+    }
   if (sctx->lsocks != NULL)
     sctx->server =
-        GNUNET_SERVER_create_with_sockets (&check_access, sctx, sctx->lsocks,
-                                           sctx->timeout, sctx->require_found);
+      GNUNET_SERVER_create_with_sockets (&check_access, sctx, sctx->lsocks,
+                                        sctx->timeout, sctx->require_found);
   else
     sctx->server =
-        GNUNET_SERVER_create (&check_access, sctx, sctx->addrs, sctx->addrlens,
-                              sctx->timeout, sctx->require_found);
+      GNUNET_SERVER_create (&check_access, sctx, sctx->addrs, sctx->addrlens,
+                           sctx->timeout, sctx->require_found);
 
   if (NULL == sctx->server)
-  {
-    GNUNET_SERVICE_stop (sctx);
-    return NULL;
-  }
+    {
+      GNUNET_SERVICE_stop (sctx);
+      return NULL;
+    }
   sctx->my_handlers = GNUNET_malloc (sizeof (defhandlers));
   memcpy (sctx->my_handlers, defhandlers, sizeof (defhandlers));
   i = 0;
@@ -1701,12 +1718,12 @@
     GNUNET_SERVER_destroy (sctx->server);
   GNUNET_free_non_null (sctx->my_handlers);
   if (sctx->addrs != NULL)
-  {
-    i = 0;
-    while (sctx->addrs[i] != NULL)
-      GNUNET_free (sctx->addrs[i++]);
-    GNUNET_free (sctx->addrs);
-  }
+    {
+      i = 0;
+      while (sctx->addrs[i] != NULL)
+       GNUNET_free (sctx->addrs[i++]);
+      GNUNET_free (sctx->addrs);
+    }
   GNUNET_free_non_null (sctx->addrlens);
   GNUNET_free_non_null (sctx->v4_denied);
   GNUNET_free_non_null (sctx->v6_denied);

Modified: gnunet/src/util/signal.c
===================================================================
--- gnunet/src/util/signal.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/signal.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -28,6 +28,9 @@
 #include "gnunet_common.h"
 #include "gnunet_signal_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+
 struct GNUNET_SIGNAL_Context
 {
   int sig;
@@ -60,7 +63,7 @@
   sig.sa_handler = (void *) handler;
   sigemptyset (&sig.sa_mask);
 #ifdef SA_INTERRUPT
-  sig.sa_flags = SA_INTERRUPT;  /* SunOS */
+  sig.sa_flags = SA_INTERRUPT; /* SunOS */
 #else
   sig.sa_flags = SA_RESTART;
 #endif
@@ -69,15 +72,15 @@
   if (signum == GNUNET_SIGCHLD)
     w32_sigchld_handler = handler;
   else
-  {
-    __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler);
+    {
+      __p_sig_fn_t sigret = signal (signum, (__p_sig_fn_t) handler);
 
-    if (sigret == SIG_ERR)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("signal (%d, %p) returned %d.\n"), signum, handler, 
sigret);
+      if (sigret == SIG_ERR)
+       {
+         LOG (GNUNET_ERROR_TYPE_WARNING,
+              _("signal (%d, %p) returned %d.\n"), signum, handler, sigret);
+       }
     }
-  }
 #endif
   return ret;
 }

Modified: gnunet/src/util/strings.c
===================================================================
--- gnunet/src/util/strings.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/strings.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -32,7 +32,11 @@
 #include "gnunet_common.h"
 #include "gnunet_strings_lib.h"
 
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", 
syscall)
+
+
 /**
  * Fill a buffer of the given size with
  * count 0-terminated strings (given as varargs).
@@ -55,7 +59,8 @@
  *         (or number of bytes that would have been written)
  */
 size_t
-GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count, ...)
+GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count,
+                           ...)
 {
   size_t needed;
   size_t slen;
@@ -65,18 +70,18 @@
   needed = 0;
   va_start (ap, count);
   while (count > 0)
-  {
-    s = va_arg (ap, const char *);
+    {
+      s = va_arg (ap, const char *);
 
-    slen = strlen (s) + 1;
-    if (buffer != NULL)
-    {
-      GNUNET_assert (needed + slen <= size);
-      memcpy (&buffer[needed], s, slen);
+      slen = strlen (s) + 1;
+      if (buffer != NULL)
+       {
+         GNUNET_assert (needed + slen <= size);
+         memcpy (&buffer[needed], s, slen);
+       }
+      needed += slen;
+      count--;
     }
-    needed += slen;
-    count--;
-  }
   va_end (ap);
   return needed;
 }
@@ -97,7 +102,7 @@
  */
 unsigned int
 GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size,
-                                unsigned int count, ...)
+                               unsigned int count, ...)
 {
   unsigned int start;
   unsigned int needed;
@@ -107,21 +112,21 @@
   needed = 0;
   va_start (ap, count);
   while (count > 0)
-  {
-    r = va_arg (ap, const char **);
+    {
+      r = va_arg (ap, const char **);
 
-    start = needed;
-    while ((needed < size) && (buffer[needed] != '\0'))
-      needed++;
-    if (needed == size)
-    {
-      va_end (ap);
-      return 0;                 /* error */
+      start = needed;
+      while ((needed < size) && (buffer[needed] != '\0'))
+       needed++;
+      if (needed == size)
+       {
+         va_end (ap);
+         return 0;             /* error */
+       }
+      *r = &buffer[start];
+      needed++;                        /* skip 0-termination */
+      count--;
     }
-    *r = &buffer[start];
-    needed++;                   /* skip 0-termination */
-    count--;
-  }
   va_end (ap);
   return needed;
 }
@@ -140,25 +145,25 @@
   char *ret;
 
   if (size > 5 * 1024)
-  {
-    size = size / 1024;
-    unit = _( /* size unit */ "KiB");
-    if (size > 5 * 1024)
     {
       size = size / 1024;
-      unit = _( /* size unit */ "MiB");
+      unit = _( /* size unit */ "KiB");
       if (size > 5 * 1024)
-      {
-        size = size / 1024;
-        unit = _( /* size unit */ "GiB");
-        if (size > 5 * 1024)
-        {
-          size = size / 1024;
-          unit = _( /* size unit */ "TiB");
-        }
-      }
+       {
+         size = size / 1024;
+         unit = _( /* size unit */ "MiB");
+         if (size > 5 * 1024)
+           {
+             size = size / 1024;
+             unit = _( /* size unit */ "GiB");
+             if (size > 5 * 1024)
+               {
+                 size = size / 1024;
+                 unit = _( /* size unit */ "TiB");
+               }
+           }
+       }
     }
-  }
   ret = GNUNET_malloc (32);
   GNUNET_snprintf (ret, 32, "%llu %s", size, unit);
   return ret;
@@ -187,41 +192,41 @@
 
   cd = iconv_open ("UTF-8", charset);
   if (cd == (iconv_t) - 1)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv_open");
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("Character set requested was `%s'\n"), charset);
-    ret = GNUNET_malloc (len + 1);
-    memcpy (ret, input, len);
-    ret[len] = '\0';
-    return ret;
-  }
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "iconv_open");
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          _("Character set requested was `%s'\n"), charset);
+      ret = GNUNET_malloc (len + 1);
+      memcpy (ret, input, len);
+      ret[len] = '\0';
+      return ret;
+    }
   tmpSize = 3 * len + 4;
   tmp = GNUNET_malloc (tmpSize);
   itmp = tmp;
   finSize = tmpSize;
   if (iconv (cd,
 #if FREEBSD || DARWIN || WINDOWS
-             (const char **) &input,
+            (const char **) &input,
 #else
-             (char **) &input,
+            (char **) &input,
 #endif
-             &len, &itmp, &finSize) == SIZE_MAX)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv");
-    iconv_close (cd);
-    GNUNET_free (tmp);
-    ret = GNUNET_malloc (len + 1);
-    memcpy (ret, input, len);
-    ret[len] = '\0';
-    return ret;
-  }
+            &len, &itmp, &finSize) == SIZE_MAX)
+    {
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "iconv");
+      iconv_close (cd);
+      GNUNET_free (tmp);
+      ret = GNUNET_malloc (len + 1);
+      memcpy (ret, input, len);
+      ret[len] = '\0';
+      return ret;
+    }
   ret = GNUNET_malloc (tmpSize - finSize + 1);
   memcpy (ret, tmp, tmpSize - finSize);
   ret[tmpSize - finSize] = '\0';
   GNUNET_free (tmp);
   if (0 != iconv_close (cd))
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv_close");
+    LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "iconv_close");
   return ret;
 #else
   ret = GNUNET_malloc (len + 1);
@@ -262,89 +267,89 @@
     /* absolute path, just copy */
     return GNUNET_strdup (fil);
   if (fil[0] == '~')
-  {
-    fm = getenv ("HOME");
-    if (fm == NULL)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _
-                  ("Failed to expand `$HOME': environment variable `HOME' not 
set"));
-      return NULL;
+      fm = getenv ("HOME");
+      if (fm == NULL)
+       {
+         LOG (GNUNET_ERROR_TYPE_WARNING,
+              _
+              ("Failed to expand `$HOME': environment variable `HOME' not 
set"));
+         return NULL;
+       }
+      fm = GNUNET_strdup (fm);
+      /* do not copy '~' */
+      fil_ptr = fil + 1;
+
+      /* skip over dir seperator to be consistent */
+      if (fil_ptr[0] == DIR_SEPARATOR)
+       fil_ptr++;
     }
-    fm = GNUNET_strdup (fm);
-    /* do not copy '~' */
-    fil_ptr = fil + 1;
-
-    /* skip over dir seperator to be consistent */
-    if (fil_ptr[0] == DIR_SEPARATOR)
-      fil_ptr++;
-  }
   else
-  {
-    /* relative path */
-    fil_ptr = fil;
-    len = 512;
-    fm = NULL;
-    while (1)
     {
-      buffer = GNUNET_malloc (len);
-      if (getcwd (buffer, len) != NULL)
-      {
-        fm = buffer;
-        break;
-      }
-      if ((errno == ERANGE) && (len < 1024 * 1024 * 4))
-      {
-        len *= 2;
-        GNUNET_free (buffer);
-        continue;
-      }
-      GNUNET_free (buffer);
-      break;
+      /* relative path */
+      fil_ptr = fil;
+      len = 512;
+      fm = NULL;
+      while (1)
+       {
+         buffer = GNUNET_malloc (len);
+         if (getcwd (buffer, len) != NULL)
+           {
+             fm = buffer;
+             break;
+           }
+         if ((errno == ERANGE) && (len < 1024 * 1024 * 4))
+           {
+             len *= 2;
+             GNUNET_free (buffer);
+             continue;
+           }
+         GNUNET_free (buffer);
+         break;
+       }
+      if (fm == NULL)
+       {
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "getcwd");
+         buffer = getenv ("PWD");      /* alternative */
+         if (buffer != NULL)
+           fm = GNUNET_strdup (buffer);
+       }
+      if (fm == NULL)
+       fm = GNUNET_strdup ("./");      /* give up */
     }
-    if (fm == NULL)
-    {
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "getcwd");
-      buffer = getenv ("PWD");  /* alternative */
-      if (buffer != NULL)
-        fm = GNUNET_strdup (buffer);
-    }
-    if (fm == NULL)
-      fm = GNUNET_strdup ("./");        /* give up */
-  }
   n = strlen (fm) + 1 + strlen (fil_ptr) + 1;
   buffer = GNUNET_malloc (n);
   GNUNET_snprintf (buffer, n, "%s%s%s", fm,
-                   (fm[strlen (fm) - 1] ==
-                    DIR_SEPARATOR) ? "" : DIR_SEPARATOR_STR, fil_ptr);
+                  (fm[strlen (fm) - 1] ==
+                   DIR_SEPARATOR) ? "" : DIR_SEPARATOR_STR, fil_ptr);
   GNUNET_free (fm);
   return buffer;
 #else
   fn = GNUNET_malloc (MAX_PATH + 1);
 
   if ((lRet = plibc_conv_to_win_path (fil, fn)) != ERROR_SUCCESS)
-  {
-    SetErrnoFromWinError (lRet);
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "plibc_conv_to_win_path");
-    return NULL;
-  }
+    {
+      SetErrnoFromWinError (lRet);
+      LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "plibc_conv_to_win_path");
+      return NULL;
+    }
   /* is the path relative? */
   if ((strncmp (fn + 1, ":\\", 2) != 0) && (strncmp (fn, "\\\\", 2) != 0))
-  {
-    char szCurDir[MAX_PATH + 1];
+    {
+      char szCurDir[MAX_PATH + 1];
 
-    lRet = GetCurrentDirectory (MAX_PATH + 1, szCurDir);
-    if (lRet + strlen (fn) + 1 > (MAX_PATH + 1))
-    {
-      SetErrnoFromWinError (ERROR_BUFFER_OVERFLOW);
-      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "GetCurrentDirectory");
-      return NULL;
+      lRet = GetCurrentDirectory (MAX_PATH + 1, szCurDir);
+      if (lRet + strlen (fn) + 1 > (MAX_PATH + 1))
+       {
+         SetErrnoFromWinError (ERROR_BUFFER_OVERFLOW);
+         LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "GetCurrentDirectory");
+         return NULL;
+       }
+      buffer = GNUNET_malloc (MAX_PATH + 1);
+      GNUNET_snprintf (buffer, MAX_PATH + 1, "%s\\%s", szCurDir, fn);
+      GNUNET_free (fn);
+      fn = buffer;
     }
-    buffer = GNUNET_malloc (MAX_PATH + 1);
-    GNUNET_snprintf (buffer, MAX_PATH + 1, "%s\\%s", szCurDir, fn);
-    GNUNET_free (fn);
-    fn = buffer;
-  }
 
   return fn;
 #endif
@@ -367,25 +372,25 @@
   if (delta.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
     return GNUNET_strdup (_("eternity"));
   if (dval > 5 * 1000)
-  {
-    dval = dval / 1000;
-    unit = _( /* time unit */ "s");
-    if (dval > 5 * 60)
     {
-      dval = dval / 60;
-      unit = _( /* time unit */ "m");
+      dval = dval / 1000;
+      unit = _( /* time unit */ "s");
       if (dval > 5 * 60)
-      {
-        dval = dval / 60;
-        unit = _( /* time unit */ "h");
-        if (dval > 5 * 24)
-        {
-          dval = dval / 24;
-          unit = _( /* time unit */ " days");
-        }
-      }
+       {
+         dval = dval / 60;
+         unit = _( /* time unit */ "m");
+         if (dval > 5 * 60)
+           {
+             dval = dval / 60;
+             unit = _( /* time unit */ "h");
+             if (dval > 5 * 24)
+               {
+                 dval = dval / 24;
+                 unit = _( /* time unit */ " days");
+               }
+           }
+       }
     }
-  }
   GNUNET_asprintf (&ret, "%llu %s", dval, unit);
   return ret;
 }

Modified: gnunet/src/util/test_bio.c
===================================================================
--- gnunet/src/util/test_bio.c  2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_bio.c  2011-10-11 09:43:04 UTC (rev 17362)
@@ -57,16 +57,17 @@
   GNUNET_assert (NULL != fileR);
   readResultString = NULL;
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResultString, 200));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResultString, 200));
   GNUNET_assert (NULL != readResultString);
   GNUNET_assert (0 == strcmp (TESTSTRING, readResultString));
   GNUNET_free (readResultString);
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
-                                            &metaDataR));
+                GNUNET_BIO_read_meta_data (fileR, "Read meta error",
+                                           &metaDataR));
   GNUNET_assert (GNUNET_YES ==
-                 GNUNET_CONTAINER_meta_data_test_equal (metaDataR, metaDataW));
+                GNUNET_CONTAINER_meta_data_test_equal (metaDataR,
+                                                       metaDataW));
   GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_int64 (fileR, &testNum));
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_CONTAINER_meta_data_destroy (metaDataW);
@@ -93,8 +94,8 @@
   fileR = GNUNET_BIO_read_open (fileName);
   GNUNET_assert (NULL != fileR);
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResultString, 200));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResultString, 200));
   GNUNET_assert (NULL == readResultString);
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
@@ -121,8 +122,8 @@
   GNUNET_assert (NULL != fileR);
   readResultString = NULL;
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResultString, 200));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResultString, 200));
   GNUNET_free (readResultString);
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
@@ -148,8 +149,8 @@
   GNUNET_assert (NULL != fileR);
   readResultString = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResultString, 1));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResultString, 1));
   GNUNET_assert (NULL == readResultString);
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
@@ -181,8 +182,8 @@
   GNUNET_assert (NULL != fileR);
   metaDataR = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
-                                            &metaDataR));
+                GNUNET_BIO_read_meta_data (fileR, "Read meta error",
+                                           &metaDataR));
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_free (msg);
@@ -203,8 +204,8 @@
   fileR = GNUNET_BIO_read_open ("/dev");
   GNUNET_assert (NULL != fileR);
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read (fileR, "Read error", readResult,
-                                  sizeof (readResult)));
+                GNUNET_BIO_read (fileR, "Read error", readResult,
+                                 sizeof (readResult)));
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_free (msg);
@@ -267,18 +268,18 @@
   fileR = GNUNET_BIO_read_open ("/dev/null");
   GNUNET_assert (NULL != fileR);
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read (fileR, "Read error", readResult,
-                                  sizeof (readResult)));
+                GNUNET_BIO_read (fileR, "Read error", readResult,
+                                 sizeof (readResult)));
   readResultString = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResultString, 200));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResultString, 200));
   GNUNET_assert (NULL == readResultString);
   GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read_int64 (fileR, &testNum));
   metaDataR = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
-                                            &metaDataR));
+                GNUNET_BIO_read_meta_data (fileR, "Read meta error",
+                                           &metaDataR));
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_free (msg);
@@ -305,8 +306,8 @@
   fileR = GNUNET_BIO_read_open (fileName);
   GNUNET_assert (NULL != fileR);
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_string (fileR, "Read string error",
-                                         &readResult, 200));
+                GNUNET_BIO_read_string (fileR, "Read string error",
+                                        &readResult, 200));
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_free (msg);
@@ -334,8 +335,8 @@
   GNUNET_assert (NULL != fileR);
   metaDataR = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
-                                            &metaDataR));
+                GNUNET_BIO_read_meta_data (fileR, "Read meta error",
+                                           &metaDataR));
   GNUNET_assert (NULL == metaDataR);
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
@@ -364,8 +365,8 @@
   GNUNET_assert (NULL != fileR);
   metaDataR = NULL;
   GNUNET_assert (GNUNET_SYSERR ==
-                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
-                                            &metaDataR));
+                GNUNET_BIO_read_meta_data (fileR, "Read meta error",
+                                           &metaDataR));
   msg = NULL;
   GNUNET_BIO_read_close (fileR, &msg);
   GNUNET_free (msg);

Modified: gnunet/src/util/test_client.c
===================================================================
--- gnunet/src/util/test_client.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_client.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -71,24 +71,25 @@
  */
 static void
 echo_cb (void *cls, struct GNUNET_SERVER_Client *client,
-         const struct GNUNET_MessageHeader *message)
+        const struct GNUNET_MessageHeader *message)
 {
   struct CopyContext *cc;
   struct GNUNET_MessageHeader *cpy;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Receiving message from client, bouncing back\n");
-  GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs 
(message->size));
+             "Receiving message from client, bouncing back\n");
+  GNUNET_assert (sizeof (struct GNUNET_MessageHeader) ==
+                ntohs (message->size));
   cc = GNUNET_malloc (sizeof (struct CopyContext));
   cc->client = client;
   cpy = GNUNET_malloc (ntohs (message->size));
   memcpy (cpy, message, ntohs (message->size));
   cc->cpy = cpy;
   GNUNET_assert (NULL !=
-                 GNUNET_SERVER_notify_transmit_ready (client,
-                                                      ntohs (message->size),
-                                                      GNUNET_TIME_UNIT_SECONDS,
-                                                      &copy_msg, cc));
+                GNUNET_SERVER_notify_transmit_ready (client,
+                                                     ntohs (message->size),
+                                                     GNUNET_TIME_UNIT_SECONDS,
+                                                     &copy_msg, cc));
 }
 
 
@@ -104,11 +105,13 @@
   int *ok = cls;
   struct GNUNET_MessageHeader msg;
 
-  GNUNET_assert (got != NULL);  /* timeout */
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving bounce, checking content\n");
+  GNUNET_assert (got != NULL); /* timeout */
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Receiving bounce, checking content\n");
   msg.type = htons (MY_TYPE);
   msg.size = htons (sizeof (struct GNUNET_MessageHeader));
-  GNUNET_assert (0 == memcmp (got, &msg, sizeof (struct 
GNUNET_MessageHeader)));
+  GNUNET_assert (0 ==
+                memcmp (got, &msg, sizeof (struct GNUNET_MessageHeader)));
   GNUNET_CLIENT_disconnect (client, GNUNET_YES);
   client = NULL;
   GNUNET_SERVER_destroy (server);
@@ -148,9 +151,9 @@
   sa.sin_family = AF_INET;
   sa.sin_port = htons (PORT);
   server =
-      GNUNET_SERVER_create (NULL, NULL, sap, slens,
-                            GNUNET_TIME_relative_multiply
-                            (GNUNET_TIME_UNIT_MILLISECONDS, 10000), GNUNET_NO);
+    GNUNET_SERVER_create (NULL, NULL, sap, slens,
+                         GNUNET_TIME_relative_multiply
+                         (GNUNET_TIME_UNIT_MILLISECONDS, 10000), GNUNET_NO);
   GNUNET_assert (server != NULL);
   handlers[0].callback_cls = cls;
   handlers[1].callback_cls = cls;
@@ -158,15 +161,15 @@
   client = GNUNET_CLIENT_connect (MYNAME, cfg);
   GNUNET_assert (client != NULL);
   GNUNET_assert (NULL !=
-                 GNUNET_CLIENT_notify_transmit_ready (client,
-                                                      sizeof (struct
-                                                              
GNUNET_MessageHeader),
-                                                      GNUNET_TIME_UNIT_SECONDS,
-                                                      GNUNET_NO, &make_msg,
-                                                      NULL));
+                GNUNET_CLIENT_notify_transmit_ready (client,
+                                                     sizeof (struct
+                                                             
GNUNET_MessageHeader),
+                                                     GNUNET_TIME_UNIT_SECONDS,
+                                                     GNUNET_NO, &make_msg,
+                                                     NULL));
   GNUNET_CLIENT_receive (client, &recv_bounce, cls,
-                         GNUNET_TIME_relative_multiply
-                         (GNUNET_TIME_UNIT_MILLISECONDS, 10000));
+                        GNUNET_TIME_relative_multiply
+                        (GNUNET_TIME_UNIT_MILLISECONDS, 10000));
 }
 
 
@@ -181,9 +184,10 @@
 
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_number (cfg, MYNAME, "PORT", PORT);
-  GNUNET_CONFIGURATION_set_value_string (cfg, MYNAME, "HOSTNAME", "localhost");
+  GNUNET_CONFIGURATION_set_value_string (cfg, MYNAME, "HOSTNAME",
+                                        "localhost");
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   ok = 1;
   GNUNET_SCHEDULER_run (&task, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
@@ -197,11 +201,11 @@
 
   GNUNET_log_setup ("test_client",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check ();
 
   return ret;

Modified: gnunet/src/util/test_common_allocation.c
===================================================================
--- gnunet/src/util/test_common_allocation.c    2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_common_allocation.c    2011-10-11 09:43:04 UTC (rev 
17362)
@@ -36,21 +36,21 @@
   unsigned int ui;
 
   /* GNUNET_malloc/GNUNET_free test */
-  k = 352;                      /* random start value */
+  k = 352;                     /* random start value */
   for (i = 1; i < MAX_TESTVAL; i++)
-  {
-    ptrs[i] = GNUNET_malloc (i);
-    for (j = 0; j < i; j++)
-      ptrs[i][j] = k++;
-  }
+    {
+      ptrs[i] = GNUNET_malloc (i);
+      for (j = 0; j < i; j++)
+       ptrs[i][j] = k++;
+    }
 
   for (i = MAX_TESTVAL - 1; i >= 1; i--)
-  {
-    for (j = i - 1; j >= 0; j--)
-      if (ptrs[i][j] != (char) --k)
-        return 1;
-    GNUNET_free (ptrs[i]);
-  }
+    {
+      for (j = i - 1; j >= 0; j--)
+       if (ptrs[i][j] != (char) --k)
+         return 1;
+      GNUNET_free (ptrs[i]);
+    }
 
   /* GNUNET_free_non_null test */
   GNUNET_free_non_null (NULL);

Modified: gnunet/src/util/test_common_logging.c
===================================================================
--- gnunet/src/util/test_common_logging.c       2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_common_logging.c       2011-10-11 09:43:04 UTC (rev 
17362)
@@ -28,7 +28,7 @@
 
 static void
 my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
-        const char *date, const char *msg)
+       const char *date, const char *msg)
 {
   unsigned int *c = ctx;
 
@@ -57,23 +57,26 @@
   /* the last 6 calls should be merged (repated bulk messages!) */
   GNUNET_logger_remove (&my_log, &logs);
   if (logs != 4)
-  {
-    fprintf (stdout, "Expected 4 log calls, got %u\n", logs);
-    failureCount++;
-  }
+    {
+      fprintf (stdout, "Expected 4 log calls, got %u\n", logs);
+      failureCount++;
+    }
   GNUNET_break (0 ==
-                strcmp (_("ERROR"),
-                        GNUNET_error_type_to_string 
(GNUNET_ERROR_TYPE_ERROR)));
+               strcmp (_("ERROR"),
+                       GNUNET_error_type_to_string
+                       (GNUNET_ERROR_TYPE_ERROR)));
   GNUNET_break (0 ==
-                strcmp (_("WARNING"),
-                        GNUNET_error_type_to_string
-                        (GNUNET_ERROR_TYPE_WARNING)));
+               strcmp (_("WARNING"),
+                       GNUNET_error_type_to_string
+                       (GNUNET_ERROR_TYPE_WARNING)));
   GNUNET_break (0 ==
-                strcmp (_("INFO"),
-                        GNUNET_error_type_to_string (GNUNET_ERROR_TYPE_INFO)));
+               strcmp (_("INFO"),
+                       GNUNET_error_type_to_string
+                       (GNUNET_ERROR_TYPE_INFO)));
   GNUNET_break (0 ==
-                strcmp (_("DEBUG"),
-                        GNUNET_error_type_to_string 
(GNUNET_ERROR_TYPE_DEBUG)));
+               strcmp (_("DEBUG"),
+                       GNUNET_error_type_to_string
+                       (GNUNET_ERROR_TYPE_DEBUG)));
   GNUNET_log_setup ("test_common_logging", "WARNING", "/dev/null");
   logs = 0;
   GNUNET_logger_add (&my_log, &logs);
@@ -81,17 +84,17 @@
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Drop me...\n");
   GNUNET_logger_remove (&my_log, &logs);
   if (logs != 1)
-  {
-    fprintf (stdout, "Expected 1 log call, got %u\n", logs);
-    failureCount++;
-  }
+    {
+      fprintf (stdout, "Expected 1 log call, got %u\n", logs);
+      failureCount++;
+    }
 
   if (failureCount != 0)
-  {
-    fprintf (stdout, "%u TESTS FAILED!\n", failureCount);
-    return -1;
-  }
+    {
+      fprintf (stdout, "%u TESTS FAILED!\n", failureCount);
+      return -1;
+    }
   return 0;
-}                               /* end of main */
+}                              /* end of main */
 
 /* end of test_common_logging.c */

Modified: gnunet/src/util/test_common_logging_dummy.c
===================================================================
--- gnunet/src/util/test_common_logging_dummy.c 2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_common_logging_dummy.c 2011-10-11 09:43:04 UTC (rev 
17362)
@@ -33,7 +33,7 @@
 
 static void
 my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
-        const char *date, const char *msg)
+       const char *date, const char *msg)
 {
   if (strncmp ("test-common-logging-dummy", component, 25) != 0)
     return;
@@ -87,6 +87,6 @@
   pr2 (GNUNET_ERROR_TYPE_INFO, "INFO");
   pr2 (GNUNET_ERROR_TYPE_DEBUG, "DEBUG");
   return 0;
-} /* end of main */
+}                              /* end of main */
 
 /* end of test_common_logging_dummy.c */

Modified: gnunet/src/util/test_common_logging_runtime_loglevels.c
===================================================================
--- gnunet/src/util/test_common_logging_runtime_loglevels.c     2011-10-11 
08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_common_logging_runtime_loglevels.c     2011-10-11 
09:43:04 UTC (rev 17362)
@@ -47,34 +47,35 @@
 static void
 end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase, 
ok);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase,
+             ok);
   if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
-  }
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
+    }
   GNUNET_OS_process_wait (proc);
   GNUNET_OS_process_close (proc);
   proc = NULL;
   GNUNET_DISK_pipe_close (pipe_stdout);
   if (ok == 1)
-  {
-    if (phase < 9)
     {
-      phase += 1;
-      runone ();
+      if (phase < 9)
+       {
+         phase += 1;
+         runone ();
+       }
+      else
+       ok = 0;
     }
-    else
-      ok = 0;
-  }
   else
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "failing\n");
 }
 
 static char *
 read_output_line (int phase_from1, int phase_to1, int phase_from2,
-                  int phase_to2, char c, char *expect_level,
-                  long delay_morethan, long delay_lessthan, int phase, char *p,
-                  int *len, long *delay, char level[8])
+                 int phase_to2, char c, char *expect_level,
+                 long delay_morethan, long delay_lessthan, int phase,
+                 char *p, int *len, long *delay, char level[8])
 {
   char *r = p;
   char t[7];
@@ -82,67 +83,71 @@
   j = 0;
   int stage = 0;
   if (!(phase >= phase_from1 && phase <= phase_to1) &&
-     !(phase >= phase_from2 && phase <= phase_to2))
+      !(phase >= phase_from2 && phase <= phase_to2))
     return p;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to match '%c%s \\d\\r\\n' on 
%s\n", c, expect_level, p);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Trying to match '%c%s \\d\\r\\n' on %s\n", c, expect_level, p);
   for (i = 0; i < *len && !stop; i++)
-  {
-    switch (stage)
     {
-    case 0: /* read first char */
-      if (r[i] != c)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected '%c', but got '%c'\n", 
c, r[i]);
-        GNUNET_break (0);
-        return NULL;
-      }
-      stage += 1;
-      break;
-    case 1:  /* read at most 7 char-long error level string, finished by ' ' */
-      if (r[i] == ' ')
-      {
-        level[j] = '\0';
-        stage += 1;
-        j = 0;
-      }
-      else if (i == 8)
-      {
-        GNUNET_break (0);
-        ok = 2;
-        return NULL;
-      }
-      else
-        level[j++] = r[i];
-      break;
-    case 2: /* read the delay, finished by '\n' */
-      t[j++] = r[i];
+      switch (stage)
+       {
+       case 0:         /* read first char */
+         if (r[i] != c)
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Expected '%c', but got '%c'\n", c, r[i]);
+             GNUNET_break (0);
+             return NULL;
+           }
+         stage += 1;
+         break;
+       case 1:         /* read at most 7 char-long error level string, 
finished by ' ' */
+         if (r[i] == ' ')
+           {
+             level[j] = '\0';
+             stage += 1;
+             j = 0;
+           }
+         else if (i == 8)
+           {
+             GNUNET_break (0);
+             ok = 2;
+             return NULL;
+           }
+         else
+           level[j++] = r[i];
+         break;
+       case 2:         /* read the delay, finished by '\n' */
+         t[j++] = r[i];
 #if WINDOWS
-      if (r[i] == '\r' && r[i + 1] == '\n')
-      {
-        i += 1;
-        t[j - 1] = '\0';
-        *delay = strtol (t, NULL, 10);
-        stop = 1;
-      }
+         if (r[i] == '\r' && r[i + 1] == '\n')
+           {
+             i += 1;
+             t[j - 1] = '\0';
+             *delay = strtol (t, NULL, 10);
+             stop = 1;
+           }
 #else
-      if (r[i] == '\n')
-      {
-        t[j - 1] = '\0';
-        *delay = strtol (t, NULL, 10);
-        stop = 1;
-      }
+         if (r[i] == '\n')
+           {
+             t[j - 1] = '\0';
+             *delay = strtol (t, NULL, 10);
+             stop = 1;
+           }
 #endif
-      break;
+         break;
+       }
     }
-  }
-  if (!stop || strcmp (expect_level, level) != 0 || *delay < 0 || *delay > 
1000 ||
-      (!((*delay < delay_lessthan) || !(*delay > delay_morethan)) && c != '1' 
&& c != '2'))
+  if (!stop || strcmp (expect_level, level) != 0 || *delay < 0
+      || *delay > 1000
+      || (!((*delay < delay_lessthan) || !(*delay > delay_morethan))
+         && c != '1' && c != '2'))
     return NULL;
   *len = *len - i;
   return &r[i];
 }
 
-char buf[20*16];
+char buf[20 * 16];
 char *buf_ptr;
 int bytes;
 
@@ -155,19 +160,20 @@
   long delays[8];
   int rd;
 
-  rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, sizeof (buf) - 
bytes);
+  rd =
+    GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, sizeof (buf) - bytes);
   if (rd > 0)
-  {
-    buf_ptr += rd;
-    bytes += rd;
+    {
+      buf_ptr += rd;
+      bytes += rd;
 #if VERBOSE
-    fprintf (stderr, "got %d bytes, reading more\n", rd);
+      fprintf (stderr, "got %d bytes, reading more\n", rd);
 #endif
-    GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
-                                    stdout_read_handle, &read_call,
-                                    (void *) stdout_read_handle);
-    return;
-  }
+      GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+                                     stdout_read_handle, &read_call,
+                                     (void *) stdout_read_handle);
+      return;
+    }
 
 #if VERBOSE
   fprintf (stderr, "bytes is %d:%s\n", bytes, buf);
@@ -189,32 +195,64 @@
    * | 9  * *      * *
    */
   char *p = buf;
-  if (bytes == 20*16 ||
-      !(p = read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '1', "ERROR", 200, 400, phase, p, 
&bytes, &delays[0], level)) ||
-      !(p = read_output_line (1, 3, 5, 9, 'L', "WARNING", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '1', "WARNING", 200, 400, phase, p, 
&bytes, &delays[1], level)) ||
-      !(p = read_output_line (2, 3, 6, 7, 'L', "INFO", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '1', "INFO", 200, 400, phase, p, 
&bytes, &delays[2], level)) ||
-      !(p = read_output_line (3, 3, 7, 7, 'L', "DEBUG", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '1', "DEBUG", 200, 400, phase, p, 
&bytes, &delays[3], level)) ||
-      !(p = read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '2', "ERROR", 200, 400, phase, p, 
&bytes, &delays[4], level)) ||
-      !(p = read_output_line (0, 3, 5, 9, 'L', "WARNING", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '2', "WARNING", 200, 400, phase, p, 
&bytes, &delays[5], level)) ||
-      !(p = read_output_line (-1, -1, 6, 7, 'L', "INFO", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '2', "INFO", 200, 400, phase, p, 
&bytes, &delays[6], level)) ||
-      !(p = read_output_line (-1, -1, 7, 7, 'L', "DEBUG", -1, 1, phase, p, 
&bytes, &delay, level)) ||
-      !(p = read_output_line (0, 3, 4, 9, '2', "DEBUG", 200, 400, phase, p, 
&bytes, &delays[7], level)))
-  {
-    if (bytes == 20*16)
-      fprintf (stderr, "Ran out of buffer space!\n");
-    GNUNET_break (0);
-    ok = 2;
-    GNUNET_SCHEDULER_cancel (die_task);
-    GNUNET_SCHEDULER_add_now (&end_task, NULL);
-    return;
-  }
+  if (bytes == 20 * 16 ||
+      !(p =
+       read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, 1, phase, p, &bytes,
+                         &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '1', "ERROR", 200, 400, phase, p,
+                            &bytes, &delays[0], level))
+      || !(p =
+          read_output_line (1, 3, 5, 9, 'L', "WARNING", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '1', "WARNING", 200, 400, phase, p,
+                            &bytes, &delays[1], level))
+      || !(p =
+          read_output_line (2, 3, 6, 7, 'L', "INFO", -1, 1, phase, p, &bytes,
+                            &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '1', "INFO", 200, 400, phase, p,
+                            &bytes, &delays[2], level))
+      || !(p =
+          read_output_line (3, 3, 7, 7, 'L', "DEBUG", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '1', "DEBUG", 200, 400, phase, p,
+                            &bytes, &delays[3], level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, 'L', "ERROR", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '2', "ERROR", 200, 400, phase, p,
+                            &bytes, &delays[4], level))
+      || !(p =
+          read_output_line (0, 3, 5, 9, 'L', "WARNING", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '2', "WARNING", 200, 400, phase, p,
+                            &bytes, &delays[5], level))
+      || !(p =
+          read_output_line (-1, -1, 6, 7, 'L', "INFO", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '2', "INFO", 200, 400, phase, p,
+                            &bytes, &delays[6], level))
+      || !(p =
+          read_output_line (-1, -1, 7, 7, 'L', "DEBUG", -1, 1, phase, p,
+                            &bytes, &delay, level))
+      || !(p =
+          read_output_line (0, 3, 4, 9, '2', "DEBUG", 200, 400, phase, p,
+                            &bytes, &delays[7], level)))
+    {
+      if (bytes == 20 * 16)
+       fprintf (stderr, "Ran out of buffer space!\n");
+      GNUNET_break (0);
+      ok = 2;
+      GNUNET_SCHEDULER_cancel (die_task);
+      GNUNET_SCHEDULER_add_now (&end_task, NULL);
+      return;
+    }
 
   GNUNET_SCHEDULER_cancel (die_task);
   GNUNET_SCHEDULER_add_now (&end_task, NULL);
@@ -228,52 +266,52 @@
   pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_NO, GNUNET_YES);
 
   if (pipe_stdout == NULL)
-  {
-    GNUNET_break (0);
-    ok = 2;
-    return;
-  }
+    {
+      GNUNET_break (0);
+      ok = 2;
+      return;
+    }
 
   putenv ("GNUNET_LOG=");
   putenv ("GNUNET_FORCE_LOG=");
   switch (phase)
-  {
-  case 0:
-    putenv ("GNUNET_LOG=;;;;ERROR");
-    break;
-  case 1:
-    putenv ("GNUNET_LOG=;;;;WARNING");
-    break;
-  case 2:
-    putenv ("GNUNET_LOG=;;;;INFO");
-    break;
-  case 3:
-    putenv ("GNUNET_LOG=;;;;DEBUG");
-    break;
-  case 4:
-    putenv ("GNUNET_FORCE_LOG=;;;;ERROR");
-    break;
-  case 5:
-    putenv ("GNUNET_FORCE_LOG=;;;;WARNING");
-    break;
-  case 6:
-    putenv ("GNUNET_FORCE_LOG=;;;;INFO");
-    break;
-  case 7:
-    putenv ("GNUNET_FORCE_LOG=;;;;DEBUG");
-    break;
-  case 8:
-    putenv ("GNUNET_LOG=blah;;;;ERROR");
-    break;
-  case 9:
-    putenv ("GNUNET_FORCE_LOG=blah;;;;ERROR");
-    break;
-  }
+    {
+    case 0:
+      putenv ("GNUNET_LOG=;;;;ERROR");
+      break;
+    case 1:
+      putenv ("GNUNET_LOG=;;;;WARNING");
+      break;
+    case 2:
+      putenv ("GNUNET_LOG=;;;;INFO");
+      break;
+    case 3:
+      putenv ("GNUNET_LOG=;;;;DEBUG");
+      break;
+    case 4:
+      putenv ("GNUNET_FORCE_LOG=;;;;ERROR");
+      break;
+    case 5:
+      putenv ("GNUNET_FORCE_LOG=;;;;WARNING");
+      break;
+    case 6:
+      putenv ("GNUNET_FORCE_LOG=;;;;INFO");
+      break;
+    case 7:
+      putenv ("GNUNET_FORCE_LOG=;;;;DEBUG");
+      break;
+    case 8:
+      putenv ("GNUNET_LOG=blah;;;;ERROR");
+      break;
+    case 9:
+      putenv ("GNUNET_FORCE_LOG=blah;;;;ERROR");
+      break;
+    }
 
   proc =
-      GNUNET_OS_start_process (NULL, pipe_stdout, 
-                              "./test_common_logging_dummy",
-                               "test_common_logging_dummy", NULL);
+    GNUNET_OS_start_process (NULL, pipe_stdout,
+                            "./test_common_logging_dummy",
+                            "test_common_logging_dummy", NULL);
   putenv ("GNUNET_FORCE_LOG=");
   putenv ("GNUNET_LOG=");
 
@@ -281,20 +319,20 @@
   GNUNET_DISK_pipe_close_end (pipe_stdout, GNUNET_DISK_PIPE_END_WRITE);
 
   stdout_read_handle =
-      GNUNET_DISK_pipe_handle (pipe_stdout, GNUNET_DISK_PIPE_END_READ);
+    GNUNET_DISK_pipe_handle (pipe_stdout, GNUNET_DISK_PIPE_END_READ);
 
   die_task =
-      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
-                                    (GNUNET_TIME_UNIT_SECONDS, 10), &end_task,
-                                    NULL);
+    GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
+                                 (GNUNET_TIME_UNIT_SECONDS, 10), &end_task,
+                                 NULL);
 
   bytes = 0;
   buf_ptr = buf;
   memset (&buf, 0, sizeof (buf));
 
   GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
-                                  stdout_read_handle, &read_call,
-                                  (void *) stdout_read_handle);
+                                 stdout_read_handle, &read_call,
+                                 (void *) stdout_read_handle);
 }
 
 static void
@@ -324,11 +362,11 @@
 
   GNUNET_log_setup ("test-common-logging-runtime-loglevels",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret = check ();
 
   return ret;

Modified: gnunet/src/util/test_configuration.c
===================================================================
--- gnunet/src/util/test_configuration.c        2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_configuration.c        2011-10-11 09:43:04 UTC (rev 
17362)
@@ -42,7 +42,7 @@
   REMOVE_ENTRY,
   COMPARE
 #if DEBUG
-      , PRINT
+    , PRINT
 #endif
 };
 
@@ -76,80 +76,80 @@
 */
 static void
 diffsCallBack (void *cls, const char *section, const char *option,
-               const char *value)
+              const char *value)
 {
   struct DiffsCBData *cbData = cls;
   int cbOption = cbData->callBackOption;
 
   switch (cbOption)
-  {
-  case EDIT_SECTION:
-    if (NULL == cbData->section)
-      cbData->section = section;
-    if (strcmp (cbData->section, section) == 0)
     {
+    case EDIT_SECTION:
+      if (NULL == cbData->section)
+       cbData->section = section;
+      if (strcmp (cbData->section, section) == 0)
+       {
+         GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option,
+                                                "new-value");
+         GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section,
+                                                option, "new-value");
+       }
+      break;
+    case EDIT_ALL:
       GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option,
-                                             "new-value");
-      GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, option,
-                                             "new-value");
-    }
-    break;
-  case EDIT_ALL:
-    GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, option,
-                                           "new-value");
-    GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section, option,
-                                           "new-value");
-    break;
-  case ADD_NEW_ENTRY:
-  {
-    static int hit = 0;
-
-    if (hit == 0)
-    {
-      hit = 1;
-      GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section, "new-key",
-                                             "new-value");
+                                            "new-value");
       GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section,
-                                             "new-key", "new-value");
-    }
-    break;
-  }
-  case COMPARE:
-  {
-    int ret;
-    char *diffValue;
+                                            option, "new-value");
+      break;
+    case ADD_NEW_ENTRY:
+      {
+       static int hit = 0;
 
-    diffValue = NULL;
-    ret =
-        GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section,
-                                               option, &diffValue);
-    if (NULL != diffValue)
-    {
-      if (ret == GNUNET_SYSERR || strcmp (diffValue, value) != 0)
-        cbData->status = 1;
-    }
-    else
-      cbData->status = 1;
-    GNUNET_free_non_null (diffValue);
-    break;
-  }
+       if (hit == 0)
+         {
+           hit = 1;
+           GNUNET_CONFIGURATION_set_value_string (cbData->cfg, section,
+                                                  "new-key", "new-value");
+           GNUNET_CONFIGURATION_set_value_string (cbData->cfgDiffs, section,
+                                                  "new-key", "new-value");
+         }
+       break;
+      }
+    case COMPARE:
+      {
+       int ret;
+       char *diffValue;
+
+       diffValue = NULL;
+       ret =
+         GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section,
+                                                option, &diffValue);
+       if (NULL != diffValue)
+         {
+           if (ret == GNUNET_SYSERR || strcmp (diffValue, value) != 0)
+             cbData->status = 1;
+         }
+       else
+         cbData->status = 1;
+       GNUNET_free_non_null (diffValue);
+       break;
+      }
 #if DEBUG
-  case PRINT:
-    if (NULL == cbData->section)
-    {
-      cbData->section = section;
-      printf ("\nSection: %s\n", section);
+    case PRINT:
+      if (NULL == cbData->section)
+       {
+         cbData->section = section;
+         printf ("\nSection: %s\n", section);
+       }
+      else if (strcmp (cbData->section, section) != 0)
+       {
+         cbData->section = section;
+         printf ("\nSection: %s\n", section);
+       }
+      printf ("%s = %s\n", option, value);
+#endif
+    default:
+      break;
     }
-    else if (strcmp (cbData->section, section) != 0)
-    {
-      cbData->section = section;
-      printf ("\nSection: %s\n", section);
-    }
-    printf ("%s = %s\n", option, value);
-#endif
-  default:
-    break;
-  }
 }
 
 
@@ -162,40 +162,41 @@
   diffsCB.cfgDiffs = GNUNET_CONFIGURATION_create ();
 
   switch (option)
-  {
-  case EDIT_SECTION:
-  case EDIT_ALL:
-  case ADD_NEW_ENTRY:
-    diffsCB.callBackOption = option;
-    diffsCB.cfg = cfg;
-    GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &diffsCB);
-    break;
-  case EDIT_NOTHING:
-    /* Do nothing */
-    break;
-  case ADD_NEW_SECTION:
-  {
-    int i;
-    char *key;
+    {
+    case EDIT_SECTION:
+    case EDIT_ALL:
+    case ADD_NEW_ENTRY:
+      diffsCB.callBackOption = option;
+      diffsCB.cfg = cfg;
+      GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &diffsCB);
+      break;
+    case EDIT_NOTHING:
+      /* Do nothing */
+      break;
+    case ADD_NEW_SECTION:
+      {
+       int i;
+       char *key;
 
-    for (i = 0; i < 5; i++)
-    {
-      GNUNET_asprintf (&key, "key%d", i);
-      GNUNET_CONFIGURATION_set_value_string (cfg, "new-section", key,
-                                             "new-value");
-      GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs, "new-section",
-                                             key, "new-value");
-      GNUNET_free (key);
+       for (i = 0; i < 5; i++)
+         {
+           GNUNET_asprintf (&key, "key%d", i);
+           GNUNET_CONFIGURATION_set_value_string (cfg, "new-section", key,
+                                                  "new-value");
+           GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs,
+                                                  "new-section", key,
+                                                  "new-value");
+           GNUNET_free (key);
+         }
+       break;
+      }
+    case REMOVE_SECTION:
+      break;
+    case REMOVE_ENTRY:
+      break;
+    default:
+      break;
     }
-    break;
-  }
-  case REMOVE_SECTION:
-    break;
-  case REMOVE_ENTRY:
-    break;
-  default:
-    break;
-  }
 
   return diffsCB.cfgDiffs;
 }
@@ -220,35 +221,37 @@
 
   /* Modify configuration and save it */
   cfgDiffs = editConfiguration (cfg, option);
-  diffsFileName = GNUNET_DISK_mktemp ("gnunet-test-configurations-diffs.conf");
+  diffsFileName =
+    GNUNET_DISK_mktemp ("gnunet-test-configurations-diffs.conf");
   if (diffsFileName == NULL)
-  {
-    GNUNET_break (0);
-    GNUNET_CONFIGURATION_destroy (cfg);
-    GNUNET_CONFIGURATION_destroy (cfgDiffs);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_CONFIGURATION_destroy (cfg);
+      GNUNET_CONFIGURATION_destroy (cfgDiffs);
+      return 1;
+    }
   GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, diffsFileName);
   GNUNET_CONFIGURATION_destroy (cfg);
 
   /* Compare the dumped configuration with modifications done */
   cfg = GNUNET_CONFIGURATION_create ();
-  GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_parse (cfg, diffsFileName));
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_CONFIGURATION_parse (cfg, diffsFileName));
   remove (diffsFileName);
   cbData.callBackOption = COMPARE;
   cbData.cfgDiffs = cfgDiffs;
   GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData);
   if (1 == (ret = cbData.status))
-  {
-    fprintf (stderr,
-             "Incorrect Configuration Diffs: Diffs may contain data not 
actually edited\n");
-    goto housekeeping;
-  }
+    {
+      fprintf (stderr,
+              "Incorrect Configuration Diffs: Diffs may contain data not 
actually edited\n");
+      goto housekeeping;
+    }
   cbData.cfgDiffs = cfg;
   GNUNET_CONFIGURATION_iterate (cfgDiffs, diffsCallBack, &cbData);
   if ((ret = cbData.status) == 1)
     fprintf (stderr,
-             "Incorrect Configuration Diffs: Data may be missing in diffs\n");
+            "Incorrect Configuration Diffs: Data may be missing in diffs\n");
 
 housekeeping:
 #if DEBUG
@@ -273,64 +276,65 @@
   char *c;
   unsigned long long l;
 
-  if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "test", "b", 
&c))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_string (cfg, "test", "b", &c))
     return 1;
   if (0 != strcmp ("b", c))
-  {
-    fprintf (stderr, "Got `%s'\n", c);
-    GNUNET_free (c);
-    return 2;
-  }
+    {
+      fprintf (stderr, "Got `%s'\n", c);
+      GNUNET_free (c);
+      return 2;
+    }
   GNUNET_free (c);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg, "test", "five", &l))
-  {
-    GNUNET_break (0);
-    return 3;
-  }
+    {
+      GNUNET_break (0);
+      return 3;
+    }
   if (5 != l)
-  {
-    GNUNET_break (0);
-    return 4;
-  }
+    {
+      GNUNET_break (0);
+      return 4;
+    }
   GNUNET_CONFIGURATION_set_value_string (cfg, "more", "c", "YES");
   if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_yesno (cfg, "more", "c"))
-  {
-    GNUNET_break (0);
-    return 5;
-  }
+    {
+      GNUNET_break (0);
+      return 5;
+    }
   GNUNET_CONFIGURATION_set_value_number (cfg, "NUMBERS", "TEN", 10);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg, "NUMBERS", "TEN", &c))
-  {
-    GNUNET_break (0);
-    return 6;
-  }
+    {
+      GNUNET_break (0);
+      return 6;
+    }
   if (0 != strcmp (c, "10"))
-  {
-    GNUNET_free (c);
-    GNUNET_break (0);
-    return 7;
-  }
+    {
+      GNUNET_free (c);
+      GNUNET_break (0);
+      return 7;
+    }
   GNUNET_free (c);
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (cfg, "last", "test", &c))
-  {
-    GNUNET_break (0);
-    return 8;
-  }
+    {
+      GNUNET_break (0);
+      return 8;
+    }
 #ifndef MINGW
   if (0 != strcmp (c, "/hello/world"))
 #else
 #define HI "\\hello\\world"
   if (strstr (c, HI) != c + strlen (c) - strlen (HI))
 #endif
-  {
-    GNUNET_break (0);
-    GNUNET_free (c);
-    return 9;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (c);
+      return 9;
+    }
   GNUNET_free (c);
 
   return 0;
@@ -350,10 +354,10 @@
   int *idx = data;
 
   if (0 == strcmp (want[*idx], fn))
-  {
-    (*idx)++;
-    return GNUNET_OK;
-  }
+    {
+      (*idx)++;
+      return GNUNET_OK;
+    }
   GNUNET_break (0);
   return GNUNET_SYSERR;
 }
@@ -366,66 +370,66 @@
   idx = 0;
   if (3 !=
       GNUNET_CONFIGURATION_iterate_value_filenames (cfg, "FILENAMES", "test",
-                                                    &check, &idx))
-  {
-    GNUNET_break (0);
-    return 8;
-  }
+                                                   &check, &idx))
+    {
+      GNUNET_break (0);
+      return 8;
+    }
   if (idx != 3)
     return 16;
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
-                                                  "/File Name"))
-  {
-    GNUNET_break (0);
-    return 24;
-  }
+                                                 "/File Name"))
+    {
+      GNUNET_break (0);
+      return 24;
+    }
 
   if (GNUNET_NO !=
       GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
-                                                  "/File Name"))
-  {
-    GNUNET_break (0);
-    return 32;
-  }
+                                                 "/File Name"))
+    {
+      GNUNET_break (0);
+      return 32;
+    }
   if (GNUNET_NO !=
       GNUNET_CONFIGURATION_remove_value_filename (cfg, "FILENAMES", "test",
-                                                  "Stuff"))
-  {
-    GNUNET_break (0);
-    return 40;
-  }
+                                                 "Stuff"))
+    {
+      GNUNET_break (0);
+      return 40;
+    }
 
   if (GNUNET_NO !=
       GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
-                                                  "/Hello"))
-  {
-    GNUNET_break (0);
-    return 48;
-  }
+                                                 "/Hello"))
+    {
+      GNUNET_break (0);
+      return 48;
+    }
   if (GNUNET_NO !=
       GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
-                                                  "/World"))
-  {
-    GNUNET_break (0);
-    return 56;
-  }
+                                                 "/World"))
+    {
+      GNUNET_break (0);
+      return 56;
+    }
 
   if (GNUNET_YES !=
       GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
-                                                  "/File 1"))
-  {
-    GNUNET_break (0);
-    return 64;
-  }
+                                                 "/File 1"))
+    {
+      GNUNET_break (0);
+      return 64;
+    }
 
   if (GNUNET_YES !=
       GNUNET_CONFIGURATION_append_value_filename (cfg, "FILENAMES", "test",
-                                                  "/File 2"))
-  {
-    GNUNET_break (0);
-    return 72;
-  }
+                                                 "/File 2"))
+    {
+      GNUNET_break (0);
+      return 72;
+    }
 
   idx = 0;
   want[1] = "/World";
@@ -433,16 +437,16 @@
   want[3] = "/File 2";
   if (4 !=
       GNUNET_CONFIGURATION_iterate_value_filenames (cfg, "FILENAMES", "test",
-                                                    &check, &idx))
-  {
-    GNUNET_break (0);
-    return 80;
-  }
+                                                   &check, &idx))
+    {
+      GNUNET_break (0);
+      return 80;
+    }
   if (idx != 4)
-  {
-    GNUNET_break (0);
-    return 88;
-  }
+    {
+      GNUNET_break (0);
+      return 88;
+    }
   return 0;
 }
 
@@ -458,11 +462,11 @@
   GNUNET_assert (cfg != NULL);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_parse (cfg, "test_configuration_data.conf"))
-  {
-    fprintf (stderr, "Failed to parse configuration file\n");
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
+    {
+      fprintf (stderr, "Failed to parse configuration file\n");
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
   failureCount += testConfig ();
   if (failureCount > 0)
     goto error;
@@ -472,36 +476,37 @@
     goto error;
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, "/tmp/gnunet-test.conf"))
-  {
-    fprintf (stderr, "Failed to write configuration file\n");
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
+    {
+      fprintf (stderr, "Failed to write configuration file\n");
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
   GNUNET_CONFIGURATION_destroy (cfg);
   GNUNET_assert (0 == UNLINK ("/tmp/gnunet-test.conf"));
 
   cfg = GNUNET_CONFIGURATION_create ();
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_load (cfg, "test_configuration_data.conf"))
-  {
-    GNUNET_break (0);
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING", "WEAKRANDOM", &c))
-  {
-    GNUNET_break (0);
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
+      GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING", "WEAKRANDOM",
+                                            &c))
+    {
+      GNUNET_break (0);
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
   if (0 != strcmp (c, "YES"))
-  {
-    GNUNET_break (0);
-    GNUNET_free (c);
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (c);
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
 
   GNUNET_free (c);
   GNUNET_CONFIGURATION_destroy (cfg);
@@ -509,11 +514,11 @@
   /* Testing configuration diffs */
   cfgDefault = GNUNET_CONFIGURATION_create ();
   if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfgDefault, NULL))
-  {
-    GNUNET_break (0);
-    GNUNET_CONFIGURATION_destroy (cfgDefault);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_CONFIGURATION_destroy (cfgDefault);
+      return 1;
+    }
 
   /* Nothing changed in the new configuration */
   failureCount += checkDiffs (cfgDefault, EDIT_NOTHING);
@@ -534,9 +539,9 @@
 
 error:
   if (failureCount != 0)
-  {
-    fprintf (stderr, "Test failed: %u\n", failureCount);
-    return 1;
-  }
+    {
+      fprintf (stderr, "Test failed: %u\n", failureCount);
+      return 1;
+    }
   return 0;
 }

Modified: gnunet/src/util/test_connection.c
===================================================================
--- gnunet/src/util/test_connection.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_connection.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -66,44 +66,46 @@
   GNUNET_assert (desc != NULL);
   if (GNUNET_NETWORK_socket_setsockopt
       (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 
"setsockopt");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+               "setsockopt");
   GNUNET_assert (GNUNET_NETWORK_socket_bind
-                 (desc, (const struct sockaddr *) &sa,
-                  sizeof (sa)) == GNUNET_OK);
+                (desc, (const struct sockaddr *) &sa,
+                 sizeof (sa)) == GNUNET_OK);
   GNUNET_NETWORK_socket_listen (desc, 5);
   return desc;
 }
 
 static void
 receive_check (void *cls, const void *buf, size_t available,
-               const struct sockaddr *addr, socklen_t addrlen, int errCode)
+              const struct sockaddr *addr, socklen_t addrlen, int errCode)
 {
   int *ok = cls;
 
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive validates incoming data\n");
 #endif
-  GNUNET_assert (buf != NULL);  /* no timeout */
+  GNUNET_assert (buf != NULL); /* no timeout */
   if (0 == memcmp (&"Hello World"[sofar], buf, available))
     sofar += available;
   if (sofar < 12)
-  {
+    {
 #if VERBOSE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n");
 #endif
-    GNUNET_CONNECTION_receive (asock, 1024,
-                               GNUNET_TIME_relative_multiply
-                               (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
-                               cls);
-  }
+      GNUNET_CONNECTION_receive (asock, 1024,
+                                GNUNET_TIME_relative_multiply
+                                (GNUNET_TIME_UNIT_SECONDS, 5),
+                                &receive_check, cls);
+    }
   else
-  {
+    {
 #if VERBOSE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive closes accepted socket\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Receive closes accepted socket\n");
 #endif
-    *ok = 0;
-    GNUNET_CONNECTION_destroy (asock, GNUNET_YES);
-  }
+      *ok = 0;
+      GNUNET_CONNECTION_destroy (asock, GNUNET_YES);
+    }
 }
 
 
@@ -122,12 +124,12 @@
   GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Test asks to receive on accepted socket\n");
+             "Test asks to receive on accepted socket\n");
 #endif
   GNUNET_CONNECTION_receive (asock, 1024,
-                             GNUNET_TIME_relative_multiply
-                             (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
-                             cls);
+                            GNUNET_TIME_relative_multiply
+                            (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
+                            cls);
 }
 
 static size_t
@@ -135,7 +137,7 @@
 {
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Test prepares to transmit on connect socket\n");
+             "Test prepares to transmit on connect socket\n");
 #endif
   GNUNET_assert (size >= 12);
   strcpy ((char *) buf, "Hello World");
@@ -158,14 +160,14 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n");
 #endif
   GNUNET_assert (NULL !=
-                 GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
-                                                          
GNUNET_TIME_UNIT_SECONDS,
-                                                          &make_hello, NULL));
+                GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
+                                                         
GNUNET_TIME_UNIT_SECONDS,
+                                                         &make_hello, NULL));
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n");
 #endif
-  GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls, &run_accept,
-                                 cls);
+  GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls,
+                                &run_accept, cls);
 }
 
 
@@ -181,7 +183,7 @@
   ok = 1;
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   GNUNET_SCHEDULER_run (&task, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
   return ok;
@@ -196,11 +198,11 @@
 
   GNUNET_log_setup ("test_connection",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check ();
   return ret;
 }

Modified: gnunet/src/util/test_connection_addressing.c
===================================================================
--- gnunet/src/util/test_connection_addressing.c        2011-10-11 08:58:17 UTC 
(rev 17361)
+++ gnunet/src/util/test_connection_addressing.c        2011-10-11 09:43:04 UTC 
(rev 17362)
@@ -66,15 +66,16 @@
   GNUNET_assert (desc != 0);
   if (GNUNET_NETWORK_socket_setsockopt
       (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 
"setsockopt");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+               "setsockopt");
   if (GNUNET_OK !=
       GNUNET_NETWORK_socket_bind (desc, (const struct sockaddr *) &sa,
-                                  sizeof (sa)))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                         "bind");
-    GNUNET_assert (0);
-  }
+                                 sizeof (sa)))
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                          "bind");
+      GNUNET_assert (0);
+    }
   GNUNET_NETWORK_socket_listen (desc, 5);
   return desc;
 }
@@ -82,25 +83,25 @@
 
 static void
 receive_check (void *cls, const void *buf, size_t available,
-               const struct sockaddr *addr, socklen_t addrlen, int errCode)
+              const struct sockaddr *addr, socklen_t addrlen, int errCode)
 {
   int *ok = cls;
 
-  GNUNET_assert (buf != NULL);  /* no timeout */
+  GNUNET_assert (buf != NULL); /* no timeout */
   if (0 == memcmp (&"Hello World"[sofar], buf, available))
     sofar += available;
   if (sofar < 12)
-  {
-    GNUNET_CONNECTION_receive (asock, 1024,
-                               GNUNET_TIME_relative_multiply
-                               (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
-                               cls);
-  }
+    {
+      GNUNET_CONNECTION_receive (asock, 1024,
+                                GNUNET_TIME_relative_multiply
+                                (GNUNET_TIME_UNIT_SECONDS, 5),
+                                &receive_check, cls);
+    }
   else
-  {
-    *ok = 0;
-    GNUNET_CONNECTION_destroy (asock, GNUNET_YES);
-  }
+    {
+      *ok = 0;
+      GNUNET_CONNECTION_destroy (asock, GNUNET_YES);
+    }
 }
 
 
@@ -116,7 +117,7 @@
   GNUNET_assert (asock != NULL);
   GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CONNECTION_get_address (asock, &addr, &alen));
+                GNUNET_CONNECTION_get_address (asock, &addr, &alen));
   GNUNET_assert (alen == sizeof (struct sockaddr_in));
   v4 = addr;
   memset (&expect, 0, sizeof (expect));
@@ -130,9 +131,9 @@
   GNUNET_free (addr);
   GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
   GNUNET_CONNECTION_receive (asock, 1024,
-                             GNUNET_TIME_relative_multiply
-                             (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
-                             cls);
+                            GNUNET_TIME_relative_multiply
+                            (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check,
+                            cls);
 }
 
 static size_t
@@ -159,17 +160,17 @@
   v4.sin_port = htons (PORT);
   v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
   csock =
-      GNUNET_CONNECTION_create_from_sockaddr (AF_INET,
-                                              (const struct sockaddr *) &v4,
-                                              sizeof (v4));
+    GNUNET_CONNECTION_create_from_sockaddr (AF_INET,
+                                           (const struct sockaddr *) &v4,
+                                           sizeof (v4));
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
-                 GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
-                                                          
GNUNET_TIME_UNIT_SECONDS,
-                                                          &make_hello, NULL));
+                GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
+                                                         
GNUNET_TIME_UNIT_SECONDS,
+                                                         &make_hello, NULL));
   GNUNET_CONNECTION_destroy (csock, GNUNET_YES);
-  GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls, &run_accept,
-                                 cls);
+  GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls,
+                                &run_accept, cls);
 }
 
 
@@ -196,11 +197,11 @@
 
   GNUNET_log_setup ("test_connection_addressing",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check ();
   return ret;
 }

Modified: gnunet/src/util/test_connection_receive_cancel.c
===================================================================
--- gnunet/src/util/test_connection_receive_cancel.c    2011-10-11 08:58:17 UTC 
(rev 17361)
+++ gnunet/src/util/test_connection_receive_cancel.c    2011-10-11 09:43:04 UTC 
(rev 17362)
@@ -65,10 +65,11 @@
   GNUNET_assert (desc != NULL);
   if (GNUNET_NETWORK_socket_setsockopt
       (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 
"setsockopt");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+               "setsockopt");
   GNUNET_assert (GNUNET_NETWORK_socket_bind
-                 (desc, (const struct sockaddr *) &sa,
-                  sizeof (sa)) == GNUNET_OK);
+                (desc, (const struct sockaddr *) &sa,
+                 sizeof (sa)) == GNUNET_OK);
   GNUNET_NETWORK_socket_listen (desc, 5);
   return desc;
 }
@@ -77,7 +78,7 @@
 
 static void
 dead_receive (void *cls, const void *buf, size_t available,
-              const struct sockaddr *addr, socklen_t addrlen, int errCode)
+             const struct sockaddr *addr, socklen_t addrlen, int errCode)
 {
   GNUNET_assert (0);
 }
@@ -92,8 +93,9 @@
   GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
   GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
   GNUNET_CONNECTION_receive (asock, 1024,
-                             GNUNET_TIME_relative_multiply
-                             (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive, 
cls);
+                            GNUNET_TIME_relative_multiply
+                            (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive,
+                            cls);
 }
 
 
@@ -119,9 +121,9 @@
   csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, ls,
-                                 &run_accept_cancel, cls);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &receive_cancel_task,
-                                cls);
+                                &run_accept_cancel, cls);
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                               &receive_cancel_task, cls);
 }
 
 
@@ -137,7 +139,7 @@
   ok = 1;
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   GNUNET_SCHEDULER_run (&task_receive_cancel, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
   return ok;

Modified: gnunet/src/util/test_connection_timeout.c
===================================================================
--- gnunet/src/util/test_connection_timeout.c   2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_connection_timeout.c   2011-10-11 09:43:04 UTC (rev 
17362)
@@ -62,10 +62,11 @@
   GNUNET_assert (desc != NULL);
   if (GNUNET_NETWORK_socket_setsockopt
       (desc, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)) != GNUNET_OK)
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 
"setsockopt");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+               "setsockopt");
   GNUNET_assert (GNUNET_NETWORK_socket_bind
-                 (desc, (const struct sockaddr *) &sa,
-                  sizeof (sa)) == GNUNET_OK);
+                (desc, (const struct sockaddr *) &sa,
+                 sizeof (sa)) == GNUNET_OK);
   GNUNET_NETWORK_socket_listen (desc, 5);
   return desc;
 }
@@ -77,16 +78,16 @@
   int *ok = cls;
 
   if (size == 0)
-  {
+    {
 #if VERBOSE
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got the desired timeout!\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got the desired timeout!\n");
 #endif
-    GNUNET_assert (buf == NULL);
-    *ok = 0;
-    GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
-    GNUNET_CONNECTION_destroy (csock, GNUNET_YES);
-    return 0;
-  }
+      GNUNET_assert (buf == NULL);
+      *ok = 0;
+      GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
+      GNUNET_CONNECTION_destroy (csock, GNUNET_YES);
+      return 0;
+    }
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending kilo to fill buffer.\n");
 #endif
@@ -94,9 +95,9 @@
   memset (buf, 42, 1024);
 
   GNUNET_assert (NULL !=
-                 GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
-                                                          
GNUNET_TIME_UNIT_SECONDS,
-                                                          &send_kilo, cls));
+                GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
+                                                         
GNUNET_TIME_UNIT_SECONDS,
+                                                         &send_kilo, cls));
   return 1024;
 }
 
@@ -111,9 +112,9 @@
   csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
-                 GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
-                                                          
GNUNET_TIME_UNIT_SECONDS,
-                                                          &send_kilo, cls));
+                GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
+                                                         
GNUNET_TIME_UNIT_SECONDS,
+                                                         &send_kilo, cls));
 }
 
 
@@ -129,7 +130,7 @@
   ok = 1;
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   GNUNET_SCHEDULER_run (&task_timeout, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
   return ok;
@@ -142,11 +143,11 @@
 
   GNUNET_log_setup ("test_connection_timeout",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check_timeout ();
   return ret;
 }

Modified: gnunet/src/util/test_connection_timeout_no_connect.c
===================================================================
--- gnunet/src/util/test_connection_timeout_no_connect.c        2011-10-11 
08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_connection_timeout_no_connect.c        2011-10-11 
09:43:04 UTC (rev 17362)
@@ -57,10 +57,10 @@
   csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
-                 GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
-                                                          
GNUNET_TIME_UNIT_SECONDS,
-                                                          &handle_timeout,
-                                                          cls));
+                GNUNET_CONNECTION_notify_transmit_ready (csock, 1024,
+                                                         
GNUNET_TIME_UNIT_SECONDS,
+                                                         &handle_timeout,
+                                                         cls));
 }
 
 
@@ -76,7 +76,7 @@
   ok = 1;
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   GNUNET_SCHEDULER_run (&task_timeout, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
   return ok;
@@ -89,11 +89,11 @@
 
   GNUNET_log_setup ("test_connection_timeout_no_connect",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check_timeout ();
   return ret;
 }

Modified: gnunet/src/util/test_connection_transmit_cancel.c
===================================================================
--- gnunet/src/util/test_connection_transmit_cancel.c   2011-10-11 08:58:17 UTC 
(rev 17361)
+++ gnunet/src/util/test_connection_transmit_cancel.c   2011-10-11 09:43:04 UTC 
(rev 17362)
@@ -43,7 +43,8 @@
 
 
 static void
-task_transmit_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+task_transmit_cancel (void *cls,
+                     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   int *ok = cls;
   struct GNUNET_CONNECTION_TransmitHandle *th;
@@ -52,8 +53,8 @@
   csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
   GNUNET_assert (csock != NULL);
   th = GNUNET_CONNECTION_notify_transmit_ready (csock, 12,
-                                                GNUNET_TIME_UNIT_MINUTES,
-                                                &not_run, cls);
+                                               GNUNET_TIME_UNIT_MINUTES,
+                                               &not_run, cls);
   GNUNET_assert (NULL != th);
   GNUNET_CONNECTION_notify_transmit_ready_cancel (th);
   GNUNET_CONNECTION_destroy (csock, GNUNET_YES);
@@ -74,7 +75,7 @@
   ok = 1;
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_CONFIGURATION_set_value_string (cfg, "resolver", "HOSTNAME",
-                                         "localhost");
+                                        "localhost");
   GNUNET_SCHEDULER_run (&task_transmit_cancel, &ok);
   GNUNET_CONFIGURATION_destroy (cfg);
   return ok;
@@ -88,11 +89,11 @@
 
   GNUNET_log_setup ("test_connection_transmit_cancel",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret += check_transmit_cancel ();
 
   return ret;

Modified: gnunet/src/util/test_container_bloomfilter.c
===================================================================
--- gnunet/src/util/test_container_bloomfilter.c        2011-10-11 08:58:17 UTC 
(rev 17361)
+++ gnunet/src/util/test_container_bloomfilter.c        2011-10-11 09:43:04 UTC 
(rev 17362)
@@ -75,29 +75,30 @@
   bf = GNUNET_CONTAINER_bloomfilter_load (TESTFILE, SIZE, K);
 
   for (i = 0; i < 200; i++)
-  {
-    nextHC (&tmp);
-    GNUNET_CONTAINER_bloomfilter_add (bf, &tmp);
-  }
+    {
+      nextHC (&tmp);
+      GNUNET_CONTAINER_bloomfilter_add (bf, &tmp);
+    }
   SRANDOM (1);
   ok1 = 0;
   for (i = 0; i < 200; i++)
-  {
-    nextHC (&tmp);
-    if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
-      ok1++;
-  }
+    {
+      nextHC (&tmp);
+      if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
+       ok1++;
+    }
   if (ok1 != 200)
-  {
-    printf ("Got %d elements out of" "200 expected after insertion.\n", ok1);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    return -1;
-  }
+    {
+      printf ("Got %d elements out of" "200 expected after insertion.\n",
+             ok1);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      return -1;
+    }
   if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_get_raw_data (bf, buf, SIZE))
-  {
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    return -1;
-  }
+    {
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      return -1;
+    }
 
   GNUNET_CONTAINER_bloomfilter_free (bf);
 
@@ -110,93 +111,94 @@
   ok1 = 0;
   ok2 = 0;
   for (i = 0; i < 200; i++)
-  {
-    nextHC (&tmp);
-    if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
-      ok1++;
-    if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
-      ok2++;
-  }
+    {
+      nextHC (&tmp);
+      if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
+       ok1++;
+      if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
+       ok2++;
+    }
   if (ok1 != 200)
-  {
-    printf ("Got %d elements out of 200 " "expected after reloading.\n", ok1);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Got %d elements out of 200 " "expected after reloading.\n",
+             ok1);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
   if (ok2 != 200)
-  {
-    printf ("Got %d elements out of 200 " "expected after initialization.\n",
-            ok2);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Got %d elements out of 200 "
+             "expected after initialization.\n", ok2);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
   SRANDOM (1);
   for (i = 0; i < 100; i++)
-  {
-    nextHC (&tmp);
-    GNUNET_CONTAINER_bloomfilter_remove (bf, &tmp);
-    GNUNET_CONTAINER_bloomfilter_remove (bfi, &tmp);
-  }
+    {
+      nextHC (&tmp);
+      GNUNET_CONTAINER_bloomfilter_remove (bf, &tmp);
+      GNUNET_CONTAINER_bloomfilter_remove (bfi, &tmp);
+    }
 
   SRANDOM (1);
 
   ok1 = 0;
   ok2 = 0;
   for (i = 0; i < 200; i++)
-  {
-    nextHC (&tmp);
-    if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
-      ok1++;
-    if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
-      ok2++;
-  }
+    {
+      nextHC (&tmp);
+      if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
+       ok1++;
+      if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
+       ok2++;
+    }
 
   if (ok1 != 100)
-  {
-    printf ("Expected 100 elements in loaded filter"
-            " after adding 200 and deleting 100, got %d\n", ok1);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Expected 100 elements in loaded filter"
+             " after adding 200 and deleting 100, got %d\n", ok1);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
   if (ok2 != 200)
-  {
-    printf ("Expected 200 elements in initialized filter"
-            " after adding 200 and deleting 100 "
-            "(which should do nothing for a filter not backed by a file), got 
%d\n",
-            ok2);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Expected 200 elements in initialized filter"
+             " after adding 200 and deleting 100 "
+             "(which should do nothing for a filter not backed by a file), got 
%d\n",
+             ok2);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
   SRANDOM (3);
 
   GNUNET_CONTAINER_bloomfilter_clear (bf);
   falseok = 0;
   for (i = 0; i < 1000; i++)
-  {
-    nextHC (&tmp);
-    if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
-      falseok++;
-  }
+    {
+      nextHC (&tmp);
+      if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
+       falseok++;
+    }
   if (falseok > 0)
-  {
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
   if (GNUNET_OK != GNUNET_CONTAINER_bloomfilter_or (bf, buf, SIZE))
-  {
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
   SRANDOM (2);
   i = 20;
@@ -210,30 +212,30 @@
   ok1 = 0;
   ok2 = 0;
   for (i = 0; i < 20; i++)
-  {
-    nextHC (&tmp);
-    if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
-      ok1++;
-    if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
-      ok2++;
-  }
+    {
+      nextHC (&tmp);
+      if (GNUNET_CONTAINER_bloomfilter_test (bf, &tmp) == GNUNET_YES)
+       ok1++;
+      if (GNUNET_CONTAINER_bloomfilter_test (bfi, &tmp) == GNUNET_YES)
+       ok2++;
+    }
 
   if (ok1 != 20)
-  {
-    printf ("Expected 20 elements in resized file-backed filter"
-            " after adding 20, got %d\n", ok1);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Expected 20 elements in resized file-backed filter"
+             " after adding 20, got %d\n", ok1);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
   if (ok2 != 20)
-  {
-    printf ("Expected 20 elements in resized filter"
-            " after adding 20, got %d\n", ok2);
-    GNUNET_CONTAINER_bloomfilter_free (bf);
-    GNUNET_CONTAINER_bloomfilter_free (bfi);
-    return -1;
-  }
+    {
+      printf ("Expected 20 elements in resized filter"
+             " after adding 20, got %d\n", ok2);
+      GNUNET_CONTAINER_bloomfilter_free (bf);
+      GNUNET_CONTAINER_bloomfilter_free (bfi);
+      return -1;
+    }
 
 
   GNUNET_CONTAINER_bloomfilter_free (bf);

Modified: gnunet/src/util/test_container_heap.c
===================================================================
--- gnunet/src/util/test_container_heap.c       2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_container_heap.c       2011-10-11 09:43:04 UTC (rev 
17362)
@@ -30,7 +30,7 @@
 
 static int
 iterator_callback (void *cls, struct GNUNET_CONTAINER_HeapNode *node,
-                   void *element, GNUNET_CONTAINER_HeapCostType cost)
+                  void *element, GNUNET_CONTAINER_HeapCostType cost)
 {
   return GNUNET_OK;
 }
@@ -107,15 +107,15 @@
   n6 = GNUNET_CONTAINER_heap_insert (myHeap, "30/200", 30);
   GNUNET_assert (5 == GNUNET_CONTAINER_heap_get_size (myHeap));
   GNUNET_CONTAINER_heap_remove_node (n5);
-  r = GNUNET_CONTAINER_heap_remove_root (myHeap);       /* n1 */
+  r = GNUNET_CONTAINER_heap_remove_root (myHeap);      /* n1 */
   GNUNET_assert (NULL != r);
   GNUNET_assert (0 == strcmp ("11", r));
   GNUNET_CONTAINER_heap_update_cost (myHeap, n6, 200);
   GNUNET_CONTAINER_heap_remove_node (n3);
-  r = GNUNET_CONTAINER_heap_remove_root (myHeap);       /* n4 */
+  r = GNUNET_CONTAINER_heap_remove_root (myHeap);      /* n4 */
   GNUNET_assert (NULL != r);
   GNUNET_assert (0 == strcmp ("50", r));
-  r = GNUNET_CONTAINER_heap_remove_root (myHeap);       /* n6 */
+  r = GNUNET_CONTAINER_heap_remove_root (myHeap);      /* n6 */
   GNUNET_assert (NULL != r);
   GNUNET_assert (0 == strcmp ("30/200", r));
   GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (myHeap));
@@ -172,9 +172,9 @@
 
   GNUNET_assert (0 == nstrcmp ("20", GNUNET_CONTAINER_heap_remove_node (n2)));
   GNUNET_assert (0 ==
-                 nstrcmp ("10", GNUNET_CONTAINER_heap_remove_root (myHeap)));
+                nstrcmp ("10", GNUNET_CONTAINER_heap_remove_root (myHeap)));
   GNUNET_assert (0 ==
-                 nstrcmp ("30", GNUNET_CONTAINER_heap_remove_root (myHeap)));
+                nstrcmp ("30", GNUNET_CONTAINER_heap_remove_root (myHeap)));
 
   n1 = GNUNET_CONTAINER_heap_insert (myHeap, "10", 10);
   n2 = GNUNET_CONTAINER_heap_insert (myHeap, "20", 20);
@@ -232,7 +232,7 @@
   GNUNET_CONTAINER_heap_remove_node (n2);
   GNUNET_CONTAINER_heap_remove_node (n1);
   GNUNET_assert (0 ==
-                 nstrcmp ("30", GNUNET_CONTAINER_heap_remove_root (myHeap)));
+                nstrcmp ("30", GNUNET_CONTAINER_heap_remove_root (myHeap)));
 
   n1 = GNUNET_CONTAINER_heap_insert (myHeap, "10", 10);
   n2 = GNUNET_CONTAINER_heap_insert (myHeap, "20", 10);

Modified: gnunet/src/util/test_container_meta_data.c
===================================================================
--- gnunet/src/util/test_container_meta_data.c  2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_container_meta_data.c  2011-10-11 09:43:04 UTC (rev 
17362)
@@ -41,51 +41,55 @@
 
   m = GNUNET_CONTAINER_meta_data_create ();
   if (GNUNET_OK !=
-      GNUNET_CONTAINER_meta_data_insert (m, "<test>", EXTRACTOR_METATYPE_TITLE,
-                                         EXTRACTOR_METAFORMAT_UTF8,
-                                         "text/plain", "TestTitle",
-                                         strlen ("TestTitle") + 1))
+      GNUNET_CONTAINER_meta_data_insert (m, "<test>",
+                                        EXTRACTOR_METATYPE_TITLE,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "TestTitle",
+                                        strlen ("TestTitle") + 1))
     ABORT (m);
   if (GNUNET_OK !=
       GNUNET_CONTAINER_meta_data_insert (m, "<test>",
-                                         EXTRACTOR_METATYPE_AUTHOR_NAME,
-                                         EXTRACTOR_METAFORMAT_UTF8,
-                                         "text/plain", "TestTitle",
-                                         strlen ("TestTitle") + 1))
+                                        EXTRACTOR_METATYPE_AUTHOR_NAME,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "TestTitle",
+                                        strlen ("TestTitle") + 1))
     ABORT (m);
-  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_insert (m, "<test>", 
EXTRACTOR_METATYPE_TITLE, EXTRACTOR_METAFORMAT_UTF8, "text/plain", "TestTitle", 
strlen ("TestTitle") + 1))   /* dup! */
+  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_insert (m, "<test>", 
EXTRACTOR_METATYPE_TITLE, EXTRACTOR_METAFORMAT_UTF8, "text/plain", "TestTitle", 
strlen ("TestTitle") + 1))  /* dup! */
     ABORT (m);
-  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_insert (m, "<test>", 
EXTRACTOR_METATYPE_AUTHOR_NAME, EXTRACTOR_METAFORMAT_UTF8, "text/plain", 
"TestTitle", strlen ("TestTitle") + 1))     /* dup! */
+  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_insert (m, "<test>", 
EXTRACTOR_METATYPE_AUTHOR_NAME, EXTRACTOR_METAFORMAT_UTF8, "text/plain", 
"TestTitle", strlen ("TestTitle") + 1))    /* dup! */
     ABORT (m);
   if (2 != GNUNET_CONTAINER_meta_data_iterate (m, NULL, NULL))
     ABORT (m);
   if (GNUNET_OK !=
       GNUNET_CONTAINER_meta_data_delete (m, EXTRACTOR_METATYPE_AUTHOR_NAME,
-                                         "TestTitle", strlen ("TestTitle") + 
1))
+                                        "TestTitle",
+                                        strlen ("TestTitle") + 1))
     ABORT (m);
-  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_delete (m, 
EXTRACTOR_METATYPE_AUTHOR_NAME, "TestTitle", strlen ("TestTitle") + 1))        
/* already gone */
+  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_delete (m, 
EXTRACTOR_METATYPE_AUTHOR_NAME, "TestTitle", strlen ("TestTitle") + 1))       
/* already gone */
     ABORT (m);
   if (1 != GNUNET_CONTAINER_meta_data_iterate (m, NULL, NULL))
     ABORT (m);
   if (GNUNET_OK !=
       GNUNET_CONTAINER_meta_data_delete (m, EXTRACTOR_METATYPE_TITLE,
-                                         "TestTitle", strlen ("TestTitle") + 
1))
+                                        "TestTitle",
+                                        strlen ("TestTitle") + 1))
     ABORT (m);
-  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_delete (m, 
EXTRACTOR_METATYPE_TITLE, "TestTitle", strlen ("TestTitle") + 1))      /* 
already gone */
+  if (GNUNET_OK == GNUNET_CONTAINER_meta_data_delete (m, 
EXTRACTOR_METATYPE_TITLE, "TestTitle", strlen ("TestTitle") + 1))     /* 
already gone */
     ABORT (m);
   if (0 != GNUNET_CONTAINER_meta_data_iterate (m, NULL, NULL))
     ABORT (m);
   for (j = 0; j < i; j++)
-  {
-    GNUNET_snprintf (val, sizeof (val), "%s.%d",
-                     "A teststring that should compress well.", j);
-    if (GNUNET_OK !=
-        GNUNET_CONTAINER_meta_data_insert (m, "<test>",
-                                           EXTRACTOR_METATYPE_UNKNOWN,
-                                           EXTRACTOR_METAFORMAT_UTF8,
-                                           "text/plain", val, strlen (val) + 
1))
-      ABORT (m);
-  }
+    {
+      GNUNET_snprintf (val, sizeof (val), "%s.%d",
+                      "A teststring that should compress well.", j);
+      if (GNUNET_OK !=
+         GNUNET_CONTAINER_meta_data_insert (m, "<test>",
+                                            EXTRACTOR_METATYPE_UNKNOWN,
+                                            EXTRACTOR_METAFORMAT_UTF8,
+                                            "text/plain", val,
+                                            strlen (val) + 1))
+       ABORT (m);
+    }
   if (i != GNUNET_CONTAINER_meta_data_iterate (m, NULL, NULL))
     ABORT (m);
 
@@ -93,27 +97,27 @@
   sval = NULL;
   if (size !=
       GNUNET_CONTAINER_meta_data_serialize (m, &sval, size,
-                                            
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL))
-  {
-    GNUNET_free_non_null (sval);
-    ABORT (m);
-  }
+                                           
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL))
+    {
+      GNUNET_free_non_null (sval);
+      ABORT (m);
+    }
   GNUNET_CONTAINER_meta_data_destroy (m);
   m = GNUNET_CONTAINER_meta_data_deserialize (sval, size);
   GNUNET_free (sval);
   if (m == NULL)
     ABORT (m);
   for (j = 0; j < i; j++)
-  {
-    GNUNET_snprintf (val, sizeof (val), "%s.%d",
-                     "A teststring that should compress well.", j);
-    if (GNUNET_OK !=
-        GNUNET_CONTAINER_meta_data_delete (m, EXTRACTOR_METATYPE_UNKNOWN, val,
-                                           strlen (val) + 1))
     {
-      ABORT (m);
+      GNUNET_snprintf (val, sizeof (val), "%s.%d",
+                      "A teststring that should compress well.", j);
+      if (GNUNET_OK !=
+         GNUNET_CONTAINER_meta_data_delete (m, EXTRACTOR_METATYPE_UNKNOWN,
+                                            val, strlen (val) + 1))
+       {
+         ABORT (m);
+       }
     }
-  }
   if (0 != GNUNET_CONTAINER_meta_data_iterate (m, NULL, NULL))
     ABORT (m);
   GNUNET_CONTAINER_meta_data_destroy (m);
@@ -131,22 +135,22 @@
 
   meta = GNUNET_CONTAINER_meta_data_create ();
   for (q = 0; q <= i; q++)
-  {
-    GNUNET_snprintf (txt, 128, "%u -- %u\n", i, q);
-    GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
-                                       q % EXTRACTOR_metatype_get_max (),
-                                       EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                       txt, strlen (txt) + 1);
-  }
+    {
+      GNUNET_snprintf (txt, 128, "%u -- %u\n", i, q);
+      GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
+                                        q % EXTRACTOR_metatype_get_max (),
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", txt, strlen (txt) + 1);
+    }
   size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta);
   data = GNUNET_malloc (size * 4);
   if (size !=
       GNUNET_CONTAINER_meta_data_serialize (meta, &data, size * 4,
-                                            
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL))
-  {
-    GNUNET_free (data);
-    ABORT (meta);
-  }
+                                           
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL))
+    {
+      GNUNET_free (data);
+      ABORT (meta);
+    }
   GNUNET_CONTAINER_meta_data_destroy (meta);
   GNUNET_free (data);
   return 0;
@@ -162,22 +166,22 @@
   m = GNUNET_CONTAINER_meta_data_create ();
   if (GNUNET_OK !=
       GNUNET_CONTAINER_meta_data_insert (m, "<test>",
-                                         EXTRACTOR_METATYPE_UNKNOWN,
-                                         EXTRACTOR_METAFORMAT_UTF8,
-                                         "text/plain", "link",
-                                         strlen ("link") + 1))
+                                        EXTRACTOR_METATYPE_UNKNOWN,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "link",
+                                        strlen ("link") + 1))
     ABORT (m);
   if (GNUNET_OK !=
       GNUNET_CONTAINER_meta_data_insert (m, "<test>",
-                                         EXTRACTOR_METATYPE_FILENAME,
-                                         EXTRACTOR_METAFORMAT_UTF8,
-                                         "text/plain", "lib-link.m4",
-                                         strlen ("lib-link.m4") + 1))
+                                        EXTRACTOR_METATYPE_FILENAME,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "lib-link.m4",
+                                        strlen ("lib-link.m4") + 1))
     ABORT (m);
   val = NULL;
   size =
-      GNUNET_CONTAINER_meta_data_serialize (m, &val, (size_t) - 1,
-                                            
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL);
+    GNUNET_CONTAINER_meta_data_serialize (m, &val, (size_t) - 1,
+                                         
GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL);
   GNUNET_CONTAINER_meta_data_destroy (m);
   m = GNUNET_CONTAINER_meta_data_deserialize (val, size);
   GNUNET_free (val);
@@ -201,44 +205,46 @@
   meta = GNUNET_CONTAINER_meta_data_create ();
   meta2 = GNUNET_CONTAINER_meta_data_create ();
   for (q = 0; q <= i; q++)
-  {
-    GNUNET_snprintf (txt, 128, "%u -- %u\n", i, q);
-    GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
-                                       EXTRACTOR_METATYPE_UNKNOWN,
-                                       EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                       "TestTitle", strlen ("TestTitle") + 1);
-    GNUNET_CONTAINER_meta_data_insert (meta2, "<test>",
-                                       EXTRACTOR_METATYPE_UNKNOWN,
-                                       EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                       "TestTitle", strlen ("TestTitle") + 1);
-  }
+    {
+      GNUNET_snprintf (txt, 128, "%u -- %u\n", i, q);
+      GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
+                                        EXTRACTOR_METATYPE_UNKNOWN,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "TestTitle",
+                                        strlen ("TestTitle") + 1);
+      GNUNET_CONTAINER_meta_data_insert (meta2, "<test>",
+                                        EXTRACTOR_METATYPE_UNKNOWN,
+                                        EXTRACTOR_METAFORMAT_UTF8,
+                                        "text/plain", "TestTitle",
+                                        strlen ("TestTitle") + 1);
+    }
 
   //check meta_data_test_equal
   if (GNUNET_YES != GNUNET_CONTAINER_meta_data_test_equal (meta, meta2))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
 
   //check meta_data_clear
   GNUNET_CONTAINER_meta_data_clear (meta2);
   if (0 != GNUNET_CONTAINER_meta_data_iterate (meta2, NULL, NULL))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
   // check equal branch in meta_data_test_equal
   if (GNUNET_YES != GNUNET_CONTAINER_meta_data_test_equal (meta, meta))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
   // check "count" branch in meta_data_test_equal
   if (GNUNET_NO != GNUNET_CONTAINER_meta_data_test_equal (meta, meta2))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
 
   // check meta_data_add_publication_date
   GNUNET_CONTAINER_meta_data_add_publication_date (meta2);
@@ -247,74 +253,74 @@
   GNUNET_CONTAINER_meta_data_clear (meta2);
   GNUNET_CONTAINER_meta_data_merge (meta2, meta);
   if (100 == GNUNET_CONTAINER_meta_data_iterate (meta2, NULL, NULL))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
 
   // check meta_data_get_by_type
   GNUNET_CONTAINER_meta_data_clear (meta2);
   if (NULL !=
       (str =
        GNUNET_CONTAINER_meta_data_get_by_type (meta2,
-                                               EXTRACTOR_METATYPE_UNKNOWN)))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    GNUNET_free (str);
-    ABORT (meta);
-  }
+                                              EXTRACTOR_METATYPE_UNKNOWN)))
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      GNUNET_free (str);
+      ABORT (meta);
+    }
 
   str =
-      GNUNET_CONTAINER_meta_data_get_by_type (meta, 
EXTRACTOR_METATYPE_UNKNOWN);
+    GNUNET_CONTAINER_meta_data_get_by_type (meta, EXTRACTOR_METATYPE_UNKNOWN);
   GNUNET_assert (NULL != str);
   if (str[0] != 'T')
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    GNUNET_free (str);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      GNUNET_free (str);
+      ABORT (meta);
+    }
   GNUNET_free (str);
 
   // check branch
   if (NULL !=
       (str =
        GNUNET_CONTAINER_meta_data_get_by_type (meta,
-                                               
EXTRACTOR_METATYPE_PUBLICATION_DATE)))
-  {
-    GNUNET_free (str);
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+                                              
EXTRACTOR_METATYPE_PUBLICATION_DATE)))
+    {
+      GNUNET_free (str);
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
 
   //check meta_data_get_first_by_types
   str =
-      GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
-                                                     
EXTRACTOR_METATYPE_UNKNOWN,
-                                                     -1);
+    GNUNET_CONTAINER_meta_data_get_first_by_types (meta,
+                                                  EXTRACTOR_METATYPE_UNKNOWN,
+                                                  -1);
   GNUNET_assert (NULL != str);
   if (str[0] != 'T')
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    GNUNET_free (str);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      GNUNET_free (str);
+      ABORT (meta);
+    }
   GNUNET_free (str);
 
   //check meta_data_get_thumbnail
   if (GNUNET_CONTAINER_meta_data_get_thumbnail (meta, &thumb) != 0)
-  {
-    GNUNET_free (thumb);
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_free (thumb);
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
   GNUNET_CONTAINER_meta_data_destroy (meta2);
   //check meta_data_duplicate
   meta2 = GNUNET_CONTAINER_meta_data_duplicate (meta);
   if (200 == GNUNET_CONTAINER_meta_data_iterate (meta2, NULL, NULL))
-  {
-    GNUNET_CONTAINER_meta_data_destroy (meta2);
-    ABORT (meta);
-  }
+    {
+      GNUNET_CONTAINER_meta_data_destroy (meta2);
+      ABORT (meta);
+    }
   GNUNET_CONTAINER_meta_data_destroy (meta2);
   GNUNET_CONTAINER_meta_data_destroy (meta);
   return 0;

Modified: gnunet/src/util/test_container_multihashmap.c
===================================================================
--- gnunet/src/util/test_container_multihashmap.c       2011-10-11 08:58:17 UTC 
(rev 17361)
+++ gnunet/src/util/test_container_multihashmap.c       2011-10-11 09:43:04 UTC 
(rev 17362)
@@ -52,38 +52,41 @@
   CHECK (0 == GNUNET_CONTAINER_multihashmap_remove_all (m, &k1));
   CHECK (0 == GNUNET_CONTAINER_multihashmap_size (m));
   CHECK (0 == GNUNET_CONTAINER_multihashmap_iterate (m, NULL, NULL));
-  CHECK (0 == GNUNET_CONTAINER_multihashmap_get_multiple (m, &k1, NULL, NULL));
+  CHECK (0 ==
+        GNUNET_CONTAINER_multihashmap_get_multiple (m, &k1, NULL, NULL));
 
   CHECK (GNUNET_OK ==
-         GNUNET_CONTAINER_multihashmap_put (m, &k1, "v1",
-                                            
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
+        GNUNET_CONTAINER_multihashmap_put (m, &k1, "v1",
+                                           
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
   CHECK (1 == GNUNET_CONTAINER_multihashmap_size (m));
   ret = GNUNET_CONTAINER_multihashmap_get (m, &k1);
   GNUNET_assert (ret != NULL);
   CHECK (0 == strcmp ("v1", ret));
   CHECK (GNUNET_NO ==
-         GNUNET_CONTAINER_multihashmap_put (m, &k1, "v1",
-                                            
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
+        GNUNET_CONTAINER_multihashmap_put (m, &k1, "v1",
+                                           
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
   CHECK (1 == GNUNET_CONTAINER_multihashmap_size (m));
   CHECK (GNUNET_OK ==
-         GNUNET_CONTAINER_multihashmap_put (m, &k1, "v2",
-                                            
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
+        GNUNET_CONTAINER_multihashmap_put (m, &k1, "v2",
+                                           
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
   CHECK (GNUNET_OK ==
-         GNUNET_CONTAINER_multihashmap_put (m, &k1, "v3",
-                                            
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
+        GNUNET_CONTAINER_multihashmap_put (m, &k1, "v3",
+                                           
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
   CHECK (3 == GNUNET_CONTAINER_multihashmap_size (m));
   CHECK (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (m, &k1, "v3"));
   CHECK (2 == GNUNET_CONTAINER_multihashmap_size (m));
   CHECK (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (m, &k1));
   CHECK (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains (m, &k2));
-  CHECK (2 == GNUNET_CONTAINER_multihashmap_get_multiple (m, &k1, NULL, NULL));
-  CHECK (0 == GNUNET_CONTAINER_multihashmap_get_multiple (m, &k2, NULL, NULL));
+  CHECK (2 ==
+        GNUNET_CONTAINER_multihashmap_get_multiple (m, &k1, NULL, NULL));
+  CHECK (0 ==
+        GNUNET_CONTAINER_multihashmap_get_multiple (m, &k2, NULL, NULL));
   CHECK (2 == GNUNET_CONTAINER_multihashmap_iterate (m, NULL, NULL));
   CHECK (2 == GNUNET_CONTAINER_multihashmap_remove_all (m, &k1));
   for (j = 0; j < 1024; j++)
     CHECK (GNUNET_OK ==
-           GNUNET_CONTAINER_multihashmap_put (m, &k1, "v2",
-                                              
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
+          GNUNET_CONTAINER_multihashmap_put (m, &k1, "v2",
+                                             
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
   GNUNET_CONTAINER_multihashmap_destroy (m);
   return 0;
 }

Modified: gnunet/src/util/test_container_slist.c
===================================================================
--- gnunet/src/util/test_container_slist.c      2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_container_slist.c      2011-10-11 09:43:04 UTC (rev 
17362)
@@ -46,26 +46,27 @@
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 0);
 
   for (i = 0; i < 100; i++)
-    GNUNET_CONTAINER_slist_add (l, 
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                &i, sizeof (i));
+    GNUNET_CONTAINER_slist_add (l,
+                               GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                               &i, sizeof (i));
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 100);
 
   for (it = GNUNET_CONTAINER_slist_begin (l), i = 99;
        GNUNET_CONTAINER_slist_end (it) != GNUNET_YES;
        GNUNET_CONTAINER_slist_next (it), i--)
-  {
-    p = GNUNET_CONTAINER_slist_get (it, &s);
+    {
+      p = GNUNET_CONTAINER_slist_get (it, &s);
 
-    if ((p == NULL) || (i != (j = *(int *) p)) || (s != sizeof (i)))
-    {
-      GNUNET_CONTAINER_slist_iter_destroy (it);
-      GNUNET_assert (0);
+      if ((p == NULL) || (i != (j = *(int *) p)) || (s != sizeof (i)))
+       {
+         GNUNET_CONTAINER_slist_iter_destroy (it);
+         GNUNET_assert (0);
+       }
+      j *= 2;
+      GNUNET_CONTAINER_slist_insert (it,
+                                    
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                    &j, sizeof (j));
     }
-    j *= 2;
-    GNUNET_CONTAINER_slist_insert (it,
-                                   
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                   &j, sizeof (j));
-  }
   GNUNET_CONTAINER_slist_iter_destroy (it);
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 200);
   i = 198;
@@ -73,39 +74,40 @@
 
   for (it = GNUNET_CONTAINER_slist_begin (l);
        GNUNET_CONTAINER_slist_end (it) != GNUNET_YES;)
-  {
-    p = GNUNET_CONTAINER_slist_get (it, &s);
-    GNUNET_assert (p != NULL);
-    GNUNET_assert (s == sizeof (i));
-    i = *(int *) p;
+    {
+      p = GNUNET_CONTAINER_slist_get (it, &s);
+      GNUNET_assert (p != NULL);
+      GNUNET_assert (s == sizeof (i));
+      i = *(int *) p;
 
-    GNUNET_assert (GNUNET_CONTAINER_slist_next (it) == GNUNET_YES);
-    GNUNET_assert (GNUNET_CONTAINER_slist_end (it) != GNUNET_YES);
+      GNUNET_assert (GNUNET_CONTAINER_slist_next (it) == GNUNET_YES);
+      GNUNET_assert (GNUNET_CONTAINER_slist_end (it) != GNUNET_YES);
 
-    p = GNUNET_CONTAINER_slist_get (it, &s);
-    GNUNET_assert (p != NULL);
-    GNUNET_assert (s == sizeof (j));
-    j = *(int *) p;
+      p = GNUNET_CONTAINER_slist_get (it, &s);
+      GNUNET_assert (p != NULL);
+      GNUNET_assert (s == sizeof (j));
+      j = *(int *) p;
 
-    GNUNET_assert (j * 2 == i);
+      GNUNET_assert (j * 2 == i);
 
-    GNUNET_CONTAINER_slist_erase (it);
-  }
+      GNUNET_CONTAINER_slist_erase (it);
+    }
   GNUNET_CONTAINER_slist_iter_destroy (it);
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 100);
   i = 99;
   GNUNET_assert (GNUNET_CONTAINER_slist_contains (l, &i, sizeof (i)) ==
-                 GNUNET_NO);
+                GNUNET_NO);
   i = 198;
   GNUNET_assert (GNUNET_CONTAINER_slist_contains (l, &i, sizeof (i)) ==
-                 GNUNET_YES);
+                GNUNET_YES);
 
   GNUNET_CONTAINER_slist_clear (l);
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 0);
 
   for (i = 0; i < 100; i++)
-    GNUNET_CONTAINER_slist_add (l, 
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                &i, sizeof (i));
+    GNUNET_CONTAINER_slist_add (l,
+                               GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                               &i, sizeof (i));
   /*check slist_append */
   GNUNET_CONTAINER_slist_append (l, l);
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 200);
@@ -116,23 +118,23 @@
   l = GNUNET_CONTAINER_slist_create ();
   for (i = 0; i < 100; i++)
     GNUNET_CONTAINER_slist_add_end (l,
-                                    
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
-                                    &i, sizeof (i));
+                                   
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
+                                   &i, sizeof (i));
 
   GNUNET_assert (GNUNET_CONTAINER_slist_count (l) == 100);
 
   for (it = GNUNET_CONTAINER_slist_begin (l), i = 0;
        GNUNET_CONTAINER_slist_end (it) != GNUNET_YES;
        GNUNET_CONTAINER_slist_next (it), i++)
-  {
-    p = GNUNET_CONTAINER_slist_get (it, &s);
+    {
+      p = GNUNET_CONTAINER_slist_get (it, &s);
 
-    if ((p == NULL) || (i != *(int *) p) || (s != sizeof (i)))
-    {
-      GNUNET_CONTAINER_slist_iter_destroy (it);
-      GNUNET_assert (0);
+      if ((p == NULL) || (i != *(int *) p) || (s != sizeof (i)))
+       {
+         GNUNET_CONTAINER_slist_iter_destroy (it);
+         GNUNET_assert (0);
+       }
     }
-  }
   GNUNET_CONTAINER_slist_iter_destroy (it);
   GNUNET_CONTAINER_slist_destroy (l);
 
@@ -140,12 +142,13 @@
   l = GNUNET_CONTAINER_slist_create ();
 
   for (i = 0; i < 100; i++)
-  {
-    ip = GNUNET_malloc (sizeof (int));
-    *ip = i;
-    GNUNET_CONTAINER_slist_add (l, GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC,
-                                ip, sizeof (int));
-  }
+    {
+      ip = GNUNET_malloc (sizeof (int));
+      *ip = i;
+      GNUNET_CONTAINER_slist_add (l,
+                                 GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC,
+                                 ip, sizeof (int));
+    }
   //creat_add
   it = GNUNET_CONTAINER_slist_begin (l);
   p = GNUNET_CONTAINER_slist_get (it, &s);

Modified: gnunet/src/util/test_crypto_aes.c
===================================================================
--- gnunet/src/util/test_crypto_aes.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_crypto_aes.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -40,30 +40,30 @@
 
   GNUNET_CRYPTO_aes_create_session_key (&key);
   size =
-      GNUNET_CRYPTO_aes_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &key,
-                                 (const struct
-                                  GNUNET_CRYPTO_AesInitializationVector *)
-                                 INITVALUE, result);
+    GNUNET_CRYPTO_aes_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &key,
+                              (const struct
+                               GNUNET_CRYPTO_AesInitializationVector *)
+                              INITVALUE, result);
   if (size == -1)
-  {
-    printf ("symciphertest failed: encryptBlock returned %d\n", size);
-    return 1;
-  }
+    {
+      printf ("symciphertest failed: encryptBlock returned %d\n", size);
+      return 1;
+    }
   size =
-      GNUNET_CRYPTO_aes_decrypt (result, size, &key,
-                                 (const struct
-                                  GNUNET_CRYPTO_AesInitializationVector *)
-                                 INITVALUE, res);
+    GNUNET_CRYPTO_aes_decrypt (result, size, &key,
+                              (const struct
+                               GNUNET_CRYPTO_AesInitializationVector *)
+                              INITVALUE, res);
   if (strlen (TESTSTRING) + 1 != size)
-  {
-    printf ("symciphertest failed: decryptBlock returned %d\n", size);
-    return 1;
-  }
+    {
+      printf ("symciphertest failed: decryptBlock returned %d\n", size);
+      return 1;
+    }
   if (0 != strcmp (res, TESTSTRING))
-  {
-    printf ("symciphertest failed: %s != %s\n", res, TESTSTRING);
-    return 1;
-  }
+    {
+      printf ("symciphertest failed: %s != %s\n", res, TESTSTRING);
+      return 1;
+    }
   else
     return 0;
 }
@@ -77,16 +77,16 @@
   int ret;
 
   unsigned char plain[] =
-      { 29, 128, 192, 253, 74, 171, 38, 187, 84, 219, 76, 76, 209, 118, 33, 
249,
+    { 29, 128, 192, 253, 74, 171, 38, 187, 84, 219, 76, 76, 209, 118, 33, 249,
     172, 124, 96, 9, 157, 110, 8, 215, 200, 63, 69, 230, 157, 104, 247, 164
   };
   unsigned char raw_key[] =
-      { 106, 74, 209, 88, 145, 55, 189, 135, 125, 180, 225, 108, 183, 54, 25,
+    { 106, 74, 209, 88, 145, 55, 189, 135, 125, 180, 225, 108, 183, 54, 25,
     169, 129, 188, 131, 75, 227, 245, 105, 10, 225, 15, 115, 159, 148, 184,
     34, 191
   };
   unsigned char encrresult[] =
-      { 167, 102, 230, 233, 127, 195, 176, 107, 17, 91, 199, 127, 96, 113, 75,
+    { 167, 102, 230, 233, 127, 195, 176, 107, 17, 91, 199, 127, 96, 113, 75,
     195, 245, 217, 61, 236, 159, 165, 103, 121, 203, 99, 202, 41, 23, 222, 25,
     102
   };
@@ -96,54 +96,54 @@
 
   memcpy (key.key, raw_key, GNUNET_CRYPTO_AES_KEY_LENGTH);
   key.crc32 =
-      htonl (GNUNET_CRYPTO_crc32_n (&key, GNUNET_CRYPTO_AES_KEY_LENGTH));
+    htonl (GNUNET_CRYPTO_crc32_n (&key, GNUNET_CRYPTO_AES_KEY_LENGTH));
 
   if (ntohl (key.crc32) != (unsigned int) 38125195LL)
-  {
-    printf ("Static key has different CRC: %u - %u\n", ntohl (key.crc32),
-            key.crc32);
+    {
+      printf ("Static key has different CRC: %u - %u\n", ntohl (key.crc32),
+             key.crc32);
 
-    ret = 1;
-    goto error;
-  }
+      ret = 1;
+      goto error;
+    }
 
   if (GNUNET_CRYPTO_AES_KEY_LENGTH !=
       GNUNET_CRYPTO_aes_encrypt (plain, GNUNET_CRYPTO_AES_KEY_LENGTH, &key,
-                                 (const struct
-                                  GNUNET_CRYPTO_AesInitializationVector *)
-                                 "testtesttesttest", result))
-  {
-    printf ("Wrong return value from encrypt block.\n");
-    ret = 1;
-    goto error;
-  }
+                                (const struct
+                                 GNUNET_CRYPTO_AesInitializationVector *)
+                                "testtesttesttest", result))
+    {
+      printf ("Wrong return value from encrypt block.\n");
+      ret = 1;
+      goto error;
+    }
 
   if (memcmp (encrresult, result, GNUNET_CRYPTO_AES_KEY_LENGTH) != 0)
-  {
-    printf ("Encrypted result wrong.\n");
-    ret = 1;
-    goto error;
-  }
+    {
+      printf ("Encrypted result wrong.\n");
+      ret = 1;
+      goto error;
+    }
 
   res = GNUNET_malloc (GNUNET_CRYPTO_AES_KEY_LENGTH);
 
   if (GNUNET_CRYPTO_AES_KEY_LENGTH !=
       GNUNET_CRYPTO_aes_decrypt (result, GNUNET_CRYPTO_AES_KEY_LENGTH, &key,
-                                 (const struct
-                                  GNUNET_CRYPTO_AesInitializationVector *)
-                                 "testtesttesttest", res))
-  {
-    printf ("Wrong return value from decrypt block.\n");
-    ret = 1;
-    goto error;
-  }
+                                (const struct
+                                 GNUNET_CRYPTO_AesInitializationVector *)
+                                "testtesttesttest", res))
+    {
+      printf ("Wrong return value from decrypt block.\n");
+      ret = 1;
+      goto error;
+    }
 
   if (memcmp (res, plain, GNUNET_CRYPTO_AES_KEY_LENGTH) != 0)
-  {
-    printf ("Decrypted result does not match input.\n");
+    {
+      printf ("Decrypted result does not match input.\n");
 
-    ret = 1;
-  }
+      ret = 1;
+    }
 
 error:
 
@@ -160,15 +160,15 @@
   GNUNET_log_setup ("test-crypto-aes", "WARNING", NULL);
   GNUNET_CRYPTO_random_disable_entropy_gathering ();
   GNUNET_assert (strlen (INITVALUE) >
-                 sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
+                sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
   failureCount += testSymcipher ();
   failureCount += verifyCrypto ();
 
   if (failureCount != 0)
-  {
-    printf ("%d TESTS FAILED!\n", failureCount);
-    return -1;
-  }
+    {
+      printf ("%d TESTS FAILED!\n", failureCount);
+      return -1;
+    }
   return 0;
 }
 

Modified: gnunet/src/util/test_crypto_aes_weak.c
===================================================================
--- gnunet/src/util/test_crypto_aes_weak.c      2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_crypto_aes_weak.c      2011-10-11 09:43:04 UTC (rev 
17362)
@@ -40,9 +40,9 @@
   int i;
 
   for (i = 0; i < GNUNET_CRYPTO_AES_KEY_LENGTH; i++)
-  {
-    printf ("%x ", (int) (key->key[i]));
-  }
+    {
+      printf ("%x ", (int) (key->key[i]));
+    }
 }
 
 static int
@@ -55,7 +55,7 @@
   struct GNUNET_CRYPTO_AesInitializationVector INITVALUE;
 
   memset (&INITVALUE, 42,
-          sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
+         sizeof (struct GNUNET_CRYPTO_AesInitializationVector));
   /* sorry, this is not a weak key -- I don't have
    * any at the moment! */
   weak_key.key[0] = (char) (0x4c);
@@ -92,31 +92,31 @@
   weak_key.key[31] = (char) (0xaa);
   /* memset(&weak_key, 0, 32); */
   weak_key.crc32 =
-      htonl (GNUNET_CRYPTO_crc32_n (&weak_key, GNUNET_CRYPTO_AES_KEY_LENGTH));
+    htonl (GNUNET_CRYPTO_crc32_n (&weak_key, GNUNET_CRYPTO_AES_KEY_LENGTH));
 
   size =
-      GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING,
-                                 strlen (WEAK_KEY_TESTSTRING) + 1, &weak_key,
-                                 &INITVALUE, result);
+    GNUNET_CRYPTO_aes_encrypt (WEAK_KEY_TESTSTRING,
+                              strlen (WEAK_KEY_TESTSTRING) + 1, &weak_key,
+                              &INITVALUE, result);
 
   if (size == -1)
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
 
   size = GNUNET_CRYPTO_aes_decrypt (result, size, &weak_key, &INITVALUE, res);
 
   if ((strlen (WEAK_KEY_TESTSTRING) + 1) != size)
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   if (0 != strcmp (res, WEAK_KEY_TESTSTRING))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   else
     return 0;
 }
@@ -133,41 +133,44 @@
 
   for (number_of_runs = 0; number_of_runs < MAX_WEAK_KEY_TRIALS;
        number_of_runs++)
-  {
+    {
 
-    if (number_of_runs % 1000 == 0)
-      fprintf (stderr, ".");
-    /*printf("Got to run number %d.\n", number_of_runs); */
-    GNUNET_CRYPTO_aes_create_session_key (&sessionkey);
+      if (number_of_runs % 1000 == 0)
+       fprintf (stderr, ".");
+      /*printf("Got to run number %d.\n", number_of_runs); */
+      GNUNET_CRYPTO_aes_create_session_key (&sessionkey);
 
-    rc = gcry_cipher_open (&handle, GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB,
-                           0);
+      rc =
+       gcry_cipher_open (&handle, GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB,
+                         0);
 
-    if (rc)
-    {
-      printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n",
-              number_of_runs, gcry_strerror (rc));
-      continue;
-    }
+      if (rc)
+       {
+         printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n",
+                 number_of_runs, gcry_strerror (rc));
+         continue;
+       }
 
-    rc = gcry_cipher_setkey (handle, &sessionkey, 
GNUNET_CRYPTO_AES_KEY_LENGTH);
+      rc =
+       gcry_cipher_setkey (handle, &sessionkey,
+                           GNUNET_CRYPTO_AES_KEY_LENGTH);
 
-    if ((char) rc == GPG_ERR_WEAK_KEY)
-    {
-      printf ("\nWeak key (in hex): ");
-      printWeakKey (&sessionkey);
-      printf ("\n");
-      number_of_weak_keys++;
-    }
-    else if (rc)
-    {
-      printf ("\nUnexpected error generating keys. Error is %s\n",
-              gcry_strerror (rc));
-    }
+      if ((char) rc == GPG_ERR_WEAK_KEY)
+       {
+         printf ("\nWeak key (in hex): ");
+         printWeakKey (&sessionkey);
+         printf ("\n");
+         number_of_weak_keys++;
+       }
+      else if (rc)
+       {
+         printf ("\nUnexpected error generating keys. Error is %s\n",
+                 gcry_strerror (rc));
+       }
 
-    gcry_cipher_close (handle);
+      gcry_cipher_close (handle);
 
-  }
+    }
 
   return number_of_weak_keys;
 }
@@ -180,19 +183,19 @@
   GNUNET_log_setup ("test-crypto-aes-weak", "WARNING", NULL);
   GNUNET_CRYPTO_random_disable_entropy_gathering ();
   if (GENERATE_WEAK_KEYS)
-  {
-    weak_keys = getWeakKeys ();
+    {
+      weak_keys = getWeakKeys ();
 
-    if (weak_keys == 0)
-    {
-      printf ("\nNo weak keys found in %d runs.\n", MAX_WEAK_KEY_TRIALS);
+      if (weak_keys == 0)
+       {
+         printf ("\nNo weak keys found in %d runs.\n", MAX_WEAK_KEY_TRIALS);
+       }
+      else
+       {
+         printf ("\n%d weak keys found in %d runs.\n", weak_keys,
+                 MAX_WEAK_KEY_TRIALS);
+       }
     }
-    else
-    {
-      printf ("\n%d weak keys found in %d runs.\n", weak_keys,
-              MAX_WEAK_KEY_TRIALS);
-    }
-  }
 
   if (testWeakKey () != 0)
     return -1;

Modified: gnunet/src/util/test_crypto_hash.c
===================================================================
--- gnunet/src/util/test_crypto_hash.c  2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_crypto_hash.c  2011-10-11 09:43:04 UTC (rev 17362)
@@ -42,10 +42,10 @@
   memset (&h1, number, sizeof (GNUNET_HashCode));
   GNUNET_CRYPTO_hash_to_enc (&h1, &enc);
   if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string ((char *) &enc, &h2))
-  {
-    printf ("enc2hash failed!\n");
-    return 1;
-  }
+    {
+      printf ("enc2hash failed!\n");
+      return 1;
+    }
   if (0 != memcmp (&h1, &h2, sizeof (GNUNET_HashCode)))
     return 1;
   return 0;
@@ -124,8 +124,9 @@
 file_hasher (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   GNUNET_assert (NULL !=
-                 GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
-                                          FILENAME, 1024, &finished_task, 
cls));
+                GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
+                                         FILENAME, 1024, &finished_task,
+                                         cls));
 }
 
 

Modified: gnunet/src/util/test_crypto_hkdf.c
===================================================================
--- gnunet/src/util/test_crypto_hkdf.c  2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_crypto_hkdf.c  2011-10-11 09:43:04 UTC (rev 17362)
@@ -36,17 +36,17 @@
 tc1 ()
 {
   unsigned char ikm[22] =
-      { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+    { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
     0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
   };
   unsigned char salt[13] =
-      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0a, 0x0b, 0x0c
   };
   unsigned char info[10] =
-      { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9 };
+    { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9 };
   unsigned char okm[42] =
-      { 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43,
+    { 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43,
     0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a,
     0x5a, 0x4c, 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf, 0x34, 0x00,
     0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, 0x58, 0x65
@@ -56,9 +56,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, salt,
-                  sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
-                  NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, salt,
+                 sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
+                 NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -67,7 +67,7 @@
 tc2 ()
 {
   unsigned char ikm[80] =
-      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
     0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
     0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
@@ -76,7 +76,7 @@
     0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
   };
   unsigned char salt[80] =
-      { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+    { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
     0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
     0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
     0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d,
@@ -85,7 +85,7 @@
     0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf
   };
   unsigned char info[80] =
-      { 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+    { 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
     0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
     0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
     0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
@@ -94,7 +94,7 @@
     0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
   };
   unsigned char okm[82] =
-      { 0xb1, 0x1e, 0x39, 0x8d, 0xc8, 0x03, 0x27, 0xa1, 0xc8, 0xe7,
+    { 0xb1, 0x1e, 0x39, 0x8d, 0xc8, 0x03, 0x27, 0xa1, 0xc8, 0xe7,
     0xf7, 0x8c, 0x59, 0x6a, 0x49, 0x34, 0x4f, 0x01, 0x2e, 0xda, 0x2d, 0x4e,
     0xfa, 0xd8, 0xa0, 0x50, 0xcc, 0x4c, 0x19, 0xaf, 0xa9, 0x7c, 0x59, 0x04,
     0x5a, 0x99, 0xca, 0xc7, 0x82, 0x72, 0x71, 0xcb, 0x41, 0xc6, 0x5e, 0x59,
@@ -107,9 +107,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, salt,
-                  sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
-                  NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, salt,
+                 sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
+                 NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -118,11 +118,11 @@
 tc3 ()
 {
   unsigned char ikm[22] =
-      { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+    { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
     0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
   };
   unsigned char okm[42] =
-      { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f,
+    { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, 0x71, 0x5f,
     0x80, 0x2a, 0x06, 0x3c, 0x5a, 0x31, 0xb8, 0xa1, 0x1f, 0x5c, 0x5e, 0xe1,
     0x87, 0x9e, 0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d, 0x9d, 0x20,
     0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a, 0x96, 0xc8
@@ -132,8 +132,8 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, NULL, 0, ikm,
-                  sizeof (ikm), NULL, 0, NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA256, GCRY_MD_SHA256, NULL, 0, ikm,
+                 sizeof (ikm), NULL, 0, NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -142,17 +142,17 @@
 tc4 ()
 {
   unsigned char ikm[11] =
-      { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+    { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
     0x0b
   };
   unsigned char salt[13] =
-      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0a, 0x0b, 0x0c
   };
   unsigned char info[10] =
-      { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9 };
+    { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9 };
   unsigned char okm[42] =
-      { 0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69, 0x33, 0x06,
+    { 0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69, 0x33, 0x06,
     0x8b, 0x56, 0xef, 0xa5, 0xad, 0x81, 0xa4, 0xf1, 0x4b, 0x82, 0x2f, 0x5b,
     0x09, 0x15, 0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2, 0xc2, 0x2e,
     0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3, 0xf8, 0x96
@@ -162,8 +162,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
-                  ikm, sizeof (ikm), info, sizeof (info), NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
+                 ikm, sizeof (ikm), info, sizeof (info),
+                 NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -172,7 +173,7 @@
 tc5 ()
 {
   unsigned char ikm[80] =
-      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
     0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
     0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
@@ -181,7 +182,7 @@
     0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
   };
   unsigned char salt[80] =
-      { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+    { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
     0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
     0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
     0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d,
@@ -190,7 +191,7 @@
     0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf
   };
   unsigned char info[80] =
-      { 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
+    { 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9,
     0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5,
     0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1,
     0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd,
@@ -199,7 +200,7 @@
     0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
   };
   unsigned char okm[82] =
-      { 0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7, 0xc9, 0xf1,
+    { 0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7, 0xc9, 0xf1,
     0x2c, 0xd5, 0x91, 0x2a, 0x06, 0xeb, 0xff, 0x6a, 0xdc, 0xae, 0x89, 0x9d,
     0x92, 0x19, 0x1f, 0xe4, 0x30, 0x56, 0x73, 0xba, 0x2f, 0xfe, 0x8f, 0xa3,
     0xf1, 0xa4, 0xe5, 0xad, 0x79, 0xf3, 0xf3, 0x34, 0xb3, 0xb2, 0x02, 0xb2,
@@ -212,8 +213,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
-                  ikm, sizeof (ikm), info, sizeof (info), NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
+                 ikm, sizeof (ikm), info, sizeof (info),
+                 NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -222,11 +224,11 @@
 tc6 ()
 {
   unsigned char ikm[22] =
-      { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+    { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
     0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
   };
   unsigned char okm[42] =
-      { 0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61, 0xd1, 0xe5,
+    { 0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61, 0xd1, 0xe5,
     0x52, 0x98, 0xda, 0x9d, 0x05, 0x06, 0xb9, 0xae, 0x52, 0x05, 0x72, 0x20,
     0xa3, 0x06, 0xe0, 0x7b, 0x6b, 0x87, 0xe8, 0xdf, 0x21, 0xd0, 0xea, 0x00,
     0x03, 0x3d, 0xe0, 0x39, 0x84, 0xd3, 0x49, 0x18
@@ -236,8 +238,8 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, NULL, 0, ikm,
-                  sizeof (ikm), NULL, 0, NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, NULL, 0, ikm,
+                 sizeof (ikm), NULL, 0, NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -246,7 +248,7 @@
 tc7 ()
 {
   unsigned char ikm[80] =
-      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
+    { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
     0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21,
     0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
@@ -255,7 +257,7 @@
     0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
   };
   unsigned char salt[80] =
-      { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+    { 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
     0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
     0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81,
     0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d,
@@ -275,7 +277,7 @@
     0xfe, 0xff
   };
   unsigned char okm[82] =
-      { 0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7, 0xc9, 0xf1,
+    { 0x0b, 0xd7, 0x70, 0xa7, 0x4d, 0x11, 0x60, 0xf7, 0xc9, 0xf1,
     0x2c, 0xd5, 0x91, 0x2a, 0x06, 0xeb, 0xff, 0x6a, 0xdc, 0xae, 0x89, 0x9d,
     0x92, 0x19, 0x1f, 0xe4, 0x30, 0x56, 0x73, 0xba, 0x2f, 0xfe, 0x8f, 0xa3,
     0xf1, 0xa4, 0xe5, 0xad, 0x79, 0xf3, 0xf3, 0x34, 0xb3, 0xb2, 0x02, 0xb2,
@@ -288,9 +290,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
-                  ikm, sizeof (ikm), info1, sizeof (info1), info2,
-                  sizeof (info2), NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA1, GCRY_MD_SHA1, salt, sizeof (salt),
+                 ikm, sizeof (ikm), info1, sizeof (info1), info2,
+                 sizeof (info2), NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }
@@ -299,13 +301,13 @@
 tc8 ()
 {
   unsigned char ikm[32] =
-      { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
+    { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
     0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe,
     0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde
   };
   unsigned char salt[4] = { 0xfc, 0x62, 0x76, 0x35 };
   unsigned char info[86] =
-      { 0x8c, 0x0d, 0xcf, 0xb3, 0x25, 0x6e, 0x88, 0x0d, 0xc1, 0x0b,
+    { 0x8c, 0x0d, 0xcf, 0xb3, 0x25, 0x6e, 0x88, 0x0d, 0xc1, 0x0b,
     0x1d, 0x33, 0x15, 0x3e, 0x52, 0x0b, 0xb0, 0x77, 0xff, 0x7d, 0xc3, 0xc7,
     0xef, 0xe5, 0x8e, 0x3c, 0xc4, 0x4e, 0x8b, 0x41, 0x46, 0x1f, 0x02, 0x94,
     0x82, 0x35, 0xc5, 0xa6, 0x5e, 0x91, 0xd8, 0xa2, 0x90, 0xfd, 0x6f, 0xb4,
@@ -315,7 +317,7 @@
     0x74, 0x6f, 0x72, 0x00
   };
   unsigned char okm[16] =
-      { 0xd6, 0x90, 0xec, 0x9e, 0x62, 0xdf, 0xb9, 0x41, 0xff, 0x92,
+    { 0xd6, 0x90, 0xec, 0x9e, 0x62, 0xdf, 0xb9, 0x41, 0xff, 0x92,
     0x4f, 0xd2, 0xf6, 0x1d, 0x67, 0xe0
   };
   char result[18];
@@ -323,9 +325,9 @@
 
   memset (result, 0, sizeof (result));
   GNUNET_assert (GNUNET_CRYPTO_hkdf
-                 (result, l, GCRY_MD_SHA512, GCRY_MD_SHA256, salt,
-                  sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
-                  NULL) == GNUNET_YES);
+                (result, l, GCRY_MD_SHA512, GCRY_MD_SHA256, salt,
+                 sizeof (salt), ikm, sizeof (ikm), info, sizeof (info),
+                 NULL) == GNUNET_YES);
   GNUNET_assert (memcmp (result, okm, l) == 0);
   GNUNET_assert (memcmp (result + l, "\0", 2) == 0);
 }

Modified: gnunet/src/util/test_crypto_ksk.c
===================================================================
--- gnunet/src/util/test_crypto_ksk.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_crypto_ksk.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -39,7 +39,7 @@
 testCorrectKey ()
 {
   const char *want =
-      
"010601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b73c215f7a5e6b09bec55713c901786c09324a150980e014bdb0d04426934929c3b4971a9711af5455536cd6eeb8bfa004ee904972a737455f53c752987d8c82b755bc02882b44950c4acdc1672ba74c3b94d81a4c1ea3d74e7700ae5594c3a4f3c559e4bff2df6844fac302e4b66175e14dc8bad3ce44281d2fec1a1abef06301010000";
+    
"010601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b73c215f7a5e6b09bec55713c901786c09324a150980e014bdb0d04426934929c3b4971a9711af5455536cd6eeb8bfa004ee904972a737455f53c752987d8c82b755bc02882b44950c4acdc1672ba74c3b94d81a4c1ea3d74e7700ae5594c3a4f3c559e4bff2df6844fac302e4b66175e14dc8bad3ce44281d2fec1a1abef06301010000";
   GNUNET_HashCode in;
   struct GNUNET_CRYPTO_RsaPrivateKey *hostkey;
   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
@@ -50,27 +50,29 @@
   GNUNET_CRYPTO_hash ("X", strlen ("X"), &in);
   hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
   if (hostkey == NULL)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_break (0);
+      return GNUNET_SYSERR;
+    }
   GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
 #if 0
-  for (i = 0; i < sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded); i++)
+  for (i = 0; i < sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded);
+       i++)
     printf ("%02x", ((unsigned char *) &pkey)[i]);
   printf ("\n");
 #endif
-  for (i = 0; i < sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded); i++)
-  {
-    snprintf (out, sizeof (out), "%02x", ((unsigned char *) &pkey)[i]);
-    if (0 != strncmp (out, &want[i * 2], 2))
+  for (i = 0; i < sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded);
+       i++)
     {
-      fprintf (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 
2],
-               out, i);
-      return GNUNET_SYSERR;
+      snprintf (out, sizeof (out), "%02x", ((unsigned char *) &pkey)[i]);
+      if (0 != strncmp (out, &want[i * 2], 2))
+       {
+         fprintf (stderr, " Failed! Wanted %.2s but got %2s at %d\n",
+                  &want[i * 2], out, i);
+         return GNUNET_SYSERR;
+       }
     }
-  }
   fprintf (stderr, " OK\n");
   return GNUNET_OK;
 }
@@ -89,10 +91,10 @@
   GNUNET_CRYPTO_hash (word, strlen (word), &in);
   hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
   if (hostkey == NULL)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
+    {
+      GNUNET_break (0);
+      return GNUNET_SYSERR;
+    }
   GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
   /*
    * for (i=0;i<sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded);i++)
@@ -100,26 +102,26 @@
    * printf("\n"); */
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   for (i = 0; i < UNIQUE_ITER; i++)
-  {
-    fprintf (stderr, ".");
-    hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
-    if (hostkey == NULL)
     {
-      GNUNET_break (0);
-      fprintf (stderr, " ERROR\n");
-      return GNUNET_SYSERR;
+      fprintf (stderr, ".");
+      hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
+      if (hostkey == NULL)
+       {
+         GNUNET_break (0);
+         fprintf (stderr, " ERROR\n");
+         return GNUNET_SYSERR;
+       }
+      GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey1);
+      GNUNET_CRYPTO_rsa_key_free (hostkey);
+      if (0 !=
+         memcmp (&pkey, &pkey1,
+                 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
+       {
+         GNUNET_break (0);
+         fprintf (stderr, " ERROR\n");
+         return GNUNET_SYSERR;
+       }
     }
-    GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey1);
-    GNUNET_CRYPTO_rsa_key_free (hostkey);
-    if (0 !=
-        memcmp (&pkey, &pkey1,
-                sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
-    {
-      GNUNET_break (0);
-      fprintf (stderr, " ERROR\n");
-      return GNUNET_SYSERR;
-    }
-  }
   fprintf (stderr, " OK\n");
   return GNUNET_OK;
 }
@@ -141,35 +143,35 @@
   ok = 0;
   start = GNUNET_TIME_absolute_get ();
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
-                                   &target))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
-      ok++;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1,
+                                    &pkey, &target))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
+      if (-1 ==
+         GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
+                                    strlen (TESTSTRING) + 1))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
+      if (strncmp (TESTSTRING, result, strlen (TESTSTRING)) != 0)
+       {
+         printf ("%s != %.*s - testEncryptDecrypt failed!\n", TESTSTRING,
+                 MAX_TESTVAL, result);
+         ok++;
+         continue;
+       }
     }
-    if (-1 ==
-        GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
-                                   strlen (TESTSTRING) + 1))
-    {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
-      ok++;
-      continue;
-    }
-    if (strncmp (TESTSTRING, result, strlen (TESTSTRING)) != 0)
-    {
-      printf ("%s != %.*s - testEncryptDecrypt failed!\n", TESTSTRING,
-              MAX_TESTVAL, result);
-      ok++;
-      continue;
-    }
-  }
   printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
   if (ok == 0)
     return GNUNET_OK;
   else
@@ -192,34 +194,34 @@
   purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose));
   purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
-      ok = GNUNET_SYSERR;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp,
+                                   &sig, &pkey))
+       {
+         printf ("GNUNET_CRYPTO_rsa_verify failed!\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
+      if (GNUNET_SYSERR !=
+         GNUNET_CRYPTO_rsa_verify
+         (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, &purp, &sig, &pkey))
+       {
+         printf ("GNUNET_CRYPTO_rsa_verify failed to fail!\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
     }
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp, &sig,
-                                  &pkey))
-    {
-      printf ("GNUNET_CRYPTO_rsa_verify failed!\n");
-      ok = GNUNET_SYSERR;
-      continue;
-    }
-    if (GNUNET_SYSERR !=
-        GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
-                                  &purp, &sig, &pkey))
-    {
-      printf ("GNUNET_CRYPTO_rsa_verify failed to fail!\n");
-      ok = GNUNET_SYSERR;
-      continue;
-    }
-  }
   printf ("%d RSA sign/verify operations %llums\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value);
   return ok;
 }
 
@@ -237,10 +239,10 @@
   GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &in);
   hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
   if (hostkey == NULL)
-  {
-    printf ("\nGNUNET_CRYPTO_rsa_key_create_from_hash failed!\n");
-    return 1;
-  }
+    {
+      printf ("\nGNUNET_CRYPTO_rsa_key_create_from_hash failed!\n");
+      return 1;
+    }
   if (GNUNET_OK != testMultiKey ("foo"))
     failureCount++;
   if (GNUNET_OK != testMultiKey ("bar"))
@@ -252,9 +254,9 @@
   GNUNET_CRYPTO_rsa_key_free (hostkey);
 
   if (failureCount != 0)
-  {
-    printf ("\n\n%d TESTS FAILED!\n\n", failureCount);
-    return -1;
-  }
+    {
+      printf ("\n\n%d TESTS FAILED!\n\n", failureCount);
+      return -1;
+    }
   return 0;
 }

Modified: gnunet/src/util/test_crypto_random.c
===================================================================
--- gnunet/src/util/test_crypto_random.c        2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_crypto_random.c        2011-10-11 09:43:04 UTC (rev 
17362)
@@ -39,19 +39,19 @@
   for (i = 0; i < 1024; i++)
     GNUNET_break (1024 > (buf[i] = GNUNET_CRYPTO_random_u32 (mode, 1024)));
   for (i = 0; i < 10; i++)
-  {
-    b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
-    if (0 == memcmp (b2, buf, sizeof (buf)))
     {
-      fprintf (stderr, "!");
+      b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
+      if (0 == memcmp (b2, buf, sizeof (buf)))
+       {
+         fprintf (stderr, "!");
+         GNUNET_free (b2);
+         continue;
+       }
       GNUNET_free (b2);
-      continue;
+      break;
     }
-    GNUNET_free (b2);
-    break;
-  }
   if (i == 10)
-    return 1;                   /* virtually impossible... */
+    return 1;                  /* virtually impossible... */
 
   for (n = 10; n < 1024LL * 1024LL * 1024LL; n *= 10)
     GNUNET_break (n > GNUNET_CRYPTO_random_u64 (mode, n));

Modified: gnunet/src/util/test_crypto_rsa.c
===================================================================
--- gnunet/src/util/test_crypto_rsa.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_crypto_rsa.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -54,36 +54,36 @@
   ok = 0;
   start = GNUNET_TIME_absolute_get ();
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
-                                   &target))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
-      ok++;
-      continue;
-    }
-    if (-1 ==
-        GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
-                                   strlen (TESTSTRING) + 1))
-    {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
-      ok++;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1,
+                                    &pkey, &target))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
+      if (-1 ==
+         GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
+                                    strlen (TESTSTRING) + 1))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+         ok++;
+         continue;
 
+       }
+      if (strncmp (TESTSTRING, result, strlen (TESTSTRING)) != 0)
+       {
+         printf ("%s != %.*s - testEncryptDecrypt failed!\n", TESTSTRING,
+                 (int) MAX_TESTVAL, result);
+         ok++;
+         continue;
+       }
     }
-    if (strncmp (TESTSTRING, result, strlen (TESTSTRING)) != 0)
-    {
-      printf ("%s != %.*s - testEncryptDecrypt failed!\n", TESTSTRING,
-              (int) MAX_TESTVAL, result);
-      ok++;
-      continue;
-    }
-  }
   printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok == 0)
     return GNUNET_OK;
@@ -109,20 +109,20 @@
   ok = 0;
   start = GNUNET_TIME_absolute_get ();
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
-                                   &target))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
-      ok++;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1,
+                                    &pkey, &target))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
     }
-  }
   printf ("%d RSA encrypt operations %llu ms (%d failures)\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok != 0)
     return GNUNET_SYSERR;
@@ -149,37 +149,39 @@
   ok = 0;
   start = GNUNET_TIME_absolute_get ();
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    GNUNET_CRYPTO_aes_create_session_key (&insk);
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_encrypt (&insk,
-                                   sizeof (struct GNUNET_CRYPTO_AesSessionKey),
-                                   &pkey, &target))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
-      ok++;
-      continue;
+      fprintf (stderr, ".");
+      GNUNET_CRYPTO_aes_create_session_key (&insk);
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_encrypt (&insk,
+                                    sizeof (struct
+                                            GNUNET_CRYPTO_AesSessionKey),
+                                    &pkey, &target))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
+      if (-1 ==
+         GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, &outsk,
+                                    sizeof (struct
+                                            GNUNET_CRYPTO_AesSessionKey)))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+         ok++;
+         continue;
+       }
+      if (0 !=
+         memcmp (&insk, &outsk, sizeof (struct GNUNET_CRYPTO_AesSessionKey)))
+       {
+         printf ("testEncryptDecryptSK failed!\n");
+         ok++;
+         continue;
+       }
     }
-    if (-1 ==
-        GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, &outsk,
-                                   sizeof (struct 
GNUNET_CRYPTO_AesSessionKey)))
-    {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
-      ok++;
-      continue;
-    }
-    if (0 !=
-        memcmp (&insk, &outsk, sizeof (struct GNUNET_CRYPTO_AesSessionKey)))
-    {
-      printf ("testEncryptDecryptSK failed!\n");
-      ok++;
-      continue;
-    }
-  }
   printf ("%d RSA encrypt/decrypt SK operations %llums (%d failures)\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok != 0)
     return GNUNET_SYSERR;
@@ -206,34 +208,34 @@
   purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
 
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
-      ok = GNUNET_SYSERR;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
+      if (GNUNET_SYSERR ==
+         GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp,
+                                   &sig, &pkey))
+       {
+         printf ("GNUNET_CRYPTO_rsa_verify failed!\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
+      if (GNUNET_SYSERR !=
+         GNUNET_CRYPTO_rsa_verify
+         (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, &purp, &sig, &pkey))
+       {
+         printf ("GNUNET_CRYPTO_rsa_verify failed to fail!\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
     }
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TEST, &purp, &sig,
-                                  &pkey))
-    {
-      printf ("GNUNET_CRYPTO_rsa_verify failed!\n");
-      ok = GNUNET_SYSERR;
-      continue;
-    }
-    if (GNUNET_SYSERR !=
-        GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
-                                  &purp, &sig, &pkey))
-    {
-      printf ("GNUNET_CRYPTO_rsa_verify failed to fail!\n");
-      ok = GNUNET_SYSERR;
-      continue;
-    }
-  }
   printf ("%d RSA sign/verify operations %llums\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   return ok;
 }
@@ -258,18 +260,18 @@
   GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
   start = GNUNET_TIME_absolute_get ();
   for (i = 0; i < ITER; i++)
-  {
-    fprintf (stderr, ".");
-    if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
     {
-      fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
-      ok = GNUNET_SYSERR;
-      continue;
+      fprintf (stderr, ".");
+      if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
+       {
+         fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+         ok = GNUNET_SYSERR;
+         continue;
+       }
     }
-  }
   printf ("%d RSA sign operations %llu ms\n", ITER,
-          (unsigned long long)
-          GNUNET_TIME_absolute_get_duration (start).rel_value);
+         (unsigned long long)
+         GNUNET_TIME_absolute_get_duration (start).rel_value);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   return ok;
 }
@@ -326,9 +328,9 @@
     failureCount++;
 
   if (failureCount != 0)
-  {
-    printf ("\n\n%d TESTS FAILED!\n\n", failureCount);
-    return -1;
-  }
+    {
+      printf ("\n\n%d TESTS FAILED!\n\n", failureCount);
+      return -1;
+    }
   return 0;
-}                               /* end of main */
+}                              /* end of main */

Modified: gnunet/src/util/test_disk.c
===================================================================
--- gnunet/src/util/test_disk.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_disk.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -38,40 +38,41 @@
 
   if (strlen (TESTSTRING) !=
       GNUNET_DISK_fn_write (".testfile", TESTSTRING, strlen (TESTSTRING),
-                            GNUNET_DISK_PERM_USER_READ |
-                            GNUNET_DISK_PERM_USER_WRITE))
+                           GNUNET_DISK_PERM_USER_READ |
+                           GNUNET_DISK_PERM_USER_WRITE))
     return 1;
   if (GNUNET_OK != GNUNET_DISK_file_test (".testfile"))
     return 1;
   ret = GNUNET_DISK_fn_read (".testfile", tmp, sizeof (tmp) - 1);
   if (ret < 0)
-  {
-    fprintf (stderr, "Error reading file `%s' in testReadWrite\n", 
".testfile");
-    return 1;
-  }
+    {
+      fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
+              ".testfile");
+      return 1;
+    }
   tmp[ret] = '\0';
   if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
-  {
-    fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
-             TESTSTRING, ".testfile");
-    return 1;
-  }
+    {
+      fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n",
+              tmp, TESTSTRING, ".testfile");
+      return 1;
+    }
   GNUNET_DISK_file_copy (".testfile", ".testfile2");
   memset (tmp, 0, sizeof (tmp));
   ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1);
   if (ret < 0)
-  {
-    fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
-             ".testfile2");
-    return 1;
-  }
+    {
+      fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
+              ".testfile2");
+      return 1;
+    }
   tmp[ret] = '\0';
   if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
-  {
-    fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
-             TESTSTRING, ".testfile2");
-    return 1;
-  }
+    {
+      fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n",
+              tmp, TESTSTRING, ".testfile2");
+      return 1;
+    }
 
   GNUNET_break (0 == UNLINK (".testfile"));
   GNUNET_break (0 == UNLINK (".testfile2"));
@@ -89,15 +90,15 @@
   long avail;
 
   fh = GNUNET_DISK_file_open (".testfile",
-                              GNUNET_DISK_OPEN_READWRITE |
-                              GNUNET_DISK_OPEN_CREATE,
-                              GNUNET_DISK_PERM_USER_READ |
-                              GNUNET_DISK_PERM_USER_WRITE);
+                             GNUNET_DISK_OPEN_READWRITE |
+                             GNUNET_DISK_OPEN_CREATE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
   GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh));
   GNUNET_break (5 == GNUNET_DISK_file_write (fh, "Hello", 5));
   GNUNET_DISK_file_close (fh);
   GNUNET_break (GNUNET_OK ==
-                GNUNET_DISK_file_size (".testfile", &size, GNUNET_NO));
+               GNUNET_DISK_file_size (".testfile", &size, GNUNET_NO));
   if (size != 5)
     return 1;
   GNUNET_break (0 == UNLINK (".testfile"));
@@ -107,19 +108,19 @@
   avail = GNUNET_DISK_get_blocks_available (".testfile");
   GNUNET_log_skip (0, GNUNET_NO);
   fh = GNUNET_DISK_file_open (".testfile",
-                              GNUNET_DISK_OPEN_READWRITE |
-                              GNUNET_DISK_OPEN_CREATE,
-                              GNUNET_DISK_PERM_USER_WRITE |
-                              GNUNET_DISK_PERM_USER_READ);
+                             GNUNET_DISK_OPEN_READWRITE |
+                             GNUNET_DISK_OPEN_CREATE,
+                             GNUNET_DISK_PERM_USER_WRITE |
+                             GNUNET_DISK_PERM_USER_READ);
   GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh));
   while ((avail == GNUNET_DISK_get_blocks_available (".testfile")) &&
-         (avail != -1))
+        (avail != -1))
     if (16 != GNUNET_DISK_file_write (fh, "HelloWorld123456", 16))
-    {
-      GNUNET_DISK_file_close (fh);
-      GNUNET_break (0 == UNLINK (".testfile"));
-      return 1;
-    }
+      {
+       GNUNET_DISK_file_close (fh);
+       GNUNET_break (0 == UNLINK (".testfile"));
+       return 1;
+      }
   GNUNET_DISK_file_close (fh);
   GNUNET_break (0 == UNLINK (".testfile"));
 
@@ -146,7 +147,7 @@
       GNUNET_DISK_directory_create ("test" DIR_SEPARATOR_STR "entry_more"))
     return 1;
   GNUNET_DISK_directory_scan ("test", &scan_callback,
-                              "test" DIR_SEPARATOR_STR "entry");
+                             "test" DIR_SEPARATOR_STR "entry");
   if (GNUNET_OK != GNUNET_DISK_directory_remove ("test"))
     return 1;
   if (ok < 2)
@@ -156,7 +157,7 @@
 
 static void
 iter_callback (void *cls, struct GNUNET_DISK_DirectoryIterator *di,
-               const char *filename, const char *dirname)
+              const char *filename, const char *dirname)
 {
   int *i = cls;
 
@@ -168,7 +169,7 @@
 iter_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   GNUNET_DISK_directory_iterator_start (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
-                                        "test", &iter_callback, cls);
+                                       "test", &iter_callback, cls);
 }
 
 static int
@@ -202,14 +203,14 @@
   cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_assert (cfg != NULL);
   GNUNET_CONFIGURATION_set_value_string (cfg, "service", "HOME",
-                                         "/tmp/test-gnunet-disk-a/b/c");
+                                        "/tmp/test-gnunet-disk-a/b/c");
   fn = GNUNET_DISK_get_home_filename (cfg, "service", "d", "e", NULL);
   GNUNET_assert (fn != NULL);
   GNUNET_CONFIGURATION_destroy (cfg);
   ret = strcmp ("/tmp/test-gnunet-disk-a/b/c/d/e", fn);
   GNUNET_free (fn);
   GNUNET_break (GNUNET_OK ==
-                GNUNET_DISK_directory_remove ("/tmp/test-gnunet-disk-a"));
+               GNUNET_DISK_directory_remove ("/tmp/test-gnunet-disk-a"));
   return ret;
 }
 
@@ -220,10 +221,10 @@
 
   GNUNET_DISK_filename_canonicalize (fn);
   if (0 != strcmp (fn, "ab____cd_ef__g_"))
-  {
-    GNUNET_free (fn);
-    return 1;
-  }
+    {
+      GNUNET_free (fn);
+      return 1;
+    }
   GNUNET_free (fn);
   return 0;
 }
@@ -275,9 +276,9 @@
   failureCount += testChangeOwner ();
   failureCount += testDirMani ();
   if (failureCount != 0)
-  {
-    fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount);
-    return -1;
-  }
+    {
+      fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount);
+      return -1;
+    }
   return 0;
-}                               /* end of main */
+}                              /* end of main */

Modified: gnunet/src/util/test_getopt.c
===================================================================
--- gnunet/src/util/test_getopt.c       2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_getopt.c       2011-10-11 09:43:04 UTC (rev 17362)
@@ -63,15 +63,15 @@
   };
 
   if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   if (vflags != 2)
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   return 0;
 }
 
@@ -89,10 +89,10 @@
   };
 
   if (-1 != GNUNET_GETOPT_run ("test_getopt", versionoptionlist, 2, myargv))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   return 0;
 }
 
@@ -110,10 +110,10 @@
   };
 
   if (-1 != GNUNET_GETOPT_run ("test_getopt", aboutoptionlist, 2, myargv))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   return 0;
 }
 
@@ -136,18 +136,18 @@
   };
 
   if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   GNUNET_assert (fn != NULL);
   if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename")))
-  {
-    GNUNET_break (0);
-    GNUNET_free (level);
-    GNUNET_free (fn);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      GNUNET_free (level);
+      GNUNET_free (fn);
+      return 1;
+    }
   GNUNET_free (level);
   GNUNET_free (fn);
   return 0;
@@ -178,15 +178,15 @@
   };
 
   if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   if ((1 != flag) || (42 != num) || (42 != lnum))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
+    {
+      GNUNET_break (0);
+      return 1;
+    }
   return 0;
 }
 

Modified: gnunet/src/util/test_os_network.c
===================================================================
--- gnunet/src/util/test_os_network.c   2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_os_network.c   2011-10-11 09:43:04 UTC (rev 17362)
@@ -44,10 +44,10 @@
     return GNUNET_OK;
 
   inet_ntop (addr->sa_family,
-             (addr->sa_family ==
-              AF_INET) ? (void *) &((struct sockaddr_in *) addr)->sin_addr
-             : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr, buf,
-             sizeof (buf));
+            (addr->sa_family ==
+             AF_INET) ? (void *) &((struct sockaddr_in *) addr)->sin_addr
+            : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr, buf,
+            sizeof (buf));
   if ((0 == strcmp ("::1", buf)) || (0 == strcmp ("127.0.0.1", buf)))
     *ok = 0;
   return GNUNET_OK;

Modified: gnunet/src/util/test_os_priority.c
===================================================================
--- gnunet/src/util/test_os_priority.c  2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_os_priority.c  2011-10-11 09:43:04 UTC (rev 17362)
@@ -32,27 +32,27 @@
 {
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_DEFAULT))
+                                     GNUNET_SCHEDULER_PRIORITY_DEFAULT))
     return 1;
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_UI))
+                                     GNUNET_SCHEDULER_PRIORITY_UI))
     return 1;
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_IDLE))
+                                     GNUNET_SCHEDULER_PRIORITY_IDLE))
     return 1;
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_BACKGROUND))
+                                     GNUNET_SCHEDULER_PRIORITY_BACKGROUND))
     return 1;
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_HIGH))
+                                     GNUNET_SCHEDULER_PRIORITY_HIGH))
     return 1;
   if (GNUNET_OK !=
       GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
-                                      GNUNET_SCHEDULER_PRIORITY_HIGH))
+                                     GNUNET_SCHEDULER_PRIORITY_HIGH))
     return 1;
   return 0;
 }

Modified: gnunet/src/util/test_os_start_process.c
===================================================================
--- gnunet/src/util/test_os_start_process.c     2011-10-11 08:58:17 UTC (rev 
17361)
+++ gnunet/src/util/test_os_start_process.c     2011-10-11 09:43:04 UTC (rev 
17362)
@@ -53,9 +53,9 @@
 {
 
   if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
-  }
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
+    }
   GNUNET_OS_process_wait (proc);
   GNUNET_OS_process_close (proc);
   proc = NULL;
@@ -79,28 +79,28 @@
 #endif
 
   if (bytes < 1)
-  {
-    GNUNET_break (0);
-    ok = 1;
-    GNUNET_SCHEDULER_cancel (die_task);
-    GNUNET_SCHEDULER_add_now (&end_task, NULL);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      ok = 1;
+      GNUNET_SCHEDULER_cancel (die_task);
+      GNUNET_SCHEDULER_add_now (&end_task, NULL);
+      return;
+    }
 
   ok = strncmp (&buf[0], test_phrase, strlen (test_phrase));
 #if VERBOSE
   fprintf (stderr, "read %s\n", &buf[0]);
 #endif
   if (ok == 0)
-  {
-    GNUNET_SCHEDULER_cancel (die_task);
-    GNUNET_SCHEDULER_add_now (&end_task, NULL);
-    return;
-  }
+    {
+      GNUNET_SCHEDULER_cancel (die_task);
+      GNUNET_SCHEDULER_add_now (&end_task, NULL);
+      return;
+    }
 
   GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
-                                  stdout_read_handle, &read_call,
-                                  stdout_read_handle);
+                                 stdout_read_handle, &read_call,
+                                 stdout_read_handle);
 
 }
 
@@ -118,16 +118,16 @@
   hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_NO, GNUNET_YES);
 
   if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
-  {
-    GNUNET_break (0);
-    ok = 1;
-    GNUNET_free (fn);
-    return;
-  }
+    {
+      GNUNET_break (0);
+      ok = 1;
+      GNUNET_free (fn);
+      return;
+    }
 
   proc =
-      GNUNET_OS_start_process (hello_pipe_stdin, hello_pipe_stdout, fn,
-                               "test_gnunet_echo_hello", "-", NULL);
+    GNUNET_OS_start_process (hello_pipe_stdin, hello_pipe_stdout, fn,
+                            "test_gnunet_echo_hello", "-", NULL);
   GNUNET_free (fn);
 
   /* Close the write end of the read pipe */
@@ -140,26 +140,26 @@
   /* Write the test_phrase to the cat process */
   if (GNUNET_DISK_file_write (wh, test_phrase, strlen (test_phrase) + 1) !=
       strlen (test_phrase) + 1)
-  {
-    GNUNET_break (0);
-    ok = 1;
-    return;
-  }
+    {
+      GNUNET_break (0);
+      ok = 1;
+      return;
+    }
 
   /* Close the write end to end the cycle! */
   GNUNET_DISK_pipe_close_end (hello_pipe_stdin, GNUNET_DISK_PIPE_END_WRITE);
 
   stdout_read_handle =
-      GNUNET_DISK_pipe_handle (hello_pipe_stdout, GNUNET_DISK_PIPE_END_READ);
+    GNUNET_DISK_pipe_handle (hello_pipe_stdout, GNUNET_DISK_PIPE_END_READ);
 
   die_task =
-      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
-                                    (GNUNET_TIME_UNIT_MINUTES, 1), &end_task,
-                                    NULL);
+    GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
+                                 (GNUNET_TIME_UNIT_MINUTES, 1), &end_task,
+                                 NULL);
 
   GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
-                                  stdout_read_handle, &read_call,
-                                  (void *) stdout_read_handle);
+                                 stdout_read_handle, &read_call,
+                                 (void *) stdout_read_handle);
 
 }
 
@@ -183,11 +183,11 @@
 
   GNUNET_log_setup ("test-os-start-process",
 #if VERBOSE
-                    "DEBUG",
+                   "DEBUG",
 #else
-                    "WARNING",
+                   "WARNING",
 #endif
-                    NULL);
+                   NULL);
   ret = check ();
 
   return ret;

Modified: gnunet/src/util/test_peer.c
===================================================================
--- gnunet/src/util/test_peer.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_peer.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -43,13 +43,13 @@
   int i;
 
   for (i = 0; i < NUMBER_OF_PEERS; i++)
-  {
-    GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
-                                      &pidArr[i].hashPubKey);
+    {
+      GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
+                                       &pidArr[i].hashPubKey);
 #if DEBUG
-    printf ("Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
+      printf ("Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
 #endif
-  }
+    }
 }
 
 
@@ -65,25 +65,27 @@
   GNUNET_assert (0 == GNUNET_PEER_intern (NULL));
   /* Insert Peers into PeerEntry table and hashmap */
   for (i = 0; i < NUMBER_OF_PEERS; i++)
-  {
-    pid = GNUNET_PEER_intern (&pidArr[i]);
-    if (pid != (i + 1))
     {
-      fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
-      return 1;
+      pid = GNUNET_PEER_intern (&pidArr[i]);
+      if (pid != (i + 1))
+       {
+         fprintf (stderr,
+                  "Unexpected Peer ID returned by intern function\n");
+         return 1;
+       }
     }
-  }
 
   /* Referencing the first 3 peers once again */
   for (i = 0; i < 3; i++)
-  {
-    pid = GNUNET_PEER_intern (&pidArr[i]);
-    if (pid != (i + 1))
     {
-      fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
-      return 1;
+      pid = GNUNET_PEER_intern (&pidArr[i]);
+      if (pid != (i + 1))
+       {
+         fprintf (stderr,
+                  "Unexpected Peer ID returned by intern function\n");
+         return 1;
+       }
     }
-  }
 
   /* Dereferencing the first 3 peers once [decrementing their reference count] 
*/
   GNUNET_PEER_decrement_rcs (ids, 3);
@@ -128,11 +130,11 @@
 
   GNUNET_log_setup ("test-peer", "ERROR", NULL);
   for (i = 0; i < 1; i++)
-  {
-    generatePeerIdList ();
-    if (0 != check ())
-      return 1;
-  }
+    {
+      generatePeerIdList ();
+      if (0 != check ())
+       return 1;
+    }
   return 0;
 }
 

Modified: gnunet/src/util/test_program.c
===================================================================
--- gnunet/src/util/test_program.c      2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_program.c      2011-10-11 09:43:04 UTC (rev 17362)
@@ -58,7 +58,7 @@
 
 static void
 runner (void *cls, char *const *args, const char *cfgfile,
-        const struct GNUNET_CONFIGURATION_Handle *cfg)
+       const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int *ok = cls;
 
@@ -91,18 +91,18 @@
   };
 
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
-                                     options1, &runner, &ok));
+                GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
+                                    options1, &runner, &ok));
 
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
-                                     options2, &runner, &ok));
+                GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
+                                    options2, &runner, &ok));
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
-                                     options3, &runner, &ok));
+                GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
+                                    options3, &runner, &ok));
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
-                                     options4, &runner, &ok));
+                GNUNET_PROGRAM_run (7, argv, "test_program", "A test",
+                                    options4, &runner, &ok));
 
   return ok;
 }

Modified: gnunet/src/util/test_pseudonym.c
===================================================================
--- gnunet/src/util/test_pseudonym.c    2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_pseudonym.c    2011-10-11 09:43:04 UTC (rev 17362)
@@ -45,16 +45,16 @@
 
   if ((0 == memcmp (pseudonym, &id1, sizeof (GNUNET_HashCode))) &&
       (!GNUNET_CONTAINER_meta_data_test_equal (md, meta)))
-  {
-    *ok = GNUNET_NO;
-    GNUNET_break (0);
-  }
+    {
+      *ok = GNUNET_NO;
+      GNUNET_break (0);
+    }
   return GNUNET_OK;
 }
 
 static int
 noti_callback (void *cls, const GNUNET_HashCode * pseudonym,
-               const struct GNUNET_CONTAINER_MetaData *md, int rating)
+              const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
   int *ret = cls;
 
@@ -64,7 +64,7 @@
 
 static int
 fake_noti_callback (void *cls, const GNUNET_HashCode * pseudonym,
-                    const struct GNUNET_CONTAINER_MetaData *md, int rating)
+                   const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
   int *ret = cls;
 
@@ -74,7 +74,7 @@
 
 static int
 false_callback (void *cls, const GNUNET_HashCode * pseudonym,
-                const struct GNUNET_CONTAINER_MetaData *md, int rating)
+               const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
   return GNUNET_OK;
 }
@@ -109,28 +109,28 @@
   (void) GNUNET_DISK_directory_remove ("/tmp/gnunet-pseudonym-test");
   cfg = GNUNET_CONFIGURATION_create ();
   if (-1 == GNUNET_CONFIGURATION_parse (cfg, "test_pseudonym_data.conf"))
-  {
-    GNUNET_CONFIGURATION_destroy (cfg);
-    GNUNET_break (0);
-    return -1;
-  }
+    {
+      GNUNET_CONFIGURATION_destroy (cfg);
+      GNUNET_break (0);
+      return -1;
+    }
   notiCount = 0;
   fakenotiCount = 0;
   count = 0;
   GNUNET_PSEUDONYM_discovery_callback_register (cfg, &fake_noti_callback,
-                                                &fakenotiCount);
+                                               &fakenotiCount);
   GNUNET_PSEUDONYM_discovery_callback_register (cfg, &noti_callback,
-                                                &notiCount);
+                                               &notiCount);
   GNUNET_PSEUDONYM_discovery_callback_unregister (&false_callback, &count);
   GNUNET_PSEUDONYM_discovery_callback_unregister (&fake_noti_callback,
-                                                  &fakenotiCount);
+                                                 &fakenotiCount);
 
   /* ACTUAL TEST CODE */
   old = GNUNET_PSEUDONYM_list_all (cfg, NULL, NULL);
   meta = GNUNET_CONTAINER_meta_data_create ();
   GNUNET_CONTAINER_meta_data_insert (meta, "<test>", EXTRACTOR_METATYPE_TITLE,
-                                     EXTRACTOR_METAFORMAT_UTF8, "text/plain",
-                                     "test", strlen ("test") + 1);
+                                    EXTRACTOR_METAFORMAT_UTF8, "text/plain",
+                                    "test", strlen ("test") + 1);
   GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &id1);
   GNUNET_PSEUDONYM_add (cfg, &id1, meta);
   CHECK (notiCount == 1);
@@ -145,11 +145,11 @@
   newVal = GNUNET_PSEUDONYM_list_all (cfg, &iter, &ok);
   CHECK (old < newVal);
   GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
-                                                    EXTRACTOR_METATYPE_COMMENT,
-                                                    EXTRACTOR_METAFORMAT_UTF8,
-                                                    "text/plain", m,
-                                                    strlen (m) + 1));
+                GNUNET_CONTAINER_meta_data_insert (meta, "<test>",
+                                                   EXTRACTOR_METATYPE_COMMENT,
+                                                   EXTRACTOR_METAFORMAT_UTF8,
+                                                   "text/plain", m,
+                                                   strlen (m) + 1));
   GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &id3);
   GNUNET_PSEUDONYM_add (cfg, &id3, meta);
   name3 = GNUNET_PSEUDONYM_id_to_name (cfg, &id3);
@@ -184,7 +184,7 @@
   GNUNET_CONTAINER_meta_data_destroy (meta);
   GNUNET_CONFIGURATION_destroy (cfg);
   GNUNET_break (GNUNET_OK ==
-                GNUNET_DISK_directory_remove ("/tmp/gnunet-pseudonym-test"));
+               GNUNET_DISK_directory_remove ("/tmp/gnunet-pseudonym-test"));
   return (ok == GNUNET_YES) ? 0 : 1;
 }
 

Modified: gnunet/src/util/test_resolver_api.c
===================================================================
--- gnunet/src/util/test_resolver_api.c 2011-10-11 08:58:17 UTC (rev 17361)
+++ gnunet/src/util/test_resolver_api.c 2011-10-11 09:43:04 UTC (rev 17362)
@@ -46,12 +46,13 @@
   int *ok = cls;
 
   if (salen == 0)
-  {
-    (*ok) &= ~8;
-    return;
-  }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Got IP address `%s' for our host.\n"),
-              GNUNET_a2s (sa, salen));
+    {
+      (*ok) &= ~8;
+      return;
+    }
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+             _("Got IP address `%s' for our host.\n"), GNUNET_a2s (sa,
+                                                                   salen));
 }
 
 
@@ -63,21 +64,21 @@
   if (hostname == NULL)
     return;
   if (0 == strcmp (hostname, "127.0.0.1"))
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n",
-                hostname);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Received correct hostname `%s'.\n", hostname);
 #endif
-    (*ok) &= ~4;
-  }
+      (*ok) &= ~4;
+    }
   else
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received invalid hostname `%s'.\n",
-                hostname);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Received invalid hostname `%s'.\n", hostname);
 #endif
-    GNUNET_break (0);
-  }
+      GNUNET_break (0);
+    }
 }
 
 
@@ -89,19 +90,19 @@
   if (hostname == NULL)
     return;
   if (0 == strcmp (hostname, "localhost"))
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n",
-                hostname);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Received correct hostname `%s'.\n", hostname);
 #endif
-    (*ok) &= ~2;
-  }
+      (*ok) &= ~2;
+    }
   else
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Received unexpected hostname `%s', expected `localhost' (this 
could be OK).\n",
-                hostname);
-  }
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                 "Received unexpected hostname `%s', expected `localhost' 
(this could be OK).\n",
+                 hostname);
+    }
 }
 
 static void
@@ -114,19 +115,19 @@
     return;
   GNUNET_assert (sizeof (struct sockaddr_in) == salen);
   if (sai->sin_addr.s_addr == htonl (INADDR_LOOPBACK))
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct address.\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct address.\n");
 #endif
-    (*ok) &= ~1;
-  }
+      (*ok) &= ~1;
+    }
   else
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received incorrect address.\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received incorrect address.\n");
 #endif
-    GNUNET_break (0);
-  }
+      GNUNET_break (0);
+    }
 }
 
 static void
@@ -138,32 +139,32 @@
   char hostname[GNUNET_OS_get_hostname_max_length () + 1];
 
   if (0 != gethostname (hostname, sizeof (hostname) - 1))
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                         "gethostname");
-    return;
-  }
+    {
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                          "gethostname");
+      return;
+    }
 #if DEBUG_RESOLVER
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"),
-              hostname);
+             hostname);
 #endif
   host = gethostbyname (hostname);
   if (NULL == host)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _("Could not resolve our FQDN : %s %u\n"), hstrerror (h_errno),
-                h_errno);
-    return;
-  }
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 _("Could not resolve our FQDN : %s %u\n"),
+                 hstrerror (h_errno), h_errno);
+      return;
+    }
 
   GNUNET_assert (0 != host);
 
   result = strcmp (host->h_name, gnunet_fqdn);
   if (0 != result)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Local resolved and resolver resolved fqdns are not equal\n");
-  }
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Local resolved and resolver resolved fqdns are not equal\n");
+    }
   GNUNET_assert (0 == result);
 }
 
@@ -180,21 +181,21 @@
   GNUNET_assert (sizeof (struct sockaddr_in) == salen);
 
   if (0 == strcmp (inet_ntoa (sai->sin_addr), ROOTSERVER_IP))
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Received correct rootserver ip address.\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Received correct rootserver ip address.\n");
 #endif
-    (*ok) &= ~1;
-  }
+      (*ok) &= ~1;
+    }
   else
-  {
+    {
 #if DEBUG_RESOLVER
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Received incorrect rootserver ip address.\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Received incorrect rootserver ip address.\n");
 #endif
-    GNUNET_break (0);
-  }
+      GNUNET_break (0);
+    }
 }
 
 static void
@@ -206,21 +2