gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r34418 - in gnunet: po src/transport src/util


From: gnunet
Subject: [GNUnet-SVN] r34418 - in gnunet: po src/transport src/util
Date: Sun, 23 Nov 2014 20:05:12 +0100

Author: grothoff
Date: 2014-11-23 20:05:11 +0100 (Sun, 23 Nov 2014)
New Revision: 34418

Modified:
   gnunet/po/POTFILES.in
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/gnunet-service-transport_clients.c
   gnunet/src/transport/plugin_transport_tcp.c
   gnunet/src/util/server.c
Log:
-indentation, doxygen

Modified: gnunet/po/POTFILES.in
===================================================================
--- gnunet/po/POTFILES.in       2014-11-23 18:55:38 UTC (rev 34417)
+++ gnunet/po/POTFILES.in       2014-11-23 19:05:11 UTC (rev 34418)
@@ -361,6 +361,7 @@
 src/transport/transport_api_blacklist.c
 src/transport/transport_api.c
 src/transport/transport_api_monitor_peers.c
+src/transport/transport_api_monitor_plugins.c
 src/transport/transport_api_monitor_validation.c
 src/transport/transport-testing.c
 src/tun/regex.c

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2014-11-23 18:55:38 UTC 
(rev 34417)
+++ gnunet/src/transport/gnunet-service-transport.c     2014-11-23 19:05:11 UTC 
(rev 34418)
@@ -732,8 +732,10 @@
  */
 void
 GST_ats_update_metrics (const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address, struct Session *session,
-    const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+                        const struct GNUNET_HELLO_Address *address,
+                        struct Session *session,
+                        const struct GNUNET_ATS_Information *ats,
+                        uint32_t ats_count)
 {
   struct GNUNET_ATS_Information *ats_new;
 
@@ -770,21 +772,27 @@
  */
 static void
 plugin_env_update_metrics (void *cls,
-    const struct GNUNET_HELLO_Address *address,
-    struct Session *session,
-    const struct GNUNET_ATS_Information *ats,
-    uint32_t ats_count)
+                           const struct GNUNET_HELLO_Address *address,
+                           struct Session *session,
+                           const struct GNUNET_ATS_Information *ats,
+                           uint32_t ats_count)
 {
   if ((NULL == ats) || (0 == ats_count))
     return;
   GNUNET_assert(NULL != GST_ats);
 
-  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
-      "Updating metrics for peer `%s' address %s session %p\n",
-      GNUNET_i2s (&address->peer), GST_plugins_a2s (address), session);
-  GST_ats_update_metrics (&address->peer, address, session, ats, ats_count);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Updating metrics for peer `%s' address %s session %p\n",
+              GNUNET_i2s (&address->peer),
+              GST_plugins_a2s (address),
+              session);
+  GST_ats_update_metrics (&address->peer,
+                          address,
+                          session,
+                          ats, ats_count);
 }
 
+
 /**
  * Black list check result for try_connect call
  * If connection to the peer is allowed request adddress and
@@ -829,9 +837,11 @@
  * @param ats_count number of @a ats information
  */
 static void
-plugin_env_session_start (void *cls, struct GNUNET_HELLO_Address *address,
-    struct Session *session, const struct GNUNET_ATS_Information *ats,
-    uint32_t ats_count)
+plugin_env_session_start (void *cls,
+                          struct GNUNET_HELLO_Address *address,
+                          struct Session *session,
+                          const struct GNUNET_ATS_Information *ats,
+                          uint32_t ats_count)
 {
   struct BlacklistCheckContext *blctx;
   struct GST_BlacklistCheck *blc;
@@ -876,6 +886,7 @@
   }
 }
 
+
 /**
  * Function called by ATS to notify the callee that the
  * assigned bandwidth or address for a given peer was changed.  If the
@@ -896,13 +907,13 @@
  */
 static void
 ats_request_address_change (void *cls,
-    const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address,
-    struct Session *session,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-    const struct GNUNET_ATS_Information *ats,
-    uint32_t ats_count)
+                            const struct GNUNET_PeerIdentity *peer,
+                            const struct GNUNET_HELLO_Address *address,
+                            struct Session *session,
+                            struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
+                            struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+                            const struct GNUNET_ATS_Information *ats,
+                            uint32_t ats_count)
 {
   uint32_t bw_in = ntohl (bandwidth_in.value__);
   uint32_t bw_out = ntohl (bandwidth_out.value__);
@@ -952,6 +963,7 @@
   GST_clients_broadcast (&connect_msg->header, GNUNET_NO);
 }
 
+
 /**
  * Function called to notify transport users that another
  * peer disconnected from us.
@@ -961,7 +973,7 @@
  */
 static void
 neighbours_disconnect_notification (void *cls,
-    const struct GNUNET_PeerIdentity *peer)
+                                    const struct GNUNET_PeerIdentity *peer)
 {
   struct DisconnectInfoMessage disconnect_msg;
 
@@ -978,6 +990,7 @@
   GST_clients_broadcast (&disconnect_msg.header, GNUNET_NO);
 }
 
+
 /**
  * Function called to notify transport users that a neighbour peer changed its
  * active address.
@@ -992,21 +1005,24 @@
  */
 static void
 neighbours_changed_notification (void *cls,
-    const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address,
-    enum GNUNET_TRANSPORT_PeerState state,
-    struct GNUNET_TIME_Absolute state_timeout,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
+                                 const struct GNUNET_PeerIdentity *peer,
+                                 const struct GNUNET_HELLO_Address *address,
+                                 enum GNUNET_TRANSPORT_PeerState state,
+                                 struct GNUNET_TIME_Absolute state_timeout,
+                                 struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_in,
+                                 struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_out)
 {
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
-      "Notifying about change for peer `%s' with address `%s' in state `%s' 
timing out at %s\n",
-      GNUNET_i2s (peer),
-      (NULL != address) ? GST_plugins_a2s (address) : "<none>",
-      GNUNET_TRANSPORT_ps2s (state),
-      GNUNET_STRINGS_absolute_time_to_string (state_timeout));
+             "Notifying about change for peer `%s' with address `%s' in state 
`%s' timing out at %s\n",
+             GNUNET_i2s (peer),
+             (NULL != address) ? GST_plugins_a2s (address) : "<none>",
+             GNUNET_TRANSPORT_ps2s (state),
+             GNUNET_STRINGS_absolute_time_to_string (state_timeout));
 
-  GST_clients_broadcast_peer_notification (peer, address, state, 
state_timeout);
+  GST_clients_broadcast_peer_notification (peer,
+                                           address,
+                                           state,
+                                           state_timeout);
 }
 
 
@@ -1049,6 +1065,7 @@
   GST_server = NULL;
 }
 
+
 /**
  * Initiate transport service.
  *
@@ -1078,16 +1095,18 @@
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  if (GNUNET_OK
-      != GNUNET_CONFIGURATION_get_value_time (c, "transport",
-          "HELLO_EXPIRATION", &hello_expiration))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_time (c,
+                                           "transport",
+                                           "HELLO_EXPIRATION",
+                                           &hello_expiration))
   {
     hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION;
   }
   GST_server = server;
   pk = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile);
-  GNUNET_free(keyfile);
-  GNUNET_assert(NULL != pk);
+  GNUNET_free (keyfile);
+  GNUNET_assert (NULL != pk);
   GST_my_private_key = pk;
 
   GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg);
@@ -1096,8 +1115,9 @@
       &GST_my_identity.public_key);
   GNUNET_assert(NULL != GST_my_private_key);
 
-  GNUNET_log(GNUNET_ERROR_TYPE_INFO, "My identity is `%4s'\n",
-      GNUNET_i2s_full (&GST_my_identity));
+  GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+             "My identity is `%4s'\n",
+             GNUNET_i2s_full (&GST_my_identity));
 
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
       NULL );
