gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6346 - in GNUnet/src: applications/fs/gap applications/fs/


From: gnunet
Subject: [GNUnet-SVN] r6346 - in GNUnet/src: applications/fs/gap applications/fs/tools applications/rpc applications/topology_default server
Date: Sat, 16 Feb 2008 21:53:47 -0700 (MST)

Author: grothoff
Date: 2008-02-16 21:53:46 -0700 (Sat, 16 Feb 2008)
New Revision: 6346

Modified:
   GNUnet/src/applications/fs/gap/migration.c
   GNUnet/src/applications/fs/tools/gnunet-auto-share.c
   GNUnet/src/applications/rpc/rpc.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/server/connection.c
Log:
formatting

Modified: GNUnet/src/applications/fs/gap/migration.c
===================================================================
--- GNUnet/src/applications/fs/gap/migration.c  2008-02-17 04:52:21 UTC (rev 
6345)
+++ GNUnet/src/applications/fs/gap/migration.c  2008-02-17 04:53:46 UTC (rev 
6346)
@@ -223,7 +223,7 @@
                      "Migration: no content available for migration.\n");
 #endif
       GNUNET_mutex_unlock (GNUNET_FS_lock);
-      GNUNET_FS_PT_change_rc (index, -1);  
+      GNUNET_FS_PT_change_rc (index, -1);
       return 0;
     }
   value = content[entry].value;

Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-auto-share.c        2008-02-17 
04:52:21 UTC (rev 6345)
+++ GNUnet/src/applications/fs/tools/gnunet-auto-share.c        2008-02-17 
04:53:46 UTC (rev 6346)
@@ -212,9 +212,9 @@
   time_t latest;
   struct stat buf;
   struct AddMetadataClosure amc;
-  struct GNUNET_ECRS_URI * kuri;
+  struct GNUNET_ECRS_URI *kuri;
   char *fn;
-  char * keys;
+  char *keys;
 
   if (filename[0] == '.')
     return GNUNET_OK;
@@ -242,8 +242,7 @@
       GNUNET_free (fn);
       return GNUNET_OK;
     }
-  if ( (start > latest) &&
-       (current_pos < done_pos) )
+  if ((start > latest) && (current_pos < done_pos))
     {
       GNUNET_free (fn);
       current_pos++;
@@ -256,16 +255,13 @@
      over all config values! */
   GNUNET_GC_attach_change_listener (meta_cfg, &add_meta_data, &amc);
   GNUNET_GC_detach_change_listener (meta_cfg, &add_meta_data, &amc);
-  keys = GNUNET_ECRS_meta_data_get_by_type(amc.meta,
-                                          EXTRACTOR_KEYWORDS);
+  keys = GNUNET_ECRS_meta_data_get_by_type (amc.meta, EXTRACTOR_KEYWORDS);
   if (keys != NULL)
-    kuri = GNUNET_ECRS_keyword_string_to_uri(NULL, keys);
+    kuri = GNUNET_ECRS_keyword_string_to_uri (NULL, keys);
   else
     kuri = NULL;
-  GNUNET_ECRS_meta_data_delete(amc.meta,
-                              EXTRACTOR_KEYWORDS,
-                              keys);
-  GNUNET_free_non_null(keys);
+  GNUNET_ECRS_meta_data_delete (amc.meta, EXTRACTOR_KEYWORDS, keys);
+  GNUNET_free_non_null (keys);
   ul = GNUNET_FSUI_upload_start (ctx,
                                  fn,
                                  (GNUNET_FSUI_DirectoryScanCallback) &
@@ -275,7 +271,7 @@
                                  GNUNET_get_time () + 2 * GNUNET_CRON_YEARS,
                                  amc.meta, gloKeywords, kuri);
   if (kuri != NULL)
-    GNUNET_ECRS_uri_destroy(kuri);
+    GNUNET_ECRS_uri_destroy (kuri);
   GNUNET_ECRS_meta_data_destroy (amc.meta);
   GNUNET_free (fn);
   return GNUNET_SYSERR;
@@ -322,13 +318,14 @@
                                             "GNUNET",
                                             "VERBOSE", 0, 9999, 0, &verbose);
   if (0 == GNUNET_GC_get_configuration_value_number (cfg,
-                                                    "GNUNET-AUTO-SHARE",
-                                                    "TIMESTAMP-LAST-RUN", 0, 
-1, 0, &cfg_start))
+                                                     "GNUNET-AUTO-SHARE",
+                                                     "TIMESTAMP-LAST-RUN", 0,
+                                                     -1, 0, &cfg_start))
     {
       last = (time_t) cfg_start;
     }
   else
