gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6991 - in GNUnet/src: applications/fs/namespace util/netwo


From: gnunet
Subject: [GNUnet-SVN] r6991 - in GNUnet/src: applications/fs/namespace util/network_client
Date: Sun, 1 Jun 2008 20:44:06 -0600 (MDT)

Author: grothoff
Date: 2008-06-01 20:43:51 -0600 (Sun, 01 Jun 2008)
New Revision: 6991

Modified:
   GNUnet/src/applications/fs/namespace/namespace_infotest.c
   GNUnet/src/util/network_client/tcpio.c
Log:
fixes

Modified: GNUnet/src/applications/fs/namespace/namespace_infotest.c
===================================================================
--- GNUnet/src/applications/fs/namespace/namespace_infotest.c   2008-06-02 
02:42:21 UTC (rev 6990)
+++ GNUnet/src/applications/fs/namespace/namespace_infotest.c   2008-06-02 
02:43:51 UTC (rev 6991)
@@ -67,8 +67,6 @@
   GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);        /* give apps time to 
start */
 
   /* ACTUAL TEST CODE */
-  old = GNUNET_NS_namespace_list_all (ectx, cfg, NULL, NULL);
-
   meta = GNUNET_ECRS_meta_data_create ();
   GNUNET_ECRS_meta_data_insert (meta, 0, "test");
   GNUNET_create_random_hash (&root);
@@ -77,12 +75,10 @@
                                     1,
                                     1,
                                     GNUNET_get_time () +
-                                    10 * GNUNET_CRON_MINUTES, "test", meta,
+                                    10 * GNUNET_CRON_MINUTES, meta,
                                     NULL, &root);
   CHECK (uri != NULL);
   GNUNET_ECRS_uri_get_namespace_from_sks (uri, &nsid);
-  newVal = GNUNET_NS_namespace_list_all (ectx, cfg, NULL, NULL);
-  CHECK (old < newVal);
   old = GNUNET_NS_namespace_list_contents (ectx, cfg, &nsid, NULL, NULL);
   euri = GNUNET_NS_add_to_namespace (ectx,
                                      cfg,
@@ -103,7 +99,7 @@
     GNUNET_ECRS_uri_destroy (euri);
   if (meta != NULL)
     GNUNET_ECRS_meta_data_destroy (meta);
-  GNUNET_ECRS_namespace_delete (ectx, cfg, "test");
+  GNUNET_ECRS_namespace_delete (ectx, cfg, &nsid);
 
   GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
   GNUNET_GC_free (cfg);

Modified: GNUnet/src/util/network_client/tcpio.c
===================================================================
--- GNUnet/src/util/network_client/tcpio.c      2008-06-02 02:42:21 UTC (rev 
6990)
+++ GNUnet/src/util/network_client/tcpio.c      2008-06-02 02:43:51 UTC (rev 
6991)
@@ -252,6 +252,7 @@
   int af_index;
   int soerr;
   socklen_t soerrlen;
+  int tries;
 
   GNUNET_GE_ASSERT (NULL, sock != NULL);
   if (sock->sock != NULL)
@@ -268,7 +269,23 @@
   /* loop over all possible address families */
   while (1)
     {
-      if (addr_families[++af_index] == -1)
+      if (af_index == -1)
+       {
+         tries = 10;
+         af_index = 0;
+       }
+      else
+       {
+         /* wait for 500ms before trying again */
+         GNUNET_thread_sleep(GNUNET_CRON_MILLISECONDS * 500);
+         tries--;
+       }
+      if (tries == 0)
+       {
+         af_index++;
+         tries = 10;
+       }
+      if (addr_families[af_index] == -1)
         return GNUNET_SYSERR;
       soaddr = NULL;
       socklen = 0;





reply via email to

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