gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31221 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r31221 - gnunet/src/transport
Date: Mon, 9 Dec 2013 15:52:22 +0100

Author: grothoff
Date: 2013-12-09 15:52:22 +0100 (Mon, 09 Dec 2013)
New Revision: 31221

Modified:
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/gnunet-service-transport_clients.c
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
-doxygen, indentation fixes

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2013-12-09 14:50:26 UTC 
(rev 31220)
+++ gnunet/src/transport/gnunet-service-transport.c     2013-12-09 14:52:22 UTC 
(rev 31221)
@@ -150,15 +150,12 @@
 
   do_forward = GNUNET_SYSERR;
   ret = GST_neighbours_calculate_receive_delay (peer, msg_size, &do_forward);
-
   if (! GST_neighbours_test_connected (peer))
   {
-
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Discarded %u bytes type %u payload from peer `%s'\n",
                 msg_size,
                 ntohs (message->type), GNUNET_i2s (peer));
-
     GNUNET_STATISTICS_update (GST_stats,
                               gettext_noop
                               ("# bytes payload discarded due to not connected 
peer"),
@@ -175,9 +172,7 @@
   im->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_RECV);
   im->peer = *peer;
   memcpy (&im[1], message, ntohs (message->size));
-
   GST_clients_broadcast (&im->header, GNUNET_YES);
-
   return ret;
 }
 
@@ -654,7 +649,6 @@
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "We are now connected to peer `%s' and %u peers in total\n",
               GNUNET_i2s (peer), connections);
-
   connect_msg->header.size = htons (sizeof (buf));
   connect_msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
   connect_msg->id = *peer;

Modified: gnunet/src/transport/gnunet-service-transport_clients.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_clients.c     2013-12-09 
14:50:26 UTC (rev 31220)
+++ gnunet/src/transport/gnunet-service-transport_clients.c     2013-12-09 
14:52:22 UTC (rev 31221)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010,2011 Christian Grothoff (and other contributing authors)
+     (C) 2010-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -381,9 +381,10 @@
   if ((tc->message_count >= MAX_PENDING) && (GNUNET_YES == may_drop))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _
-                ("Dropping message of type %u and size %u, have %u/%u messages 
pending\n"),
-                ntohs (msg->type), ntohs (msg->size), tc->message_count,
+                _("Dropping message of type %u and size %u, have %u/%u 
messages pending\n"),
+                ntohs (msg->type),
+                ntohs (msg->size),
+                tc->message_count,
                 MAX_PENDING);
     GNUNET_STATISTICS_update (GST_stats,
                               gettext_noop
@@ -459,7 +460,7 @@
  * Function called for each of our connected neighbours.  Notify the
  * client about the existing neighbour.
  *
- * @param cls the 'struct TransportClient' to notify
+ * @param cls the `struct TransportClient *` to notify
  * @param peer identity of the neighbour
  * @param address the address
  * @param bandwidth_in inbound bandwidth in NBO
@@ -702,9 +703,9 @@
 {
   if (GNUNET_OK != result)
   {
-         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                     "Blacklist refuses connection attempt to peer `%s'\n",
-                     GNUNET_i2s (peer));
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Blacklist refuses connection attempt to peer `%s'\n",
+                GNUNET_i2s (peer));
     return;                     /* not allowed */
   }
   GST_neighbours_try_connect (peer);
@@ -733,7 +734,7 @@
   if (0 == memcmp (&trcm->peer, &GST_my_identity,
                sizeof (struct GNUNET_PeerIdentity)))
   {
-       GNUNET_break_op (0);
+    GNUNET_break_op (0);
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Received a request connect message myself `%s'\n",
                 GNUNET_i2s (&trcm->peer));
@@ -816,8 +817,7 @@
   }
   address = (const char *) &alum[1];
   plugin_name = (const char *) &address[address_len];
-  if (plugin_name[size - sizeof (struct AddressLookupMessage) - address_len - 
1]
-      != '\0')
+  if ('\0' != plugin_name[size - sizeof (struct AddressLookupMessage) - 
address_len - 1])
   {
     GNUNET_break (0);
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2013-12-09 
14:50:26 UTC (rev 31220)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2013-12-09 
14:52:22 UTC (rev 31221)
@@ -2457,7 +2457,7 @@
  */
 static void
 utilization_transmission (void *cls,
-             const struct GNUNET_SCHEDULER_TaskContext *tc)
+                          const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   util_transmission_tk = GNUNET_SCHEDULER_NO_TASK;
 
@@ -3234,37 +3234,37 @@
 /**
  * Call the callback from the closure for each connected neighbour.
  *
- * @param cls the 'struct IteratorContext'
+ * @param cls the `struct IteratorContext`
  * @param key the hash of the public key of the neighbour
- * @param value the 'struct NeighbourMapEntry'
- * @return GNUNET_OK (continue to iterate)
+ * @param value the `struct NeighbourMapEntry`
+ * @return #GNUNET_OK (continue to iterate)
  */
 static int
-neighbours_iterate (void *cls, const struct GNUNET_PeerIdentity * key, void 
*value)
+neighbours_iterate (void *cls,
+                    const struct GNUNET_PeerIdentity *key,
+                    void *value)
 {
   struct IteratorContext *ic = cls;
   struct NeighbourMapEntry *n = value;
+  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
+  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
 
-  if (GNUNET_YES == test_connected (n))
+  if (GNUNET_YES != test_connected (n))
+    return GNUNET_OK;
+
+  if (NULL != n->primary_address.address)
   {
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
-
-    if (NULL != n->primary_address.address)
-    {
-      bandwidth_in = n->primary_address.bandwidth_in;
-      bandwidth_out = n->primary_address.bandwidth_out;
-    }
-    else
-    {
-      bandwidth_in = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
-      bandwidth_out = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
-    }
-
-    ic->cb (ic->cb_cls, &n->id,
-            n->primary_address.address,
-            bandwidth_in, bandwidth_out);
+    bandwidth_in = n->primary_address.bandwidth_in;
+    bandwidth_out = n->primary_address.bandwidth_out;
   }
+  else
+  {
+    bandwidth_in = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
+    bandwidth_out = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
+  }
+  ic->cb (ic->cb_cls, &n->id,
+          n->primary_address.address,
+          bandwidth_in, bandwidth_out);
   return GNUNET_OK;
 }
 




reply via email to

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