-    last = 0;  
+    last = 0;
   metafn = NULL;
   GNUNET_GC_get_configuration_value_filename (cfg,
                                               "FS",
@@ -351,17 +348,16 @@
       current_pos = 0;
       GNUNET_disk_directory_scan (ectx, dirname, &probe_directory, &last);
       if (ul == NULL)
-       {
-         last = start;
-         done_pos = 0;
-         GNUNET_GC_set_configuration_value_number (cfg,
-                                                   ectx,
-                                                   "GNUNET-AUTO-SHARE",
-                                                   "TIMESTAMP-LAST-RUN", 
-                                                   last);        
-         GNUNET_GC_write_configuration(cfg,
-                                       cfgFilename);
-       }
+        {
+          last = start;
+          done_pos = 0;
+          GNUNET_GC_set_configuration_value_number (cfg,
+                                                    ectx,
+                                                    "GNUNET-AUTO-SHARE",
+                                                    "TIMESTAMP-LAST-RUN",
+                                                    last);
+          GNUNET_GC_write_configuration (cfg, cfgFilename);
+        }
       if (GNUNET_YES == upload_done)
         {
           GNUNET_FSUI_upload_abort (ctx, ul);
@@ -377,9 +373,9 @@
             delay = GNUNET_CRON_HOURS;
         }
       else
-       {         
-         delay = 5 * GNUNET_CRON_SECONDS;
-       }
+        {
+          delay = 5 * GNUNET_CRON_SECONDS;
+        }
     }
   GNUNET_FSUI_stop (ctx);
   if (gloKeywords != NULL)

Modified: GNUnet/src/applications/rpc/rpc.c
===================================================================
--- GNUnet/src/applications/rpc/rpc.c   2008-02-17 04:52:21 UTC (rev 6345)
+++ GNUnet/src/applications/rpc/rpc.c   2008-02-17 04:53:46 UTC (rev 6346)
@@ -797,7 +797,7 @@
   if (ntohs (req->header.size) < sizeof (P2P_rpc_MESSAGE) + slen)
     return NULL;                /* invalid! */
   ret =
