-fixing misc seaspider parser errors
authorChristian Grothoff <christian@grothoff.org>
Mon, 14 May 2012 23:44:22 +0000 (23:44 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 14 May 2012 23:44:22 +0000 (23:44 +0000)
src/ats/perf_ats_mlp.c
src/chat/gnunet-chat.c
src/fragmentation/defragmentation.c
src/gns/gnunet-gns-fcfsd.c
src/gns/gnunet-service-gns.c
src/namestore/namestore_api.c
src/transport/plugin_transport_tcp.c

index a06f16c3ec9b917213073060d5de1e887020f321..bace9809f6035fc4593596b341c712dfaec434b3 100644 (file)
@@ -231,7 +231,7 @@ check (void *cls, char *const *args, const char *cfgfile,
   if ((update_percentage >= 0) && (update_percentage <= 100))
   {
     update = GNUNET_YES;
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u \% updated addresses\n", update_percentage);
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Benchmarking with existing presolution and %u%% updated addresses\n", update_percentage);
   }
   else if ((update_percentage > 100) && (update_percentage != UINT_MAX))
   {
index fb958d98aa01ebae04506bde6fd93487ed0dd652..7b11c0d1870cfdd8b297ca1e65a3e8ab10a61299 100644 (file)
@@ -44,13 +44,14 @@ static struct GNUNET_CONTAINER_MetaData *meta;
 
 static struct GNUNET_CHAT_Room *room;
 
-static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task =
-    GNUNET_SCHEDULER_NO_TASK;
+static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task;
+
+typedef int (*ActionFunction)(const char *argumetns, const void *xtra);
 
 struct ChatCommand
 {
   const char *command;
-  int (*Action) (const char *arguments, const void *xtra);
+  ActionFunction Action;
   const char *helptext;
 };
 
@@ -234,7 +235,8 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info,
                 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *member_id,
                 enum GNUNET_CHAT_MsgOptions options)
 {
-  char *nick, *non_unique_nick;
+  char *nick;
+  char *non_unique_nick;
   int nick_is_a_dup;
   GNUNET_HashCode id;
   struct UserList *pos;
index b07f2040772819249b9f137683cb00940adb0a23..061277c415c39e08612a8669b3a9a23100659ea1 100644 (file)
@@ -362,7 +362,7 @@ estimate_latency (struct MessageContext *mc)
   if (ret.rel_value == 0)
     ret = GNUNET_TIME_UNIT_MILLISECONDS;        /* always at least 1 */
   return ret;
-};
+}
 
 
 /**
index 7e099df6221baf21e313c9b6405499ce616e37e8..accdf1e0d319d38b742e82a80a2e1feb6bbfab42 100644 (file)
@@ -621,7 +621,7 @@ run_httpd ()
   struct GNUNET_NETWORK_FDSet *wes;
   int max;
   int haveto;
-  unsigned MHD_LONG_LONG timeout;
+  MHD_LONG_LONG timeout;
   struct GNUNET_TIME_Relative tv;
 
   FD_ZERO (&rs);
index 9caa52c264037868cdbd49af3bf02c4b533a1493..26a496d4aeea99d56167ef24bbf74825f7a3b612 100644 (file)
@@ -146,14 +146,14 @@ struct GNUNET_CRYPTO_ShortHashCode zone_hash;
 /**
  * Useful for zone update for DHT put
  */
-static int num_public_records = 0;
+static int num_public_records;
 
 /**
  * update interval in seconds
  */
-static unsigned long long int max_record_put_interval;
+static unsigned long long max_record_put_interval;
 
-static unsigned long long int dht_max_update_interval;
+static unsigned long long dht_max_update_interval;
 
 /* dht update interval FIXME define? */
 static struct GNUNET_TIME_Relative record_put_interval;
@@ -383,10 +383,9 @@ put_gns_record(void *cls,
 static void
 update_zone_dht_start(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n");
-  
-  unsigned long long int interval = 0;
+  unsigned long long interval = 0;
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n");
   if (0 == num_public_records)
   {
     /**
index 8c55e13a45eb33b32a8364033340181c23881ff3..eadbeb55fbb358dfb71a64fb01de6d5667bc341d 100644 (file)
@@ -935,7 +935,8 @@ clean_up_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   }
   GNUNET_free(h);
   h = NULL;
-};
+}
+
 
 /**
  * Disconnect from the namestore service (and free associated
index 9c3fedc7566c4249c7f2a8062a06e9edf389328a..1a4ab765aa47a6335fbf3d411cb8660f06a12601 100644 (file)
@@ -457,6 +457,8 @@ plugin_tcp_access_check (void *cls,
 {
   struct Plugin *plugin = cls;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Accepting new incoming TCP connection\n");
   if (0 == plugin->max_connections)
     return GNUNET_NO;
   plugin->max_connections--;
@@ -712,6 +714,9 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target,
   GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
                    "Creating new session for peer `%4s'\n",
                    GNUNET_i2s (target));
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Creating new TCP session for peer `%s'\n",
+             GNUNET_i2s (target));
 
   ret = GNUNET_malloc (sizeof (struct Session));
   ret->last_activity = GNUNET_TIME_absolute_get ();
@@ -1089,9 +1094,10 @@ struct SessionItCtx
   struct Session * result;
 };
 
-int session_lookup_it (void *cls,
-               const GNUNET_HashCode * key,
-               void *value)
+static int 
+session_lookup_it (void *cls,
+                  const GNUNET_HashCode * key,
+                  void *value)
 {
   struct SessionItCtx * si_ctx = cls;
   struct Session * session = value;
@@ -1144,11 +1150,10 @@ nat_connect_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
                    "NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n",
                    GNUNET_i2s (&session->target), tcp_address_to_string(NULL, session->addr, session->addrlen));
-
   disconnect_session (session);
-
 }
 
+
 /**
  * Create a new session to transmit data to the target
  * This session will used to send data to this peer and the plugin will
@@ -1164,7 +1169,6 @@ tcp_plugin_get_session (void *cls,
 {
   struct Plugin * plugin = cls;
   struct Session * session = NULL;
-
   int af;
   const void *sb;
   size_t sbs;
@@ -1175,20 +1179,19 @@ tcp_plugin_get_session (void *cls,
   const struct IPv6TcpAddress *t6;
   struct GNUNET_ATS_Information ats;
   unsigned int is_natd = GNUNET_NO;
-  size_t addrlen = 0;
+  size_t addrlen;
 
   GNUNET_assert (plugin != NULL);
   GNUNET_assert (address != NULL);
-
   addrlen = address->address_length;
-
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
-                   "Trying to get session for `%s' address length %i\n",
+  GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
+                   "Trying to get session for `%s' address of peer `%s'\n",
                    tcp_address_to_string(NULL, address->address, address->address_length),
-                   addrlen);
+                  GNUNET_i2s (&address->peer));
 
   /* look for existing session */
-  if (GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey))
+  if (GNUNET_YES == 
+      GNUNET_CONTAINER_multihashmap_contains(plugin->sessionmap, &address->peer.hashPubKey))
   {
     struct SessionItCtx si_ctx;
 
@@ -1208,6 +1211,11 @@ tcp_plugin_get_session (void *cls,
                        session);
       return session;
     }
+    GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
+                    "Existing sessions did not match address `%s' or peer `%s'\n",
+                    tcp_address_to_string(NULL, address->address, address->address_length),
+                    GNUNET_i2s (&address->peer));
+
   }
 
   if (addrlen == sizeof (struct IPv6TcpAddress))
@@ -1281,7 +1289,7 @@ tcp_plugin_get_session (void *cls,
                                                &address->peer.hashPubKey)))
   {
     GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
-                     _("Found valid IPv4 NAT address (creating session)!\n"));
+                    "Found valid IPv4 NAT address (creating session)!\n") ;
     session = create_session (plugin, &address->peer, NULL, GNUNET_YES);
     session->addrlen = 0;
     session->addr = NULL;
@@ -1324,7 +1332,7 @@ tcp_plugin_get_session (void *cls,
   }
   plugin->max_connections--;
 
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
+  GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
                    "Asked to transmit to `%4s', creating fresh session using address `%s'.\n",
                    GNUNET_i2s (&address->peer), GNUNET_a2s (sb, sbs));
 
@@ -1769,7 +1777,7 @@ handle_tcp_welcome (void *cls, struct GNUNET_SERVER_Client *client,
     return;
   }
 
-  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp",
+  GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "tcp",
                    "Received %s message from `%4s'\n", "WELCOME",
                    GNUNET_i2s (&wm->clientIdentity));
   GNUNET_STATISTICS_update (plugin->env->stats,