gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37469 - in gnunet/src: ats-tests secretsharing transport


From: gnunet
Subject: [GNUnet-SVN] r37469 - in gnunet/src: ats-tests secretsharing transport
Date: Wed, 6 Jul 2016 17:58:42 +0200

Author: grothoff
Date: 2016-07-06 17:58:41 +0200 (Wed, 06 Jul 2016)
New Revision: 37469

Modified:
   gnunet/src/ats-tests/ats-testing-experiment.c
   gnunet/src/secretsharing/gnunet-service-secretsharing.c
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/gnunet-transport-profiler.c
   gnunet/src/transport/plugin_transport_http_server.c
Log:
misc minor fixes

Modified: gnunet/src/ats-tests/ats-testing-experiment.c
===================================================================
--- gnunet/src/ats-tests/ats-testing-experiment.c       2016-07-06 15:24:26 UTC 
(rev 37468)
+++ gnunet/src/ats-tests/ats-testing-experiment.c       2016-07-06 15:58:41 UTC 
(rev 37469)
@@ -196,7 +196,8 @@
     GNUNET_asprintf(&op_name, "op-%u-type", op_counter);
     if ( (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_string(cfg,
             sec_name, op_name, &type)) &&
-        ((STOP_SEND != o->type) || (STOP_PREFERENCE != o->type)))
+         (STOP_SEND != o->type) &&
+         (STOP_PREFERENCE != o->type) )
     {
       /* Load arguments for set_rate, start_send, set_preference */
       if (0 == strcmp (type, "constant"))

Modified: gnunet/src/secretsharing/gnunet-service-secretsharing.c
===================================================================
--- gnunet/src/secretsharing/gnunet-service-secretsharing.c     2016-07-06 
15:24:26 UTC (rev 37468)
+++ gnunet/src/secretsharing/gnunet-service-secretsharing.c     2016-07-06 
15:58:41 UTC (rev 37469)
@@ -605,6 +605,7 @@
   GNUNET_free (ds);
 }
 
+
 static void
 keygen_info_destroy (struct KeygenPeerInfo *info)
 {
@@ -621,7 +622,7 @@
   if (NULL != info->preshare_commitment)
   {
     gcry_mpi_release (info->preshare_commitment);
-    info->presecret_commitment = NULL;
+    info->preshare_commitment = NULL;
   }
 }
 

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2016-07-06 15:24:26 UTC 
(rev 37468)
+++ gnunet/src/transport/gnunet-service-transport.c     2016-07-06 15:58:41 UTC 
(rev 37469)
@@ -859,7 +859,6 @@
   }
 
   max_fd_rlimit = 0;
-  max_fd_cfg = 0;
 #if HAVE_GETRLIMIT
   struct rlimit r_file;
   if (0 == getrlimit (RLIMIT_NOFILE, &r_file))
@@ -872,10 +871,12 @@
   }
   max_fd_rlimit = (9 * max_fd_rlimit) / 10; /* Keep 10% for rest of transport 
*/
 #endif
-  GNUNET_CONFIGURATION_get_value_number (GST_cfg,
-                                         "transport",
-                                         "MAX_FD",
-                                         &max_fd_cfg);
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (GST_cfg,
+                                             "transport",
+                                             "MAX_FD",
+                                             &max_fd_cfg))
+    max_fd_cfg = max_fd_rlimit;
 
   if (max_fd_cfg > max_fd_rlimit)
     max_fd = max_fd_cfg;
@@ -886,7 +887,9 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Limiting number of sockets to %u: validation %u, neighbors: 
%u\n",
-             max_fd, (max_fd / 3), (max_fd / 3) * 2);
+              max_fd,
+              (max_fd / 3),
+              (max_fd / 3) * 2);
 
   friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg,
                                                       "topology",

Modified: gnunet/src/transport/gnunet-transport-profiler.c
===================================================================
--- gnunet/src/transport/gnunet-transport-profiler.c    2016-07-06 15:24:26 UTC 
(rev 37468)
+++ gnunet/src/transport/gnunet-transport-profiler.c    2016-07-06 15:58:41 UTC 
(rev 37469)
@@ -225,9 +225,10 @@
 
       avg_duration += icur->dur.rel_value_us / (1000);
       avg_rate  += icur->rate;