@@ -1149,18 +1169,18 @@
       NULL );
   GST_manipulation_init (GST_cfg);
   GST_plugins_load (&GST_manipulation_recv,
-      &GST_neighbours_register_quota_notification,
-      &GST_neighbours_unregister_quota_notification,
-      &plugin_env_address_change_notification,
-      &plugin_env_session_start,
-      &plugin_env_session_end,
-      &plugin_env_address_to_type,
-      &plugin_env_update_metrics);
+                    &GST_neighbours_register_quota_notification,
+                    &GST_neighbours_unregister_quota_notification,
+                    &plugin_env_address_change_notification,
+                    &plugin_env_session_start,
+                    &plugin_env_session_end,
+                    &plugin_env_address_to_type,
+                    &plugin_env_update_metrics);
   GST_neighbours_start (NULL,
-      &neighbours_connect_notification,
-      &neighbours_disconnect_notification,
-      &neighbours_changed_notification,
-      (max_fd / 3) * 2);
+                        &neighbours_connect_notification,
+                        &neighbours_disconnect_notification,
+                        &neighbours_changed_notification,
+                        (max_fd / 3) * 2);
   GST_clients_start (GST_server);
   GST_validation_start ((max_fd / 3));
 }

Modified: gnunet/src/transport/gnunet-service-transport_clients.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_clients.c     2014-11-23 
18:55:38 UTC (rev 34417)
+++ gnunet/src/transport/gnunet-service-transport_clients.c     2014-11-23 
19:05:11 UTC (rev 34418)
@@ -1581,9 +1581,9 @@
  */
 void
 GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity 