-    GNUNET_RPC_parameters_deserialize (&((char*)&req[1])[slen],
+    GNUNET_RPC_parameters_deserialize (&((char *) &req[1])[slen],
                                        ntohs (req->header.size) -
                                        sizeof (P2P_rpc_MESSAGE) - slen);
   if (GNUNET_RPC_parameters_count (ret) != ntohs (req->argumentCount))
@@ -853,8 +853,7 @@
     {
       memcpy (&ret[1], name, slen);
     }
-  GNUNET_RPC_parameters_serialize (values,
-                                   &((char*)&ret[1])[slen]);
+  GNUNET_RPC_parameters_serialize (values, &((char *) &ret[1])[slen]);
 
   if (name == NULL)
     ret->header.type = htons (GNUNET_P2P_PROTO_RPC_RES);
@@ -1102,7 +1101,7 @@
 
       if (error == GNUNET_RPC_ERROR_OK)
         {
-          reply = GNUNET_RPC_parameters_deserialize ((char*)&res[1],
+          reply = GNUNET_RPC_parameters_deserialize ((char *) &res[1],
                                                      ntohs (message->size) -
                                                      sizeof
                                                      (P2P_rpc_MESSAGE));

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2008-02-17 04:52:21 UTC 
(rev 6345)
+++ GNUnet/src/applications/topology_default/topology.c 2008-02-17 04:53:46 UTC 
(rev 6346)
@@ -552,8 +552,8 @@
       pos = 0;
       while ((pos < size) && isspace (data[pos]))
         pos++;
-      while ( (size >= sizeof(GNUNET_EncName)) &&
-             (pos <= size - sizeof (GNUNET_EncName)) )
+      while ((size >= sizeof (GNUNET_EncName)) &&
+             (pos <= size - sizeof (GNUNET_EncName)))
         {
           memcpy (&enc, &data[pos], sizeof (GNUNET_EncName));
           if (!isspace (enc.encoding[sizeof (GNUNET_EncName) - 1]))
@@ -563,10 +563,9 @@
                              GNUNET_GE_USER,
                              _
                              ("Syntax error in topology specification, 
skipping bytes.\n"));
-             pos++;
-             while ( (pos < size) &&
-                     (! isspace (data[pos])) )
-               pos++;
+              pos++;
+              while ((pos < size) && (!isspace (data[pos])))
+                pos++;
               continue;
             }
           enc.encoding[sizeof (GNUNET_EncName) - 1] = '\0';

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2008-02-17 04:52:21 UTC (rev 6345)
+++ GNUnet/src/server/connection.c      2008-02-17 04:53:46 UTC (rev 6346)
@@ -2509,8 +2509,8 @@
 #endif
               identity->blacklistHost (&entries[u]->session.sender, 24 * 60 * 
60,       /* 1 day */
                                        GNUNET_YES);
-             if (stats != NULL)
-               stats->change(stat_shutdown_excessive_bandwidth, 1);
+              if (stats != NULL)
+                stats->change (stat_shutdown_excessive_bandwidth, 1);
               shutdownConnection (entries[u]);
               activePeerCount--;
               entries[u] = entries[activePeerCount];
@@ -2790,8 +2790,8 @@
           identity->blacklistHost (&be->session.sender,
                                    SECONDS_BLACKLIST_AFTER_DISCONNECT,
                                    GNUNET_YES);
-         if (stats != NULL)
-           stats->change(stat_shutdown_insufficient_bandwidth, 1);
+          if (stats != NULL)
+            stats->change (stat_shutdown_insufficient_bandwidth, 1);
           shutdownConnection (be);
         }
       else
@@ -2908,8 +2908,8 @@
                   identity->blacklistHost (&root->session.sender,
                                            SECONDS_BLACKLIST_AFTER_DISCONNECT,
                                            GNUNET_YES);
-                 if (stats != NULL)
-                   stats->change(stat_shutdown_timeout, 1);
+                  if (stats != NULL)
+                    stats->change (stat_shutdown_timeout, 1);
                   shutdownConnection (root);
                 }
               if ((root->consider_transport_switch == GNUNET_YES)
@@ -3015,8 +3015,8 @@
                   identity->blacklistHost (&root->session.sender,
                                            
SECONDS_BLACKLIST_AFTER_FAILED_CONNECT,
                                            GNUNET_NO);
-                 if (stats != NULL)
-                   stats->change(stat_shutdown_connect_timeout, 1);
+                  if (stats != NULL)
+                    stats->change (stat_shutdown_connect_timeout, 1);
                   shutdownConnection (root);
                 }
               break;
@@ -3256,7 +3256,7 @@
   identity->blacklistHost (&be->session.sender,
                            SECONDS_BLACKLIST_AFTER_DISCONNECT, GNUNET_YES);
   if (stats != NULL)
-    stats->change(stat_shutdown_hangup_received, 1);
+    stats->change (stat_shutdown_hangup_received, 1);
   shutdownConnection (be);
   GNUNET_mutex_unlock (lock);
   return GNUNET_OK;
@@ -3766,19 +3766,24 @@
         create (gettext_noop ("# average connection lifetime (in ms)"));
       stat_shutdown_excessive_bandwidth =
         stats->
-        create (gettext_noop ("# connections shutdown because other peer sent 
too much"));
+        create (gettext_noop
+                ("# connections shutdown because other peer sent too much"));
       stat_shutdown_insufficient_bandwidth =
         stats->
-        create (gettext_noop ("# connections shutdown because we lacked 
bandwidth"));
+        create (gettext_noop
+                ("# connections shutdown because we lacked bandwidth"));
       stat_shutdown_timeout =
         stats->
-        create (gettext_noop ("# connections shutdown because other peer timed 
out"));
+        create (gettext_noop
+                ("# connections shutdown because other peer timed out"));
       stat_shutdown_connect_timeout =
         stats->
-        create (gettext_noop ("# connections shutdown because other peer timed 
out during connect"));
+        create (gettext_noop
+                ("# connections shutdown because other peer timed out during 
connect"));
       stat_shutdown_hangup_received =
         stats->
-        create (gettext_noop ("# connections shutdown because other peer 
requested it"));
+        create (gettext_noop
+                ("# connections shutdown because other peer requested it"));
     }
   transport->start (&GNUNET_CORE_p2p_receive);
   EXIT ();





reply via email to

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