-      iterations ++;
+      iterations++;
     }
-
+    if (0 == iterations)
+      iterations = 1; /* avoid division by zero */
     /* Calculate average rate */
     avg_rate /= iterations;
     /* Calculate average duration */
@@ -254,17 +255,27 @@
     stddev_duration = sqrtf(stddev_duration);
 
     /* Output */
-    FPRINTF (stdout, _("%u;%u;%llu;%llu;%.2f;%.2f"),benchmark_count, 
benchmark_size,
-        avg_duration, (unsigned long long) stddev_duration, avg_rate, 
stddev_rate);
+    FPRINTF (stdout,
+             "%u;%u;%llu;%llu;%.2f;%.2f",
+             benchmark_count,
+             benchmark_size,
+             avg_duration,
+             (unsigned long long) stddev_duration,
+             avg_rate,
+             stddev_rate);
 
     inext = ihead;
     while (NULL != (icur = inext))
     {
       inext = icur->next;
-      GNUNET_CONTAINER_DLL_remove (ihead, itail, icur);
+      GNUNET_CONTAINER_DLL_remove (ihead,
+                                   itail,
+                                   icur);
 
-      FPRINTF (stdout, _(";%llu;%.2f"),
-          (long long unsigned int) (icur->dur.rel_value_us / 1000), 
icur->rate);
+      FPRINTF (stdout,
+               ";%llu;%.2f",
+               (long long unsigned int) (icur->dur.rel_value_us / 1000),
+               icur->rate);
 
       GNUNET_free (icur);
     }
@@ -274,13 +285,13 @@
   {
     duration = GNUNET_TIME_absolute_get_duration (start_time);
     FPRINTF (stdout,
-             _("Received %llu bytes/s (%llu bytes in %s)\n"),
+             "Received %llu bytes/s (%llu bytes in %s)\n",
              1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us),
              traffic_received,
              GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
   }
 #endif
-  FPRINTF (stdout, _("\n"));
+  FPRINTF (stdout, "\n");
 }
 
 static void
@@ -333,7 +344,7 @@
   }
   if (verbosity > 0)
     if (itail->msgs_sent % 10 == 0 )
-    FPRINTF (stdout, _("."));
+    FPRINTF (stdout, ".");
   return size;
 }
 
@@ -353,8 +364,10 @@
 
     if (verbosity > 0)
       FPRINTF (stdout,
-          _("\nStarting benchmark to `%s', starting to send %u messages in %u 
byte blocks\n"),
-          GNUNET_i2s (&pid), benchmark_count, benchmark_size);
+               "\nStarting benchmark to `%s', starting to send %u messages in 
%u byte blocks\n",
+               GNUNET_i2s (&pid),
+               benchmark_count,
+               benchmark_size);
     if (NULL == th)
       th = GNUNET_TRANSPORT_notify_transmit_ready (handle, &pid, 
benchmark_size,
           GNUNET_TIME_UNIT_FOREVER_REL, &transmit_data, NULL );
@@ -401,7 +414,7 @@
                    sizeof(struct GNUNET_PeerIdentity)))
   {
     FPRINTF (stdout,
-             _("Connected to different peer `%s'\n"),
+             "Connected to different peer `%s'\n",
              GNUNET_i2s (&pid));
     return;
   }
@@ -408,8 +421,8 @@
 
   if (verbosity > 0)
     FPRINTF (stdout,
-        _("Successfully connected to `%s'\n"),
-        GNUNET_i2s (&pid));
+             "Successfully connected to `%s'\n",
+             GNUNET_i2s (&pid));
   iteration_start ();
 }
 
@@ -429,7 +442,8 @@
     return;
   if (GNUNET_YES == benchmark_running)
   {
-    FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"),
+    FPRINTF (stdout,
+             "Disconnected from peer `%s' while benchmarking\n",
         GNUNET_i2s (&pid));
     return;
   }
