gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r11227 - gnunet/src/transport
Date: Thu, 6 May 2010 15:26:11 +0200

Author: wachs
Date: 2010-05-06 15:26:11 +0200 (Thu, 06 May 2010)
New Revision: 11227

Modified:
   gnunet/src/transport/plugin_transport_http.c
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2010-05-06 13:21:54 UTC 
(rev 11226)
+++ gnunet/src/transport/plugin_transport_http.c        2010-05-06 13:26:11 UTC 
(rev 11227)
@@ -268,6 +268,8 @@
   if (ret != CURLE_OK)
     {
       /* clean_up (); */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Peer URL is not correct\n");
       return 0;
     }
   CURL_EASY_SETOPT (curl,
@@ -294,6 +296,8 @@
   if (curl_multi == NULL)
     {
       GNUNET_break (0);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "curl multi is not correct\n");
       /* clean_up (); */
       return 0;
     }
@@ -316,6 +320,7 @@
     }
 
 
+
   fd_set rs;
   fd_set ws;
   fd_set es;
@@ -355,10 +360,8 @@
   gws = GNUNET_NETWORK_fdset_create ();
   GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1);
   GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1);
-#if DEBUG_HOSTLIST_CLIENT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Scheduling task for hostlist download using cURL\n");
-#endif
 
   ti_download = GNUNET_SCHEDULER_add_select (plugin->env->sched,
                                    GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -374,7 +377,9 @@
   GNUNET_free(peer_url);
   /* FIXME: */
   bytes_sent = msgbuf_size;
-
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Logging shutdown\n");
+  GNUNET_STATISTICS_set(plugin->env->stats,"shutdown",2, GNUNET_NO);
   return bytes_sent;
 }
 
@@ -604,7 +609,7 @@
   if ( ti_download != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel(plugin->env->sched, ti_download);
-    http_task_v4 = GNUNET_SCHEDULER_NO_TASK;
+    ti_download = GNUNET_SCHEDULER_NO_TASK;
   }
 
   if ( http_task_v4 != GNUNET_SCHEDULER_NO_TASK)

Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-05-06 13:21:54 UTC 
(rev 11226)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-05-06 13:26:11 UTC 
(rev 11227)
@@ -151,6 +151,7 @@
                                        api));
   if (my_private_key != NULL)
     GNUNET_CRYPTO_rsa_key_free (my_private_key);
+
   if (ti_check_stat != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel(sched, ti_check_stat);
   GNUNET_SCHEDULER_shutdown(sched);
@@ -177,9 +178,19 @@
               uint64_t value,
               int is_persistent)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              _("Value: %llums\n"),
-              (unsigned long long) value);
+  if (value==1)
+    {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown, plugin failed \n");
+    fail = GNUNET_YES;
+    shutdown_clean();
+    return;
+    }
+  if (value==2)
+    {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown, plugin not failed \n");
+    shutdown_clean();
+    return;
+    }
   return GNUNET_OK;
 }
 
@@ -195,6 +206,8 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "check...%u \n",  timeout_count);
   ti_check_stat = GNUNET_SCHEDULER_NO_TASK;
+  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
+    return;
 
   if ( timeout_count > 3 )
   {
@@ -203,10 +216,16 @@
   }
   timeout_count++;
 
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
+  GNUNET_STATISTICS_get (stats,
+                         "http-transport",
+                         gettext_noop("shutdown"),
+                         GNUNET_TIME_UNIT_MINUTES,
+                         NULL,
+                         &process_stat,
+                         NULL);
 
   ti_check_stat = GNUNET_SCHEDULER_add_delayed (sched, STAT_INTERVALL, 
&task_check_stat, NULL);
+  return;
 }
 
 /**
@@ -312,7 +331,6 @@
 
   /* check statistics */
   ti_check_stat = GNUNET_SCHEDULER_add_now(sched, &task_check_stat, NULL);
-  //GNUNET_STATISTICS_get(stats, "http-transport", )
 
   //ps shutdown_clean ();
   return;





reply via email to

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