gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11048 - gnunet/src/hostlist


From: gnunet
Subject: [GNUnet-SVN] r11048 - gnunet/src/hostlist
Date: Fri, 23 Apr 2010 10:46:51 +0200

Author: wachs
Date: 2010-04-23 10:46:51 +0200 (Fri, 23 Apr 2010)
New Revision: 11048

Modified:
   gnunet/src/hostlist/hostlist-client.c
   gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
Log:


Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c       2010-04-23 07:57:18 UTC (rev 
11047)
+++ gnunet/src/hostlist/hostlist-client.c       2010-04-23 08:46:51 UTC (rev 
11048)
@@ -418,6 +418,7 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Testing new advertised hostlist if it is obtainable\n");
+    current_hostlist = hostlist_to_test;
     return strdup(hostlist_to_test->hostlist_uri);
   }
 
@@ -578,13 +579,15 @@
   return;
 }
 
+
 /**
  * Method updating hostlist statistics
  */
 static void update_hostlist ( )
 {
   char *stat;
-  if ( (use_preconfigured_list == GNUNET_NO) && ( NULL != current_hostlist ) )
+  if ( ((use_preconfigured_list == GNUNET_NO) && ( NULL != current_hostlist )) 
||
+       ((testing_hostlist == GNUNET_YES) && ( NULL != current_hostlist )) )
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Updating hostlist statics for URI 
`%s'\n",current_hostlist->hostlist_uri );
@@ -598,6 +601,8 @@
        GNUNET_asprintf (&stat,
                         gettext_noop("# advertised URI `%s' downloaded"),
                         current_hostlist->hostlist_uri);
+       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                   "Updating downloaded statics for URI to value\n" );
 
        GNUNET_STATISTICS_update ( stats,
                                   stat,
@@ -611,6 +616,9 @@
   current_hostlist = NULL;
   /* Alternating the usage of preconfigured and learned hostlists */
 
+  if (testing_hostlist == GNUNET_YES)
+    return;
+
   if ( GNUNET_YES == learning)
     {
     if (use_preconfigured_list == GNUNET_YES)
@@ -819,14 +827,15 @@
                                _("Download of hostlist `%s' completed.\n"),
                                current_url);
                    download_successful = GNUNET_YES;
+                   update_hostlist();
                    if (GNUNET_YES == testing_hostlist)
                     {
                       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                                         _("Adding successfully tested hostlist 
`%s' datastore.\n"),current_url);
                      insert_hostlist();
+                     hostlist_to_test = NULL;
                      testing_hostlist = GNUNET_NO;
                     }
-                   update_hostlist();
                    }
                  clean_up ();
                  return;

Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c  2010-04-23 
07:57:18 UTC (rev 11047)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c  2010-04-23 
08:46:51 UTC (rev 11048)
@@ -30,7 +30,7 @@
 #include "gnunet_resolver_service.h"
 #include "gnunet_statistics_service.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 #define START_ARM GNUNET_YES
 #define MAX_URL_LEN 1000
@@ -38,7 +38,7 @@
 /**
  * How long until wait until testcases fails
  */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 #define CHECK_INTERVALL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 1)
 
 static int timeout;
@@ -179,7 +179,7 @@
               uint64_t value,
               int is_persistent)
 {
-  if ( (value == 1) && (learned_hostlist_downloaded == GNUNET_NO) )
+  if ( (value == 2) && (learned_hostlist_downloaded == GNUNET_NO) )
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 _("Client has successfully downloaded advertised URI \n"));





reply via email to

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