@@ -454,7 +468,7 @@
       return;
     if (verbosity > 0)
       FPRINTF (stdout,
-               _("Received %u bytes from %s\n"),
+               "Received %u bytes from %s\n",
                (unsigned int) ntohs (message->size),
                GNUNET_i2s (peer));
     return;
@@ -470,7 +484,7 @@
   {
     if (verbosity > 0)
       FPRINTF (stdout,
-               _("Denying connection to `%s'\n"),
+               "Denying connection to `%s'\n",
                GNUNET_i2s (peer));
     return GNUNET_SYSERR;
   }
@@ -494,19 +508,22 @@
 
   if (GNUNET_YES != result)
   {
-    FPRINTF (stderr, _("Service `%s' is not running\n"), "transport");
+    FPRINTF (stderr,
+             "TRANSPORT service is not running\n");
     return;
   }
 
   if (GNUNET_SERVER_MAX_MESSAGE_SIZE <= benchmark_size)
   {
-    FPRINTF (stderr, _("Message size too big!\n"));
+    FPRINTF (stderr,
+             "Message size too big!\n");
     return;
   }
 
   if (NULL == cpid)
   {
-    FPRINTF (stderr, _("No peer identity given\n"));
+    FPRINTF (stderr,
+             "No peer identity given\n");
     return;
   }
   if ((GNUNET_OK !=
@@ -513,7 +530,9 @@
        GNUNET_CRYPTO_eddsa_public_key_from_string (cpid, strlen (cpid),
                                                    &pid.public_key)))
   {
-    FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid);
+    FPRINTF (stderr,
+             "Failed to parse peer identity `%s'\n",
+             cpid);
     return;
   }
 
@@ -521,18 +540,20 @@
   {
     if (verbosity > 0)
       FPRINTF (stderr,
-        _("Trying to send %u messages with size %u to peer `%s'\n"),
-          benchmark_count, benchmark_size, GNUNET_i2s (&pid));
+               "Trying to send %u messages with size %u to peer `%s'\n",
+               benchmark_count, benchmark_size,
+               GNUNET_i2s (&pid));
   }
   else if (1 == benchmark_receive)
   {
     FPRINTF (stderr,
-        _("Trying to receive messages from peer `%s'\n"),
-        GNUNET_i2s (&pid));
+             "Trying to receive messages from peer `%s'\n",
+             GNUNET_i2s (&pid));
   }
   else
   {
-    FPRINTF (stderr, _("No operation given\n"));
+    FPRINTF (stderr,
+             "No operation given\n");
     return;
   }
 
@@ -539,7 +560,8 @@
   ats = GNUNET_ATS_connectivity_init (cfg);
   if (NULL == ats)
   {
-    FPRINTF (stderr, "%s", _("Failed to connect to ATS service\n"));
+    FPRINTF (stderr,
+             "Failed to connect to ATS service\n");
     ret = 1;
     return;
   }
@@ -550,7 +572,8 @@
                                      &notify_disconnect);
   if (NULL == handle)
   {
-    FPRINTF (stderr, "%s", _("Failed to connect to transport service\n"));
+    FPRINTF (stderr,
+             "Failed to connect to transport service\n");
     GNUNET_ATS_connectivity_done (ats);
     ats = NULL;
     ret = 1;
@@ -583,8 +606,11 @@
      const struct GNUNET_CONFIGURATION_Handle *mycfg)
 {
   cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg;
-  GNUNET_CLIENT_service_test ("transport", cfg, GNUNET_TIME_UNIT_SECONDS,
-      &testservice_task, (void *) cfg);
+  GNUNET_CLIENT_service_test ("transport",
+                              cfg,
+                              GNUNET_TIME_UNIT_SECONDS,
+                              &testservice_task,
+                              (void *) cfg);
 }
 
 

Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2016-07-06 15:24:26 UTC 
(rev 37468)
+++ gnunet/src/transport/plugin_transport_http_server.c 2016-07-06 15:58:41 UTC 
(rev 37469)
@@ -3059,7 +3059,7 @@
                          "%s:%u/%s",
                          tmp,
                          (uint16_t) port,
-                         (NULL == pos_url) ? "" : pos_url);
+                         pos_url);
       }
       else
         GNUNET_asprintf (&plugin->external_hostname,




reply via email to

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