gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16004 - gnunet/src/transport
Date: Fri, 15 Jul 2011 13:41:27 +0200

Author: grothoff
Date: 2011-07-15 13:41:27 +0200 (Fri, 15 Jul 2011)
New Revision: 16004

Modified:
   gnunet/src/transport/plugin_transport_udp.c
   gnunet/src/transport/test_quota_compliance.c
   gnunet/src/transport/test_transport_api.c
Log:
fix

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2011-07-15 11:33:46 UTC (rev 
16003)
+++ gnunet/src/transport/plugin_transport_udp.c 2011-07-15 11:41:27 UTC (rev 
16004)
@@ -938,6 +938,7 @@
        {
          /* remove 'rc' that was inactive the longest */
          rc = GNUNET_CONTAINER_heap_remove_root (plugin->defrags);
+         GNUNET_assert (NULL != rc);
          GNUNET_DEFRAGMENT_context_destroy (rc->defrag);
          GNUNET_free (rc);
        }      

Modified: gnunet/src/transport/test_quota_compliance.c
===================================================================
--- gnunet/src/transport/test_quota_compliance.c        2011-07-15 11:33:46 UTC 
(rev 16003)
+++ gnunet/src/transport/test_quota_compliance.c        2011-07-15 11:41:27 UTC 
(rev 16004)
@@ -559,11 +559,11 @@
 {
   struct PeerContext *me = cls;
 
+  GNUNET_assert (message != NULL);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Exchanging HELLO of size %d with peer (%s)!\n", 
              (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message 
*)message),
              GNUNET_i2s (&me->id));
-  GNUNET_assert (message != NULL);
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
                                       message, &me->id));
@@ -648,8 +648,10 @@
   p->cfg = GNUNET_CONFIGURATION_create ();
   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
   if (GNUNET_CONFIGURATION_have_value (p->cfg,"PATHS", "SERVICEHOME"))
+    {
       GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", "SERVICEHOME", 
&p->servicehome);
-  GNUNET_DISK_directory_remove (p->servicehome);
+      GNUNET_DISK_directory_remove (p->servicehome);
+    }
 
 #if START_ARM
   p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
@@ -922,16 +924,17 @@
   stop_arm (&p1);
   stop_arm (&p2);
 
-  if ((p1.servicehome != NULL) && (p2.servicehome != NULL))
-  {
-    GNUNET_DISK_directory_remove (p1.servicehome);
-    GNUNET_DISK_directory_remove (p2.servicehome);
-    GNUNET_free(p1.servicehome);
-    GNUNET_free(p2.servicehome);
-  }
-
+  if (p1.servicehome != NULL)
+    {
+      GNUNET_DISK_directory_remove (p1.servicehome);
+      GNUNET_free(p1.servicehome);
+    }
+  if (p2.servicehome != NULL)
+    {
+      GNUNET_DISK_directory_remove (p2.servicehome);
+      GNUNET_free(p2.servicehome);
+    }
   GNUNET_free(logger);
-
   return ret;
 }
 

Modified: gnunet/src/transport/test_transport_api.c
===================================================================
--- gnunet/src/transport/test_transport_api.c   2011-07-15 11:33:46 UTC (rev 
16003)
+++ gnunet/src/transport/test_transport_api.c   2011-07-15 11:41:27 UTC (rev 
16004)
@@ -143,11 +143,11 @@
 {
   struct PeerContext *me = cls;
 
+  GNUNET_assert (message != NULL);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Exchanging HELLO of size %d with peer (%s)!\n", 
              (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message 
*)message),
              GNUNET_i2s (&me->id));
-  GNUNET_assert (message != NULL);
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
                                       message, &me->id));
@@ -296,8 +296,14 @@
 
   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
   if (GNUNET_CONFIGURATION_have_value (p->cfg,"PATHS", "SERVICEHOME"))
-      GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", "SERVICEHOME", 
&p->servicehome);
-  GNUNET_DISK_directory_remove (p->servicehome);
+    {
+      GNUNET_assert (GNUNET_OK == 
+                    GNUNET_CONFIGURATION_get_value_string (p->cfg,
+                                                           "PATHS",
+                                                           "SERVICEHOME", 
+                                                           &p->servicehome));
+      GNUNET_DISK_directory_remove (p->servicehome);
+    }
 
 #if START_ARM
   p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
@@ -542,13 +548,16 @@
       GNUNET_free(cert_file_p2);
     }
 
-  if ((p1.servicehome != NULL) && (p2.servicehome != NULL))
-  {
+  if (p1.servicehome != NULL)
+    {
     GNUNET_DISK_directory_remove (p1.servicehome);
-    GNUNET_DISK_directory_remove (p2.servicehome);
     GNUNET_free(p1.servicehome);
-    GNUNET_free(p2.servicehome);
-  }
+    }
+  if.servicehome != NULL)
+    {
+      GNUNET_DISK_directory_remove (p2.servicehome);
+      GNUNET_free(p2.servicehome);
+    }
   return ok;
 }
 




reply via email to

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