gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14564 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r14564 - gnunet/src/testing
Date: Wed, 2 Mar 2011 14:19:55 +0100

Author: nevans
Date: 2011-03-02 14:19:55 +0100 (Wed, 02 Mar 2011)
New Revision: 14564

Modified:
   gnunet/src/testing/testing.c
   gnunet/src/testing/testing_group.c
Log:
Fixes for testing because of my addled brain.

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2011-03-02 12:38:59 UTC (rev 14563)
+++ gnunet/src/testing/testing.c        2011-03-02 13:19:55 UTC (rev 14564)
@@ -164,7 +164,8 @@
               "Successfully started peer `%4s'.\n", GNUNET_i2s (my_identity));
 #endif
   d->id = *my_identity;
-  d->shortname = strdup (GNUNET_i2s (my_identity));
+  if (d->shortname == NULL)
+    d->shortname = strdup (GNUNET_i2s (my_identity));
   d->server = server;
   d->running = GNUNET_YES;
 
@@ -267,6 +268,7 @@
                 NULL, d->cfg, d, _("`scp' did not complete cleanly.\n"));
           return;
         }
+      GNUNET_OS_process_close(d->proc);
 #if DEBUG_TESTING
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Successfully copied configuration file.\n");
@@ -755,6 +757,10 @@
           GNUNET_TRANSPORT_disconnect (d->th);
           d->th = NULL;
         }
+
+      if (NULL != d->dead_cb)
+        d->dead_cb (d->dead_cb_cls, NULL);
+
       /* state clean up and notifications */
       if (d->churn == GNUNET_NO)
         {
@@ -770,9 +776,6 @@
       GNUNET_free_non_null (d->proc);
       d->proc = NULL;
       d->shortname = NULL;
-      if (NULL != d->dead_cb)
-        d->dead_cb (d->dead_cb_cls, NULL);
-
       if (d->churn == GNUNET_NO)
         GNUNET_free (d);
 
@@ -977,7 +980,7 @@
       GNUNET_CRYPTO_hash(&public_key, sizeof(struct 
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &ret->id.hashPubKey);
       ret->shortname = GNUNET_strdup(GNUNET_i2s(&ret->id));
       ret->have_hostkey = GNUNET_YES;
-      GNUNET_free(private_key);
+      GNUNET_CRYPTO_rsa_key_free(private_key);
     }
 
   /* Write hostkey to file, if we were given one */
@@ -1093,6 +1096,7 @@
         = GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_EXEC_WAIT,
                                         &start_fsm, ret);
       GNUNET_free_non_null(hostkeyfile);
+      GNUNET_free(baseservicehome);
       GNUNET_free(servicehome);
       return ret;
     }

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2011-03-02 12:38:59 UTC (rev 14563)
+++ gnunet/src/testing/testing_group.c  2011-03-02 13:19:55 UTC (rev 14564)
@@ -5845,7 +5845,9 @@
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Creating remote dir with command ssh %s %s %s\n", arg,
                   " mkdir -p ", baseservicehome);
+      GNUNET_free(arg);
       GNUNET_OS_process_wait (proc);
+      GNUNET_OS_process_close(proc);
     }
   GNUNET_free(baseservicehome);
 
@@ -6449,8 +6451,9 @@
 internal_shutdown_callback(void *cls, const char *emsg)
 {
   struct PeerShutdownContext *peer_shutdown_ctx = cls;
-  struct ShutdownContext *shutdown_ctx = cls;
+  struct ShutdownContext *shutdown_ctx = peer_shutdown_ctx->shutdown_ctx;
   unsigned int off;
+  struct OutstandingSSH *ssh_pos;
 
   shutdown_ctx->outstanding--;
   if (peer_shutdown_ctx->daemon->hostname != NULL)
@@ -6483,8 +6486,12 @@
           GNUNET_free_non_null (shutdown_ctx->pg->hosts[off].username);
         }
       GNUNET_free_non_null (shutdown_ctx->pg->hosts);
+      while (NULL != (ssh_pos = shutdown_ctx->pg->ssh_head))
+        {
+          GNUNET_CONTAINER_DLL_remove(shutdown_ctx->pg->ssh_head, 
shutdown_ctx->pg->ssh_tail, ssh_pos);
+          GNUNET_free(ssh_pos);
+        }
       GNUNET_free (shutdown_ctx->pg);
-
       GNUNET_free (shutdown_ctx);
     }
   GNUNET_free(peer_shutdown_ctx);




reply via email to

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