*peer,
-    const struct GNUNET_HELLO_Address *address,
-    enum GNUNET_TRANSPORT_PeerState state,
-    struct GNUNET_TIME_Absolute state_timeout)
+                                         const struct GNUNET_HELLO_Address 
*address,
+                                         enum GNUNET_TRANSPORT_PeerState state,
+                                         struct GNUNET_TIME_Absolute 
state_timeout)
 {
   struct PeerIterateResponseMessage *msg;
   struct MonitoringClient *mc;

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2014-11-23 18:55:38 UTC (rev 
34417)
+++ gnunet/src/transport/plugin_transport_tcp.c 2014-11-23 19:05:11 UTC (rev 
34418)
@@ -2972,15 +2972,14 @@
                                          &session_disconnect_it,
                                          plugin);
 
-  next = ppc_dll_head;
-  for (cur = next; NULL != cur; cur = next)
+  for (cur = ppc_dll_head; NULL != cur; cur = next)
   {
-    GNUNET_break (0);
     next = cur->next;
     GNUNET_CONTAINER_DLL_remove (ppc_dll_head,
                                  ppc_dll_tail,
                                  cur);
     GNUNET_RESOLVER_request_cancel (cur->resolver_handle);
+    cur->asc (cur->asc_cls, NULL, GNUNET_OK);
     GNUNET_free (cur);
   }
 

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2014-11-23 18:55:38 UTC (rev 34417)
+++ gnunet/src/util/server.c    2014-11-23 19:05:11 UTC (rev 34418)
@@ -627,7 +627,7 @@
 /**
  * Set the 'monitor' flag on this client.  Clients which have been
  * marked as 'monitors' won't prevent the server from shutting down
- * once 'GNUNET_SERVER_stop_listening' has been invoked.  The idea is
+ * once '#GNUNET_SERVER_stop_listening()' has been invoked.  The idea is
  * that for "normal" clients we likely want to allow them to process
  * their requests; however, monitor-clients are likely to 'never'
  * disconnect during shutdown and thus will not be considered when
@@ -746,7 +746,8 @@
 {
   unsigned int i;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Server in soft shutdown\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server in soft shutdown\n");
   if (GNUNET_SCHEDULER_NO_TASK != server->listen_task)
   {
     GNUNET_SCHEDULER_cancel (server->listen_task);
@@ -779,7 +780,8 @@
   struct NotifyList *npos;
   unsigned int i;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Server shutting down.\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Server shutting down.\n");
   if (GNUNET_SCHEDULER_NO_TASK != server->listen_task)
   {
     GNUNET_SCHEDULER_cancel (server->listen_task);
@@ -1006,12 +1008,16 @@
  * @param buf buffer with data received from network
  * @param available number of bytes available in buf
  * @param addr address of the sender
- * @param addrlen length of addr
+ * @param addrlen length of @a addr
  * @param errCode code indicating errors receiving, 0 for success
  */
 static void
-process_incoming (void *cls, const void *buf, size_t available,
-                  const struct sockaddr *addr, socklen_t addrlen, int errCode);
+process_incoming (void *cls,
+                  const void *buf,
+                  size_t available,
+                  const struct sockaddr *addr,
+                  socklen_t addrlen,
+                  int errCode);
 
 
 /**




reply via email to

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